diff options
author | Balló György <[email protected]> | 2014-10-03 07:47:04 +0200 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2014-10-03 11:13:09 +0200 |
commit | e08a6727b5a071f3740543fd900ae60b696c3d72 (patch) | |
tree | 929cef7c2f7d3bfa6ab8ac0acfb1a033cdbeb6c0 | |
parent | 75e3f6c2143ac68829c7e699ea555b91ee4021d0 (diff) | |
download | mate-panel-e08a6727b5a071f3740543fd900ae60b696c3d72.tar.bz2 mate-panel-e08a6727b5a071f3740543fd900ae60b696c3d72.tar.xz |
Do not assume that session manager GSettings schema is available
This removes hard dependency on mate-session-manager (useful for custom environments).
Closes https://github.com/mate-desktop/mate-panel/pull/241
-rw-r--r-- | mate-panel/panel-action-button.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/mate-panel/panel-action-button.c b/mate-panel/panel-action-button.c index fd570cdb..6596f6be 100644 --- a/mate-panel/panel-action-button.c +++ b/mate-panel/panel-action-button.c @@ -37,6 +37,7 @@ #define MATE_DESKTOP_USE_UNSTABLE_API #include <libmate-desktop/mate-desktop-utils.h> #endif +#include <libmate-desktop/mate-gsettings.h> #include <libpanel-util/panel-error.h> #include <libpanel-util/panel-launch.h> @@ -211,12 +212,14 @@ static void panel_action_logout (GtkWidget *widget) { PanelSessionManager *manager; - gboolean prompt; + gboolean prompt = TRUE; - GSettings *msm_settings; - msm_settings = g_settings_new (MATE_SESSION_SCHEMA); - prompt = g_settings_get_boolean (msm_settings, MATE_SESSION_LOGOUT_PROMPT_KEY); - g_object_unref (msm_settings); + if (mate_gsettings_schema_exists (MATE_SESSION_SCHEMA)) { + GSettings *msm_settings; + msm_settings = g_settings_new (MATE_SESSION_SCHEMA); + prompt = g_settings_get_boolean (msm_settings, MATE_SESSION_LOGOUT_PROMPT_KEY); + g_object_unref (msm_settings); + } manager = panel_session_manager_get (); |