summaryrefslogtreecommitdiff
path: root/libappstream-glib/as-store.c
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2016-03-31 18:53:38 +0100
committerRichard Hughes <richard@hughsie.com>2016-03-31 18:54:11 +0100
commitd896d50d42e83463a741e0a26e60016c4f32afa8 (patch)
tree6a2cbbfb7e7aeb6164868fee0e4d310cb39c91c4 /libappstream-glib/as-store.c
parentd196fc01e467af2d206ade417f1c38818be1d3f0 (diff)
downloadappstream-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.c13
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");
}
/**