diff options
author | Richard Hughes <richard@hughsie.com> | 2017-05-16 13:17:25 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2017-05-16 13:17:25 +0100 |
commit | 0e6396946a5f9c3c735aa8fd3de18ddf03d782ff (patch) | |
tree | 48c61f939e23c66a31d58c3777f969437a8ec1cf | |
parent | df09f43f23e94df42b3c85d6845c176bbfd32075 (diff) | |
download | appstream-glib-0e6396946a5f9c3c735aa8fd3de18ddf03d782ff.tar.gz |
Add as_store_get_apps_by_id_merge()
This allows us to get a merge component directly.
-rw-r--r-- | libappstream-glib/as-store.c | 19 | ||||
-rw-r--r-- | libappstream-glib/as-store.h | 2 |
2 files changed, 21 insertions, 0 deletions
diff --git a/libappstream-glib/as-store.c b/libappstream-glib/as-store.c index 080c611..7ff5d4b 100644 --- a/libappstream-glib/as-store.c +++ b/libappstream-glib/as-store.c @@ -477,6 +477,25 @@ as_store_get_apps_by_id (AsStore *store, const gchar *id) } /** + * as_store_get_apps_by_id_merge: + * @store: a #AsStore instance. + * @id: the application full ID. + * + * Gets an array of all the merge applications that match a specific ID. + * + * Returns: (element-type AsApp) (transfer none): an array + * + * Since: 0.7.0 + **/ +GPtrArray * +as_store_get_apps_by_id_merge (AsStore *store, const gchar *id) +{ + AsStorePrivate *priv = GET_PRIVATE (store); + g_return_val_if_fail (AS_IS_STORE (store), NULL); + return g_hash_table_lookup (priv->hash_merge_id, id); +} + +/** * as_store_add_metadata_index: * @store: a #AsStore instance. * @key: the metadata key. diff --git a/libappstream-glib/as-store.h b/libappstream-glib/as-store.h index 898375f..1faf1ad 100644 --- a/libappstream-glib/as-store.h +++ b/libappstream-glib/as-store.h @@ -192,6 +192,8 @@ void as_store_remove_all (AsStore *store); GPtrArray *as_store_get_apps (AsStore *store); GPtrArray *as_store_get_apps_by_id (AsStore *store, const gchar *id); +GPtrArray *as_store_get_apps_by_id_merge (AsStore *store, + const gchar *id); GPtrArray *as_store_get_apps_by_metadata (AsStore *store, const gchar *key, const gchar *value); |