diff options
author | Richard Hughes <richard@hughsie.com> | 2014-10-01 14:33:27 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2014-10-01 16:20:49 +0100 |
commit | cb572a4a521d1aba2a2126b392d289fef86599b8 (patch) | |
tree | 6f7f7318ddb84e39d37ce929653829f825df2dad /libappstream-glib/as-store.c | |
parent | 41bf4041f7361fa71bbdc9c320a9b2a5969b7cc8 (diff) | |
download | appstream-glib-cb572a4a521d1aba2a2126b392d289fef86599b8.tar.gz |
Add as_store_convert_icons()
This allows us to change all the embedded icons to cached icons, or vice-versa.
Diffstat (limited to 'libappstream-glib/as-store.c')
-rw-r--r-- | libappstream-glib/as-store.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libappstream-glib/as-store.c b/libappstream-glib/as-store.c index 1a39651..699b768 100644 --- a/libappstream-glib/as-store.c +++ b/libappstream-glib/as-store.c @@ -862,6 +862,34 @@ as_store_to_xml (AsStore *store, AsNodeToXmlFlags flags) } /** + * as_store_convert_icons: + * @store: a #AsStore instance. + * @kind: the AsIconKind, e.g. %AS_ICON_KIND_EMBEDDED. + * @error: A #GError or %NULL + * + * Converts all the icons in the store to a specific kind. + * + * Returns: %TRUE for success + * + * Since: 0.3.1 + **/ +gboolean +as_store_convert_icons (AsStore *store, AsIconKind kind, GError **error) +{ + AsStorePrivate *priv = GET_PRIVATE (store); + AsApp *app; + guint i; + + /* convert application icons */ + for (i = 0; i < priv->array->len; i++) { + app = g_ptr_array_index (priv->array, i); + if (!as_app_convert_icons (app, kind, error)) + return FALSE; + } + return TRUE; +} + +/** * as_store_to_file: * @store: a #AsStore instance. * @file: file |