[gnome-software] appstream: Don't solely add a stock icon for an app, as it may not exists



commit 614270c01c431c6f6c7734445fb72987997ec563
Author: Matthias Klumpp <matthias tenstral net>
Date:   Fri Apr 24 04:47:46 2020 +0200

    appstream: Don't solely add a stock icon for an app, as it may not exists
    
    This actually properly resolves #918.
    Missing stock icons occur quite frequently, as pretty much any icon can
    be overridden by the theme and therefore stock icon entries are
    plentiful, but no theme covers all icons.
    Therefore, we'll add one that we know exist (the AppStream cached icon)
    as backup.

 plugins/core/gs-appstream.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/plugins/core/gs-appstream.c b/plugins/core/gs-appstream.c
index 80b7384c..a387f2e0 100644
--- a/plugins/core/gs-appstream.c
+++ b/plugins/core/gs-appstream.c
@@ -203,14 +203,11 @@ gs_appstream_refine_icon (GsPlugin *plugin, GsApp *app, XbNode *component)
        /* try a stock icon first */
        icon = gs_appstream_get_icon_by_kind (component, AS_ICON_KIND_STOCK);
        if (icon != NULL) {
-               /* the icon referenced by the AppStream data may not be present in the current theme
-                * (usually more stock icon entries are added to permit huge themes like Papirus
-                * to style all apps in the software center), so we need to check for that here */
-               if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default (),
-                                            as_icon_get_name (icon))) {
-                       gs_app_add_icon (app, icon);
-                       return;
-               }
+               /* the stock icon referenced by the AppStream data may not be present in the current
+                * theme (usually more stock icon entries are added to permit huge themes like Papirus
+                * to style all apps in the software center). Since we can not rely on the icon's presence,
+                * we also add other icons to the list and do not return here. */
+               gs_app_add_icon (app, icon);
        }
 
        /* if HiDPI get a 128px cached icon */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]