diff options
author | Richard Hughes <richard@hughsie.com> | 2016-03-31 18:53:38 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2016-03-31 18:54:11 +0100 |
commit | d896d50d42e83463a741e0a26e60016c4f32afa8 (patch) | |
tree | 6a2cbbfb7e7aeb6164868fee0e4d310cb39c91c4 /libappstream-glib/as-store.c | |
parent | d196fc01e467af2d206ade417f1c38818be1d3f0 (diff) | |
download | appstream-glib-d896d50d42e83463a741e0a26e60016c4f32afa8.tar.gz |
Add as_store_remove_apps_with_veto()
This might be useful to libappstream-builder and gnome-software.
Diffstat (limited to 'libappstream-glib/as-store.c')
-rw-r--r-- | libappstream-glib/as-store.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libappstream-glib/as-store.c b/libappstream-glib/as-store.c index c808751..5763ddb 100644 --- a/libappstream-glib/as-store.c +++ b/libappstream-glib/as-store.c @@ -1590,14 +1590,23 @@ as_store_check_apps_for_veto (AsStore *store) /** * as_store_remove_apps_with_veto: + * @store: a #AsStore instance. + * + * Removes any applications from the store if they have any vetos. + * + * Since: 0.5.13 **/ -static void +void as_store_remove_apps_with_veto (AsStore *store) { guint i; AsApp *app; AsStorePrivate *priv = GET_PRIVATE (store); + _cleanup_uninhibit_ guint32 *tok = NULL; + /* don't shortcut the list as we have to use as_store_remove_app() + * rather than just removing from the GPtrArray */ + tok = as_store_changed_inhibit (store); do { for (i = 0; i < priv->array->len; i++) { app = g_ptr_array_index (priv->array, i); @@ -1609,6 +1618,8 @@ as_store_remove_apps_with_veto (AsStore *store) } } } while (i < priv->array->len); + as_store_changed_uninhibit (&tok); + as_store_perhaps_emit_changed (store, "remove-apps-with-veto"); } /** |