[gnome-software: 1/4] appstream: Make sure kind is set before read during refine




commit 710a31bcb43b1d2c7ac984e2c95958f3cb5d4cc6
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 d812a3c09..2a809cd50 100644
--- a/lib/gs-appstream.c
+++ b/lib/gs-appstream.c
@@ -941,6 +941,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:
@@ -1123,16 +1133,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]