[gnome-software/wip/hughsie/unique_id] f
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/hughsie/unique_id] f
- Date: Fri, 29 Jul 2016 15:03:37 +0000 (UTC)
commit 0585b60cc2ac67a3af8fa96b80c8dc6c96ce9adb
Author: Richard Hughes <richard hughsie com>
Date: Fri Jul 29 16:03:29 2016 +0100
f
src/gs-self-test.c | 11 +++++++----
src/plugins/gs-plugin-appstream.c | 6 +++---
src/plugins/gs-plugin-dummy.c | 3 ++-
3 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/src/gs-self-test.c b/src/gs-self-test.c
index a44aa76..b74503d 100644
--- a/src/gs-self-test.c
+++ b/src/gs-self-test.c
@@ -154,22 +154,25 @@ gs_plugin_func (void)
/* respect priority when deduplicating */
list = gs_app_list_new ();
- app = gs_app_new ("foo:e");
+ app = gs_app_new ("e");
+ gs_app_set_unique_id (app, "user/foo/*/*/e/*/*");
gs_app_list_add (list, app);
gs_app_set_priority (app, 0);
g_object_unref (app);
- app = gs_app_new ("bar:e");
+ app = gs_app_new ("e");
+ gs_app_set_unique_id (app, "user/bar/*/*/e/*/*");
gs_app_list_add (list, app);
gs_app_set_priority (app, 99);
g_object_unref (app);
- app = gs_app_new ("baz:e");
+ app = gs_app_new ("e");
+ gs_app_set_unique_id (app, "user/baz/*/*/e/*/*");
gs_app_list_add (list, app);
gs_app_set_priority (app, 50);
g_object_unref (app);
g_assert_cmpint (gs_app_list_length (list), ==, 3);
gs_app_list_filter_duplicates (list, GS_APP_LIST_FILTER_FLAG_PRIORITY);
g_assert_cmpint (gs_app_list_length (list), ==, 1);
- g_assert_cmpstr (gs_app_get_unique_id (gs_app_list_index (list, 0)), ==, "bar:e");
+ g_assert_cmpstr (gs_app_get_unique_id (gs_app_list_index (list, 0)), ==, "user/bar/*/*/e/*/*");
g_object_unref (list);
}
diff --git a/src/plugins/gs-plugin-appstream.c b/src/plugins/gs-plugin-appstream.c
index 265e202..d4a7946 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -317,16 +317,16 @@ gs_plugin_refine_from_id (GsPlugin *plugin,
return TRUE;
/* nothing found */
-g_warning ("loooking for %s", unique_id);
+ g_debug ("searching appstream for %s", unique_id);
item = as_store_get_app_by_unique_id (priv->store, unique_id);
if (item == NULL) {
const gchar *id = gs_app_get_id (app);
- g_warning ("loooking HARDER for %s", unique_id);
+ g_debug ("looking for fallback of %s", unique_id);
if (g_strcmp0 (unique_id, id) != 0)
item = as_store_get_app_by_id (priv->store, id);
}
if (item == NULL) {
- g_warning ("No app with ID %s found!", unique_id);
+ g_debug ("no app with ID %s found in appstream", unique_id);
return TRUE;
}
diff --git a/src/plugins/gs-plugin-dummy.c b/src/plugins/gs-plugin-dummy.c
index 10dfdfe..b17abd4 100644
--- a/src/plugins/gs-plugin-dummy.c
+++ b/src/plugins/gs-plugin-dummy.c
@@ -304,7 +304,8 @@ gs_plugin_add_popular (GsPlugin *plugin,
gs_app_list_add (list, app1);
/* add again, this time with a prefix so it gets deduplicated */
- app2 = gs_app_new ("dummy:zeus.desktop");
+ app2 = gs_app_new ("zeus.desktop");
+ gs_app_set_unique_id (app2, "user/dummy/*/*/zeus.desktop/*/*");
gs_app_set_metadata (app2, "GnomeSoftware::Creator",
gs_plugin_get_name (plugin));
gs_app_list_add (list, app2);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]