aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-15 14:45:48 -0500
committerTed Gould <ted@gould.cx>2010-03-15 14:45:48 -0500
commit065984db24fa4e8723d9dd5add9eec0e71d43ace (patch)
treec1fb709084e534e874b38a8746189a972fec473e
parentda365cbe9598860cc4e74938ded3ad735a6db396 (diff)
downloadayatana-indicator-session-065984db24fa4e8723d9dd5add9eec0e71d43ace.tar.gz
ayatana-indicator-session-065984db24fa4e8723d9dd5add9eec0e71d43ace.tar.bz2
ayatana-indicator-session-065984db24fa4e8723d9dd5add9eec0e71d43ace.zip
Switching around the GConf notification setup to do an entire directory.
-rw-r--r--src/session-service.c20
1 files changed, 8 insertions, 12 deletions
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