[gnome-software/wip/mcrha/as-component-kind: 11/11] gs-appstream: Special-case renamed AsComponentKind values




commit 5395ab83a7c3b6063e48379965c832e3261e23e6
Author: Milan Crha <mcrha redhat com>
Date:   Tue Aug 10 07:50:30 2021 +0200

    gs-appstream: Special-case renamed AsComponentKind values
    
    The two had been renamed, not matching the value stored in the appstream
    data files anymore, thus special-case them, to have the component kind
    properly set.

 lib/gs-appstream.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/lib/gs-appstream.c b/lib/gs-appstream.c
index b5dbfb2df..95f6d420a 100644
--- a/lib/gs-appstream.c
+++ b/lib/gs-appstream.c
@@ -1052,7 +1052,13 @@ gs_appstream_refine_app (GsPlugin *plugin,
        if (gs_app_get_kind (app) == AS_COMPONENT_KIND_UNKNOWN ||
            gs_app_get_kind (app) == AS_COMPONENT_KIND_GENERIC) {
                tmp = xb_node_get_attr (component, "type");
-               gs_app_set_kind (app, as_component_kind_from_string (tmp));
+               /* These two had been renamed in the AsComponentKind type */
+               if (g_strcmp0 (tmp, "webapp") == 0)
+                       gs_app_set_kind (app, AS_COMPONENT_KIND_WEB_APP);
+               else if (g_strcmp0 (tmp, "console") == 0)
+                       gs_app_set_kind (app, AS_COMPONENT_KIND_CONSOLE_APP);
+               else
+                       gs_app_set_kind (app, as_component_kind_from_string (tmp));
        }
 
        /* set the release date */


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