summaryrefslogtreecommitdiff
path: root/mate-session/gsm-logout-dialog.c
diff options
context:
space:
mode:
authorSander Sweers <[email protected]>2016-04-17 15:04:08 +0200
committermonsta <[email protected]>2017-03-05 14:12:12 +0300
commit9923739fe6f161a05078340593bf6a91db13d9be (patch)
tree04206ce1a4d88c8236229d2f1adfc325d8dcd641 /mate-session/gsm-logout-dialog.c
parent54d119718d8c2c109e089669aacdb66ffeb38a3e (diff)
downloadmate-session-manager-9923739fe6f161a05078340593bf6a91db13d9be.tar.bz2
mate-session-manager-9923739fe6f161a05078340593bf6a91db13d9be.tar.xz
Replace deprecated upower functions with ConsoleKit2 equivalents
This requires ConsoleKit2 version 0.9.2. + corrections for issues mentioned at https://github.com/mate-desktop/mate-session-manager/pull/133
Diffstat (limited to 'mate-session/gsm-logout-dialog.c')
-rw-r--r--mate-session/gsm-logout-dialog.c28
1 files changed, 2 insertions, 26 deletions
diff --git a/mate-session/gsm-logout-dialog.c b/mate-session/gsm-logout-dialog.c
index 97f7560..0dbeb2b 100644
--- a/mate-session/gsm-logout-dialog.c
+++ b/mate-session/gsm-logout-dialog.c
@@ -27,10 +27,6 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
-#ifdef HAVE_UPOWER
-#include <upower.h>
-#endif
-
#include "gsm-logout-dialog.h"
#ifdef HAVE_SYSTEMD
#include "gsm-systemd.h"
@@ -58,9 +54,6 @@ typedef enum {
struct _GsmLogoutDialogPrivate
{
GsmDialogLogoutType type;
-#ifdef HAVE_UPOWER
- UpClient *up_client;
-#endif
#ifdef HAVE_SYSTEMD
GsmSystemd *systemd;
#endif
@@ -156,9 +149,6 @@ gsm_logout_dialog_init (GsmLogoutDialog *logout_dialog)
gtk_window_set_skip_taskbar_hint (GTK_WINDOW (logout_dialog), TRUE);
gtk_window_set_keep_above (GTK_WINDOW (logout_dialog), TRUE);
gtk_window_stick (GTK_WINDOW (logout_dialog));
-#ifdef HAVE_UPOWER
- logout_dialog->priv->up_client = up_client_new ();
-#endif
#ifdef HAVE_SYSTEMD
if (LOGIND_RUNNING())
logout_dialog->priv->systemd = gsm_get_systemd ();
@@ -185,12 +175,6 @@ gsm_logout_dialog_destroy (GsmLogoutDialog *logout_dialog,
g_source_remove (logout_dialog->priv->timeout_id);
logout_dialog->priv->timeout_id = 0;
}
-#ifdef HAVE_UPOWER
- if (logout_dialog->priv->up_client) {
- g_object_unref (logout_dialog->priv->up_client);
- logout_dialog->priv->up_client = NULL;
- }
-#endif
#ifdef HAVE_SYSTEMD
if (logout_dialog->priv->systemd) {
g_object_unref (logout_dialog->priv->systemd);
@@ -214,13 +198,9 @@ gsm_logout_supports_system_suspend (GsmLogoutDialog *logout_dialog)
#ifdef HAVE_SYSTEMD
if (LOGIND_RUNNING())
ret = gsm_systemd_can_suspend (logout_dialog->priv->systemd);
-#endif
-#if defined(HAVE_SYSTEMD) && defined(HAVE_UPOWER_HIBERNATE_SUSPEND)
else
#endif
-#ifdef HAVE_UPOWER_HIBERNATE_SUSPEND
- ret = up_client_get_can_suspend (logout_dialog->priv->up_client);
-#endif
+ ret = gsm_consolekit_can_suspend (logout_dialog->priv->consolekit);
return ret;
}
@@ -232,13 +212,9 @@ gsm_logout_supports_system_hibernate (GsmLogoutDialog *logout_dialog)
#ifdef HAVE_SYSTEMD
if (LOGIND_RUNNING())
ret = gsm_systemd_can_hibernate (logout_dialog->priv->systemd);
-#endif
-#if defined(HAVE_SYSTEMD) && defined(HAVE_UPOWER_HIBERNATE_SUSPEND)
else
#endif
-#ifdef HAVE_UPOWER_HIBERNATE_SUSPEND
- ret = up_client_get_can_hibernate (logout_dialog->priv->up_client);
-#endif
+ ret = gsm_consolekit_can_hibernate (logout_dialog->priv->consolekit);
return ret;
}