[gnome-software/wip/jrocha/fix_popular_override: 2/4] gs-appstream: Use the unique id of an AsApp when creating a GsApp



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

    gs-appstream: Use the unique id of an AsApp when creating a GsApp
    
    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]