GNOME Bugzilla – Bug 766924
GNOME Software doesn't list apps if their stock icon is missing, even if a valid cached icon is available
Last modified: 2016-06-10 12:21:27 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
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.
Review of attachment 328637 [details] [review]: apparently this patch is very very bad
This seems to be fixed via this patch series: https://git.gnome.org/browse/gnome-software/commit/?id=f457dae6560799c3cd8ec9a738c0504547231d4e https://git.gnome.org/browse/gnome-software/commit/?id=6dc4e947835052f0a8e3e5bf35d17c0f78a23f4d https://git.gnome.org/browse/gnome-software/commit/?id=785f06d4acc6e14bf78ac479a1970bd19a172c55 Marking as such.