summaryrefslogtreecommitdiff
path: root/xfce4-session/xfsm-shutdown.c
diff options
context:
space:
mode:
authorEric Koegel <eric.koegel@gmail.com>2016-04-25 17:02:06 +0300
committerEric Koegel <eric.koegel@gmail.com>2016-04-25 17:02:06 +0300
commit6c22291566f055d7da3f72708a20bb13e49c0028 (patch)
treef46ab9afa0e1f0a7d9480ffa6f986e1a43b1dfd1 /xfce4-session/xfsm-shutdown.c
parentf610aae1872ae7cb91f65d0151e26b57f61f48b1 (diff)
downloadxfce4-session-6c22291566f055d7da3f72708a20bb13e49c0028.tar.gz
Drop UPower
Starting with UPower 0.99.0 the DBUS APIs to handle suspend and hibernate have been removed. This means we no longer have a use for UPower so drop it as a dependency.
Diffstat (limited to 'xfce4-session/xfsm-shutdown.c')
-rw-r--r--xfce4-session/xfsm-shutdown.c38
1 files changed, 1 insertions, 37 deletions
diff --git a/xfce4-session/xfsm-shutdown.c b/xfce4-session/xfsm-shutdown.c
index e797e824..73ddbe3d 100644
--- a/xfce4-session/xfsm-shutdown.c
+++ b/xfce4-session/xfsm-shutdown.c
@@ -60,9 +60,6 @@
#include <gio/gio.h>
#include <libxfce4util/libxfce4util.h>
#include <gtk/gtk.h>
-#ifdef HAVE_UPOWER
-#include <upower.h>
-#endif
#ifdef HAVE_POLKIT
#include <polkit/polkit.h>
#endif
@@ -76,7 +73,6 @@
#include <xfce4-session/xfsm-fadeout.h>
#include <xfce4-session/xfsm-global.h>
#include <xfce4-session/xfsm-legacy.h>
-#include <xfce4-session/xfsm-upower.h>
#include <xfce4-session/xfsm-systemd.h>
#include <xfce4-session/xfsm-shutdown-fallback.h>
@@ -98,7 +94,6 @@ struct _XfsmShutdown
XfsmSystemd *systemd;
XfsmConsolekit *consolekit;
- XfsmUPower *upower;
/* kiosk settings */
gboolean kiosk_can_shutdown;
@@ -129,18 +124,12 @@ xfsm_shutdown_init (XfsmShutdown *shutdown)
shutdown->consolekit = NULL;
shutdown->systemd = NULL;
- shutdown->upower = NULL;
+
if (LOGIND_RUNNING())
shutdown->systemd = xfsm_systemd_get ();
else
shutdown->consolekit = xfsm_consolekit_get ();
-#ifdef HAVE_UPOWER
-#if !UP_CHECK_VERSION(0, 99, 0)
- shutdown->upower = xfsm_upower_get ();
-#endif /* UP_CHECK_VERSION */
-#endif /* HAVE_UPOWER */
-
/* check kiosk */
kiosk = xfce_kiosk_new ("xfce4-session");
shutdown->kiosk_can_shutdown = xfce_kiosk_query (kiosk, "Shutdown");
@@ -160,7 +149,6 @@ xfsm_shutdown_finalize (GObject *object)
if (shutdown->consolekit != NULL)
g_object_unref (G_OBJECT (shutdown->consolekit));
- g_object_unref (G_OBJECT (shutdown->upower));
(*G_OBJECT_CLASS (xfsm_shutdown_parent_class)->finalize) (object);
}
@@ -313,16 +301,11 @@ xfsm_shutdown_try_suspend (XfsmShutdown *shutdown,
g_return_val_if_fail (XFSM_IS_SHUTDOWN (shutdown), FALSE);
/* Try each way to suspend - it will handle NULL.
- * In the future the upower code can go away once everyone is
- * running upower 0.99.0+
*/
if (try_sleep_method (shutdown->systemd, (SleepFunc)xfsm_systemd_try_suspend))
return TRUE;
- if (try_sleep_method (shutdown->upower, (SleepFunc)xfsm_upower_try_suspend))
- return TRUE;
-
if (try_sleep_method (shutdown->consolekit, (SleepFunc)xfsm_consolekit_try_suspend))
return TRUE;
@@ -338,16 +321,11 @@ xfsm_shutdown_try_hibernate (XfsmShutdown *shutdown,
g_return_val_if_fail (XFSM_IS_SHUTDOWN (shutdown), FALSE);
/* Try each way to hibernate - it will handle NULL.
- * In the future the upower code can go away once everyone is
- * running upower 0.99.0+
*/
if (try_sleep_method (shutdown->systemd, (SleepFunc)xfsm_systemd_try_hibernate))
return TRUE;
- if (try_sleep_method (shutdown->upower, (SleepFunc)xfsm_upower_try_hibernate))
- return TRUE;
-
if (try_sleep_method (shutdown->consolekit, (SleepFunc)xfsm_consolekit_try_hibernate))
return TRUE;
@@ -480,13 +458,6 @@ xfsm_shutdown_can_suspend (XfsmShutdown *shutdown,
return TRUE;
}
}
- else if (shutdown->upower != NULL)
- {
- if (xfsm_upower_can_suspend (shutdown->upower, can_suspend, auth_suspend, NULL))
- {
- return TRUE;
- }
- }
else if (shutdown->consolekit != NULL)
{
if (xfsm_consolekit_can_suspend (shutdown->consolekit, can_suspend, auth_suspend, NULL))
@@ -523,13 +494,6 @@ xfsm_shutdown_can_hibernate (XfsmShutdown *shutdown,
return TRUE;
}
}
- else if (shutdown->upower != NULL)
- {
- if (xfsm_upower_can_hibernate (shutdown->upower, can_hibernate, auth_hibernate, NULL))
- {
- return TRUE;
- }
- }
else if (shutdown->consolekit != NULL)
{
if (xfsm_consolekit_can_hibernate (shutdown->consolekit, can_hibernate, auth_hibernate, NULL))