[gnome-software/gnome-41: 2/5] appstream: Make sure kind is set before read during refine




commit 2dc51030b664f7789e201dd35d84138d05b8d06e
Author: Pablo Correa Gómez <ablocorrea hotmail com>
Date:   Fri Mar 4 18:04:12 2022 +0100

    appstream: Make sure kind is set before read during refine
    
    Otherwise, the not launchable quirk might be set or skipped based
    on the app kind not being yet updated

 lib/gs-appstream.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/lib/gs-appstream.c b/lib/gs-appstream.c
index 8e1575959..1fe0ca928 100644
--- a/lib/gs-appstream.c
+++ b/lib/gs-appstream.c
@@ -889,6 +889,16 @@ gs_appstream_refine_app (GsPlugin *plugin,
                }
        }
 
+       /* set id kind */
+       if (gs_app_get_kind (app) == AS_COMPONENT_KIND_UNKNOWN ||
+           gs_app_get_kind (app) == AS_COMPONENT_KIND_GENERIC) {
+               AsComponentKind kind;
+               tmp = xb_node_get_attr (component, "type");
+               kind = as_component_kind_from_string (tmp);
+               if (kind != AS_COMPONENT_KIND_UNKNOWN)
+                       gs_app_set_kind (app, kind);
+       }
+
        /* types we can never launch */
        switch (gs_app_get_kind (app)) {
        case AS_COMPONENT_KIND_ADDON:
@@ -1071,16 +1081,6 @@ gs_appstream_refine_app (GsPlugin *plugin,
                        gs_app_set_developer_name (app, tmp);
        }
 
-       /* set id kind */
-       if (gs_app_get_kind (app) == AS_COMPONENT_KIND_UNKNOWN ||
-           gs_app_get_kind (app) == AS_COMPONENT_KIND_GENERIC) {
-               AsComponentKind kind;
-               tmp = xb_node_get_attr (component, "type");
-               kind = as_component_kind_from_string (tmp);
-               if (kind != AS_COMPONENT_KIND_UNKNOWN)
-                       gs_app_set_kind (app, kind);
-       }
-
        /* set the release date */
        timestamp = component_get_release_timestamp (component);
        if (timestamp != G_MAXUINT64)


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