[gnome-software/wip/jrocha/fix_popular_overrides: 16/20] Use the unique id of an AsApp when creating a GsApp in gs-appstream
- From: Joaquim Manuel Pereira Rocha <jrocha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/jrocha/fix_popular_overrides: 16/20] Use the unique id of an AsApp when creating a GsApp in gs-appstream
- Date: Wed, 5 Apr 2017 14:30:05 +0000 (UTC)
commit 3bab51d5a94f7445b8213ea9bb765778bd979c9f
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]