Bug 496178

Summary: Absolute icon paths in desktop files are ignored when icon is displayed in KRunner and Kickoff/kicker/dashboard/etc
Product: [Plasma] plasmashell Reporter: hexchain <kde>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: CONFIRMED ---    
Severity: minor CC: alexander.lohnau, kde, nate
Priority: NOR    
Version: 6.2.3   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description hexchain 2024-11-12 15:06:53 UTC
SUMMARY
It seems that if the "Icon" property in a desktop file contains a full path, the last part (i.e. "basename") is first used to look up an icon in the icon theme. The actual file will only be used if the icon theme does not contain an icon with the same (file) name.

STEPS TO REPRODUCE
1. Create a desktop file with the following content and place it to ~/.local/share/applications/test-app.desktop:

[Desktop Entry]
Version=1.0
Type=Application
Icon=/tmp/hwinfo.svg
Exec=/usr/bin/true
Name=TestApp

2. Download an SVG icon (e.g. https://github.com/PapirusDevelopmentTeam/papirus-icon-theme/raw/refs/heads/master/Papirus/32x32/apps/firefox.svg) and save it to /tmp/hwinfo.svg

3. Launch KRunner or Kickoff and try to find TestApp.

OBSERVED RESULT
TestApp has the "hwinfo" icon, not the downloaded one.

EXPECTED RESULT
If the "test-app" (desktop file name) icon exists in the icon theme, it should be used for TestApp. If it does not (as in this case), the downloaded SVG icon should be used instead.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.2.3
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.0
Kernel Version: 6.11.6-arch1-1 (64-bit)
Graphics Platform: Wayland
Comment 1 Nate Graham 2024-11-13 17:37:51 UTC
Can reproduce! How strange.

The icon is displayed correctly in Task Manager; it's only wrong in KRunner and Kickoff.