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 766924 - GNOME Software doesn't list apps if their stock icon is missing, even if a valid cached icon is available
GNOME Software doesn't list apps if their stock icon is missing, even if a va...
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: 2016-05-26 17:53 UTC by Matthias Klumpp
Modified: 2016-06-10 12:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
appstream: Try all icons in case the first one is invalid (4.77 KB, patch)
2016-05-27 12:49 UTC, Iain Lane
rejected Details | Review

Description Matthias Klumpp 2016-05-26 17:53:08 UTC
Hi!
As discussed on IRC, GNOME Software calls the asglib function `as_app_get_icon_default` which returns a "default" icon preferring stock icons over cached icons, which, in itself, is the right thing to do since we want icons to follow the current theme.
Unfortunately, if the current theme doesn't contain the icon (which e.g. is the case for Scribus), GS will simply stop looking for a better icon and ignore the perfectly valid cached icon.
Additionally, the current bahvior has the weird effect that GNOME Software shows different apps depending on the theme, e.g. on KDE Plasma, Scribus will show up because the icon theme contains an icon for it.

This could be fixed by probing the theme for an icon, and if it isn't there, jump to the second-best icon choice.

Cheers,
    Matthias
Comment 1 Iain Lane 2016-05-27 12:49:18 UTC
Created attachment 328637 [details] [review]
appstream: Try all icons in case the first one is invalid

This is common in the case of stock icons where we want to use the
theme's icon if it is there but it's okay for it not to be.

--

I would have preferred to keep the list of icons sorted to just be able to loop
over the array, but I wasn't sure that changing asglib would have been a good
idea here (the sort function for AsIcon doesn't sort this way atm, and it might
have been too slow?).

Instead, this patch picks the "default" icon, which is the most preferred one,
and then removes this one completely if we can't load it in order to make the
next most preferred the default.

Test case is scribus in Ubuntu yakkety currently.
Comment 2 Iain Lane 2016-05-27 14:14:28 UTC
Review of attachment 328637 [details] [review]:

apparently this patch is very very bad