diff options
author | Stefano Karapetsas <[email protected]> | 2012-12-15 18:08:39 -0800 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2012-12-15 18:08:39 -0800 |
commit | f69bf6e7ffce7feb7a595996f7f0c746a47c8308 (patch) | |
tree | d556e19c1196cfa1b159bf296216d766988b7f71 /src/gpm-control.c | |
parent | e8ce2f281bd7cb4597c9444983b7a0b6bbef0216 (diff) | |
parent | 5f86620759f2e522bda0e73f6c56fcb7c50d5295 (diff) | |
download | mate-power-manager-f69bf6e7ffce7feb7a595996f7f0c746a47c8308.tar.bz2 mate-power-manager-f69bf6e7ffce7feb7a595996f7f0c746a47c8308.tar.xz |
Merge pull request #46 from bhull2010/master
Make mate-keyring support optional
Diffstat (limited to 'src/gpm-control.c')
-rw-r--r-- | src/gpm-control.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/gpm-control.c b/src/gpm-control.c index 4b6c959..105a6d1 100644 --- a/src/gpm-control.c +++ b/src/gpm-control.c @@ -39,9 +39,12 @@ #include <glib/gi18n.h> #include <dbus/dbus-glib.h> #include <dbus/dbus-glib-lowlevel.h> -#include <mate-keyring.h> #include <libupower-glib/upower.h> +#ifdef WITH_KEYRING +#include <mate-keyring.h> +#endif /* WITH_KEYRING */ + #include "egg-debug.h" #include "egg-console-kit.h" @@ -157,10 +160,12 @@ gpm_control_suspend (GpmControl *control, GError **error) gboolean ret = FALSE; gboolean do_lock; gboolean nm_sleep; - gboolean lock_mate_keyring; - MateKeyringResult keyres; GpmScreensaver *screensaver; guint32 throttle_cookie = 0; +#ifdef WITH_KEYRING + gboolean lock_mate_keyring; + MateKeyringResult keyres; +#endif /* WITH_KEYRING */ screensaver = gpm_screensaver_new (); @@ -173,6 +178,7 @@ gpm_control_suspend (GpmControl *control, GError **error) goto out; } +#ifdef WITH_KEYRING /* we should perhaps lock keyrings when sleeping #375681 */ lock_mate_keyring = g_settings_get_boolean (control->priv->settings, GPM_SETTINGS_LOCK_KEYRING_SUSPEND); if (lock_mate_keyring) { @@ -180,6 +186,7 @@ gpm_control_suspend (GpmControl *control, GError **error) if (keyres != MATE_KEYRING_RESULT_OK) egg_warning ("could not lock keyring"); } +#endif /* WITH_KEYRING */ do_lock = gpm_control_get_lock_policy (control, GPM_SETTINGS_LOCK_ON_SUSPEND); if (do_lock) { @@ -225,10 +232,12 @@ gpm_control_hibernate (GpmControl *control, GError **error) gboolean ret = FALSE; gboolean do_lock; gboolean nm_sleep; - gboolean lock_mate_keyring; - MateKeyringResult keyres; GpmScreensaver *screensaver; guint32 throttle_cookie = 0; +#ifdef WITH_KEYRING + gboolean lock_mate_keyring; + MateKeyringResult keyres; +#endif /* WITH_KEYRING */ screensaver = gpm_screensaver_new (); @@ -241,6 +250,7 @@ gpm_control_hibernate (GpmControl *control, GError **error) goto out; } +#ifdef WITH_KEYRING /* we should perhaps lock keyrings when sleeping #375681 */ lock_mate_keyring = g_settings_get_boolean (control->priv->settings, GPM_SETTINGS_LOCK_KEYRING_HIBERNATE); if (lock_mate_keyring) { @@ -249,6 +259,7 @@ gpm_control_hibernate (GpmControl *control, GError **error) egg_warning ("could not lock keyring"); } } +#endif /* WITH_KEYRING */ do_lock = gpm_control_get_lock_policy (control, GPM_SETTINGS_LOCK_ON_HIBERNATE); if (do_lock) { |