[gnome-shell/wip/desktop-file-index: 13/14] app-system: Put back support for the installed-changed signal
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/desktop-file-index: 13/14] app-system: Put back support for the installed-changed signal
- Date: Tue, 1 Oct 2013 20:55:10 +0000 (UTC)
commit d40fb26c20d9c3c82daf6f601523b71f760da1fa
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Sep 26 17:11:45 2013 -0400
app-system: Put back support for the installed-changed signal
Use the new GAppInfoMonitor that Ryan added to glib to know when the
set of apps has changed.
src/shell-app-system.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/shell-app-system.c b/src/shell-app-system.c
index 6fab7a9..d9b0daa 100644
--- a/src/shell-app-system.c
+++ b/src/shell-app-system.c
@@ -72,9 +72,19 @@ static void shell_app_system_class_init(ShellAppSystemClass *klass)
}
static void
+installed_changed (GAppInfoMonitor *monitor,
+ gpointer user_data)
+{
+ ShellAppSystem *self = user_data;
+
+ g_signal_emit (self, signals[INSTALLED_CHANGED], 0, NULL);
+}
+
+static void
shell_app_system_init (ShellAppSystem *self)
{
ShellAppSystemPrivate *priv;
+ GAppInfoMonitor *monitor;
self->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
SHELL_TYPE_APP_SYSTEM,
@@ -88,6 +98,10 @@ shell_app_system_init (ShellAppSystem *self)
priv->startup_wm_class_to_app = g_hash_table_new_full (g_str_hash, g_str_equal,
NULL,
(GDestroyNotify)g_object_unref);
+
+ monitor = g_app_info_monitor_get ();
+ g_signal_connect (monitor, "changed", G_CALLBACK (installed_changed), self);
+ installed_changed (monitor, self);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]