After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 733998 - Icons aren't properly loaded under Ubuntu
Icons aren't properly loaded under Ubuntu
Status: RESOLVED FIXED
Product: gnome-software
Classification: Applications
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME Software maintainer(s)
GNOME Software maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-07-30 16:40 UTC by fakey
Modified: 2014-07-31 15:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add icon directory to theme search path (7.65 KB, patch)
2014-07-30 16:44 UTC, fakey
none Details | Review
Add icon directory to theme search path (8.05 KB, patch)
2014-07-31 09:20 UTC, fakey
none Details | Review

Description fakey 2014-07-30 16:40:09 UTC
In Ubuntu, when launching GNOME Software, we get failures to load app icons, e.g.:

(org.gnome.Software:31009): GsPlugin-WARNING **: failed to load cached icon xchat: Failed to open file '/usr/share/app-install/icons/xchat': No such file or directory

This makes every app invalid, leading to:

(org.gnome.Software:31009): Gs-WARNING **: failed to get featured apps: no featured apps to show

The cause is that the Icon field in the .desktop files omits the file extension (e.g. xchat vs xchat.svg). Appending this to the icon directory isn't sufficient (e.g. /usr/share/app-install/icons/xchat, while the file is at /usr/share/app-install/icons/xchat.svg). We actually have to load it as an actual icon from an icon theme with the correct theme search path.
Comment 1 fakey 2014-07-30 16:44:50 UTC
Created attachment 282095 [details] [review]
Add icon directory to theme search path
Comment 2 fakey 2014-07-31 09:20:05 UTC
Created attachment 282129 [details] [review]
Add icon directory to theme search path

org.gnome.Weather.Application is an icon name with full stop characters in it. So we need to modify gs_pixbuf_load () to accept it as an icon name too.
Comment 3 Kalev Lember 2014-07-31 13:54:07 UTC
Where does the metadata on Ubuntu come from? Do you know why it has 'xchat' instead of 'xchat.png' in the metadata?
Comment 4 fakey 2014-07-31 14:12:47 UTC
The meta-data comes from a package called app-install-data. Here's an example .desktop:

[Desktop Entry]
X-AppInstall-Package=xchat
X-AppInstall-Popcon=1348
X-AppInstall-Section=universe

Encoding=UTF-8
Name=XChat IRC
Comment=Chat with other people using Internet Relay Chat
Exec=sh -c "xchat --existing --url %U || exec xchat"
Icon=xchat
Terminal=false
Type=Application
Categories=Network;
StartupNotify=true
MimeType=x-scheme-handler/irc;x-scheme-handler/ircs;

X-Ubuntu-Gettext-Domain=app-install-data

It seems like the icon in the .desktop file is only a name, and the icons directory is meant to be treated as a GtkIconTheme directory.
Comment 5 Richard Hughes 2014-07-31 15:00:46 UTC
Patch looks good, thanks. I had to fix it up to not fail to load icons with AppStream metadata-style names, and I also made some of the new icon theme stuf match the AppStream name for clarity.