From 1290c1032eea7ce2f8bdd28e3bebf618b47216ca Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 19 Aug 2011 11:06:40 -0500 Subject: Fix getting of all the keys to be settings functions --- src/gconf-helper.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/gconf-helper.c') diff --git a/src/gconf-helper.c b/src/gconf-helper.c index 3bd254a..f9e73ad 100644 --- a/src/gconf-helper.c +++ b/src/gconf-helper.c @@ -41,36 +41,36 @@ static guint logout_notify = 0; static guint restart_notify = 0; static guint shutdown_notify = 0; -gboolean -supress_confirmations (void) { +static void +build_settings (void) { if(!settings) { - settings = g_settings_new ("com.canonical.indicators.sound"); + settings = g_settings_new (SESSION_SCHEMA); } - return g_settings_get_boolean (settings, SUPPRESS_KEY, NULL) ; + return; +} + +gboolean +supress_confirmations (void) { + build_settings(); + return g_settings_get_boolean (settings, SUPPRESS_KEY) ; } gboolean show_logout (void) { - if(!gconf_client) { - gconf_client = gconf_client_get_default (); - } - return !gconf_client_get_bool (gconf_client, LOGOUT_KEY, NULL) ; + build_settings(); + return !g_settings_get_boolean (settings, LOGOUT_KEY) ; } gboolean show_restart (void) { - if(!gconf_client) { - gconf_client = gconf_client_get_default (); - } - return !gconf_client_get_bool (gconf_client, RESTART_KEY, NULL) ; + build_settings(); + return !g_settings_get_boolean (settings, RESTART_KEY) ; } gboolean show_shutdown (void) { - if(!gconf_client) { - gconf_client = gconf_client_get_default (); - } - return !gconf_client_get_bool (gconf_client, SHUTDOWN_KEY, NULL) ; + build_settings(); + return !g_settings_get_boolean (settings, SHUTDOWN_KEY) ; } static void update_menu_entries_callback (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer data) { -- cgit v1.2.3