summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2016-10-31 12:16:42 +0000
committerRichard Hughes <richard@hughsie.com>2016-10-31 12:16:42 +0000
commit3057feffddafd1295687b9d7501db89e645a0b34 (patch)
tree33f6e3f91e7250457a3a7a4c7e58facd8e5d610f /client
parentde08b0d844e8b6f30eb62857999d436a389a8e66 (diff)
downloadappstream-glib-3057feffddafd1295687b9d7501db89e645a0b34.tar.gz
Add app-removed, app-added and app-changed signals to AsStore
This allows us to invalidate things built from the AsApp objects.
Diffstat (limited to 'client')
-rw-r--r--client/as-util.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/client/as-util.c b/client/as-util.c
index 6fba2f6..4be1f1d 100644
--- a/client/as-util.c
+++ b/client/as-util.c
@@ -1202,6 +1202,27 @@ as_util_watch_store_changed_cb (AsStore *store, AsUtilPrivate *priv)
as_store_get_size (store));
}
+static void
+as_util_watch_store_app_added_cb (AsStore *store, AsApp *app, AsUtilPrivate *priv)
+{
+ g_print ("Component added to store: %s\n",
+ as_app_get_unique_id (app));
+}
+
+static void
+as_util_watch_store_app_removed_cb (AsStore *store, AsApp *app, AsUtilPrivate *priv)
+{
+ g_print ("Component removed from store: %s\n",
+ as_app_get_unique_id (app));
+}
+
+static void
+as_util_watch_store_app_changed_cb (AsStore *store, AsApp *app, AsUtilPrivate *priv)
+{
+ g_print ("Component changed in store: %s\n",
+ as_app_get_unique_id (app));
+}
+
static gboolean
as_util_watch (AsUtilPrivate *priv, gchar **values, GError **error)
{
@@ -1225,6 +1246,12 @@ as_util_watch (AsUtilPrivate *priv, gchar **values, GError **error)
}
g_signal_connect (store, "changed",
G_CALLBACK (as_util_watch_store_changed_cb), priv);
+ g_signal_connect (store, "app-added",
+ G_CALLBACK (as_util_watch_store_app_added_cb), priv);
+ g_signal_connect (store, "app-removed",
+ G_CALLBACK (as_util_watch_store_app_removed_cb), priv);
+ g_signal_connect (store, "app-changed",
+ G_CALLBACK (as_util_watch_store_app_changed_cb), priv);
/* wait */
g_main_loop_run (priv->loop);