From 065984db24fa4e8723d9dd5add9eec0e71d43ace Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 15 Mar 2010 14:45:48 -0500 Subject: Switching around the GConf notification setup to do an entire directory. --- src/session-service.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/session-service.c b/src/session-service.c index b976236..72a93eb 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -91,7 +91,6 @@ static DbusmenuMenuitem * restart_mi = NULL; static DbusmenuMenuitem * shutdown_mi = NULL; static GConfClient * gconf_client = NULL; -static guint notify_lockdown_id = 0; static void lockdown_changed (GConfClient *client, @@ -129,20 +128,17 @@ lockdown_changed (GConfClient *client, return; } +/* Ensures that we have a GConf client and if we build one + set up the signal handler. */ static void ensure_gconf_client (void) { - if (!gconf_client) - { - gconf_client = gconf_client_get_default (); - - notify_lockdown_id = gconf_client_notify_add (gconf_client, - LOCKDOWN_KEY_USER, - lockdown_changed, - NULL, - NULL, - NULL); - } + if (!gconf_client) { + gconf_client = gconf_client_get_default (); + gconf_client_add_dir(gconf_client, LOCKDOWN_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); + gconf_client_notify_add(gconf_client, LOCKDOWN_DIR, lockdown_changed, NULL, NULL, NULL); + } + return; } /* A return from the command to sleep the system. Make sure -- cgit v1.2.3