diff options
author | Richard Hughes <richard@hughsie.com> | 2014-04-23 15:06:54 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2014-04-23 15:43:18 +0100 |
commit | 9f6c6e6146bc6b6b10ca79a0f73249b9c63d0f81 (patch) | |
tree | 7d665f4d461c81297f578100309f7b0e384db889 | |
parent | ba2da8a9d4e4e0b06597ba26355101273655571b (diff) | |
download | appstream-glib-9f6c6e6146bc6b6b10ca79a0f73249b9c63d0f81.tar.gz |
When adding a duplicate AppStream application merge the entries
-rw-r--r-- | libappstream-glib/as-store.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libappstream-glib/as-store.c b/libappstream-glib/as-store.c index b5a0caa..b7dbe72 100644 --- a/libappstream-glib/as-store.c +++ b/libappstream-glib/as-store.c @@ -311,6 +311,15 @@ as_store_add_app (AsStore *store, AsApp *app) return; } + /* same priority */ + if (as_app_get_priority (item) == + as_app_get_priority (app)) { + g_debug ("merging duplicate AppStream entries: %s", id); + as_app_subsume_full (item, app, + AS_APP_SUBSUME_FLAG_BOTH_WAYS); + return; + } + /* this new item has a higher priority than the one we've * previously stored */ g_debug ("replacing duplicate AppStream entry: %s", id); |