[gnome-software/gnome-3-24] Use the unique id of an AsApp when creating a GsApp in gs-appstream



commit fa78a66414aada36a2d530c3f2c0548b597bdde5
Author: Joaquim Rocha <jrocha endlessm com>
Date:   Fri Mar 31 21:13:28 2017 +0200

    Use the unique id of an AsApp when creating a GsApp in gs-appstream
    
    Instead of using the simple id when creating a GsApp from an AsApp, we
    should use its unique id instead because it may have extra information
    that the simple id won't, e.g. the bundle kind, app kind, etc.
    
    This leads to a GsApp that is closer to the AsApp that it represents.

 plugins/core/gs-appstream.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/plugins/core/gs-appstream.c b/plugins/core/gs-appstream.c
index ed66f5b..7698bad 100644
--- a/plugins/core/gs-appstream.c
+++ b/plugins/core/gs-appstream.c
@@ -33,7 +33,7 @@ gs_appstream_create_app (GsPlugin *plugin, AsApp *item, GError **error)
        const gchar *unique_id = as_app_get_unique_id (item);
        GsApp *app = gs_plugin_cache_lookup (plugin, unique_id);
        if (app == NULL) {
-               app = gs_app_new (as_app_get_id (item));
+               app = gs_app_new_from_unique_id (unique_id);
                gs_app_set_metadata (app, "GnomeSoftware::Creator",
                                     gs_plugin_get_name (plugin));
                if (!gs_appstream_refine_app (plugin, app, item, error)) {


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