[gnome-software] trivial: Use new libappstream-glib to build the ID



commit 8d7c0c3ea380df799ae9faf106b5bac6df5aa35c
Author: Richard Hughes <richard hughsie com>
Date:   Wed Oct 12 10:10:08 2016 +0100

    trivial: Use new libappstream-glib to build the ID
    
    The UUID typically contains a '@' which is not a valid char.

 src/plugins/gs-plugin-shell-extensions.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)
---
diff --git a/src/plugins/gs-plugin-shell-extensions.c b/src/plugins/gs-plugin-shell-extensions.c
index 5484078..9195516 100644
--- a/src/plugins/gs-plugin-shell-extensions.c
+++ b/src/plugins/gs-plugin-shell-extensions.c
@@ -98,12 +98,6 @@ gs_plugin_adopt_app (GsPlugin *plugin, GsApp *app)
                gs_app_set_management_plugin (app, gs_plugin_get_name (plugin));
 }
 
-static gchar *
-gs_plugin_shell_extensions_id_from_uuid (const gchar *uuid)
-{
-       return g_strdup_printf ("%s.shell-extension", uuid);
-}
-
 static AsAppState
 gs_plugin_shell_extensions_convert_state (guint value)
 {
@@ -136,7 +130,7 @@ gs_plugin_shell_extensions_add_app (GsPlugin *plugin,
        g_autofree gchar *id = NULL;
        g_autoptr(AsIcon) ic = NULL;
 
-       id = gs_plugin_shell_extensions_id_from_uuid (uuid);
+       id = as_utils_appstream_id_build (uuid);
        gs_app_set_id (app, id);
        gs_app_set_scope (app, AS_APP_SCOPE_USER);
        gs_app_set_metadata (app, "GnomeSoftware::Creator",
@@ -480,7 +474,7 @@ gs_plugin_shell_extensions_parse_app (GsPlugin *plugin,
        tmp = json_object_get_string_member (json_app, "uuid");
        if (tmp != NULL) {
                g_autofree gchar *id = NULL;
-               id = gs_plugin_shell_extensions_id_from_uuid (tmp);
+               id = as_utils_appstream_id_build (tmp);
                as_app_set_id (app, id);
                as_app_add_metadata (app, "shell-extensions::uuid", tmp);
        }


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