diff options
-rw-r--r-- | src/gconf-helper.c | 32 | ||||
-rw-r--r-- | src/gconf-helper.h | 10 |
2 files changed, 21 insertions, 21 deletions
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) { diff --git a/src/gconf-helper.h b/src/gconf-helper.h index 039b309..0d84dc6 100644 --- a/src/gconf-helper.h +++ b/src/gconf-helper.h @@ -33,11 +33,11 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <libdbusmenu-glib/server.h> #include <libdbusmenu-glib/menuitem.h> -#define GLOBAL_DIR "/apps/indicator-session" -#define SUPPRESS_KEY GLOBAL_DIR "/suppress_logout_restart_shutdown" -#define LOGOUT_KEY GLOBAL_DIR "/suppress_logout_menuitem" -#define RESTART_KEY GLOBAL_DIR "/suppress_restart_menuitem" -#define SHUTDOWN_KEY GLOBAL_DIR "/suppress_shutdown_menuitem" +#define SESSION_SCHEMA "org.canonical.indicator.session" +#define SUPPRESS_KEY "suppress_logout_restart_shutdown" +#define LOGOUT_KEY "suppress_logout_menuitem" +#define RESTART_KEY "suppress_restart_menuitem" +#define SHUTDOWN_KEY "suppress_shutdown_menuitem" #define LOCKDOWN_DIR "/desktop/gnome/lockdown" #define LOCKDOWN_KEY_USER LOCKDOWN_DIR "/disable_user_switching" |