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. https://bugzilla.gnome.org/show_bug.cgi?id=711631
This commit is contained in:
parent
213ee8d381
commit
e10d2a68f3
@ -71,10 +71,20 @@ static void shell_app_system_class_init(ShellAppSystemClass *klass)
|
|||||||
g_type_class_add_private (gobject_class, sizeof (ShellAppSystemPrivate));
|
g_type_class_add_private (gobject_class, sizeof (ShellAppSystemPrivate));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
installed_changed (GAppInfoMonitor *monitor,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
ShellAppSystem *self = user_data;
|
||||||
|
|
||||||
|
g_signal_emit (self, signals[INSTALLED_CHANGED], 0, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
shell_app_system_init (ShellAppSystem *self)
|
shell_app_system_init (ShellAppSystem *self)
|
||||||
{
|
{
|
||||||
ShellAppSystemPrivate *priv;
|
ShellAppSystemPrivate *priv;
|
||||||
|
GAppInfoMonitor *monitor;
|
||||||
|
|
||||||
self->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
|
self->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
|
||||||
SHELL_TYPE_APP_SYSTEM,
|
SHELL_TYPE_APP_SYSTEM,
|
||||||
@ -86,6 +96,10 @@ shell_app_system_init (ShellAppSystem *self)
|
|||||||
(GDestroyNotify)g_object_unref);
|
(GDestroyNotify)g_object_unref);
|
||||||
|
|
||||||
priv->startup_wm_class_to_id = g_hash_table_new (g_str_hash, g_str_equal);
|
priv->startup_wm_class_to_id = g_hash_table_new (g_str_hash, g_str_equal);
|
||||||
|
|
||||||
|
monitor = g_app_info_monitor_get ();
|
||||||
|
g_signal_connect (monitor, "changed", G_CALLBACK (installed_changed), self);
|
||||||
|
installed_changed (monitor, self);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user