Skip to content

Commit 97bcafd

Browse files
Remove old upower support to match c-s-d commits (#185)
1 parent 507af06 commit 97bcafd

File tree

2 files changed

+2
-50
lines changed

2 files changed

+2
-50
lines changed

cinnamon-session/csm-consolekit.c

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@
3131
#include <gio/gio.h>
3232
#include <gio/gunixfdlist.h>
3333

34-
#ifdef HAVE_OLD_UPOWER
35-
#define UPOWER_ENABLE_DEPRECATED 1
36-
#include <upower.h>
37-
#endif
3834

3935
#include "csm-system.h"
4036
#include "csm-consolekit.h"
@@ -51,9 +47,6 @@ struct _CsmConsolekitPrivate
5147
{
5248
GDBusProxy *ck_proxy;
5349
GDBusProxy *ck_session_proxy;
54-
#ifdef HAVE_OLD_UPOWER
55-
UpClient *up_client;
56-
#endif
5750
char *session_id;
5851
gchar *session_path;
5952

@@ -113,9 +106,6 @@ csm_consolekit_finalize (GObject *object)
113106
drop_system_inhibitor (consolekit);
114107
drop_delay_inhibitor (consolekit);
115108

116-
#ifdef HAVE_OLD_UPOWER
117-
g_clear_object (&manager->priv->up_client);
118-
#endif
119109

120110
G_OBJECT_CLASS (csm_consolekit_parent_class)->finalize (object);
121111
}
@@ -280,10 +270,6 @@ csm_consolekit_init (CsmConsolekit *manager)
280270
g_signal_connect (manager->priv->ck_session_proxy, "g-signal",
281271
G_CALLBACK (ck_session_proxy_signal_cb), manager);
282272

283-
#ifdef HAVE_OLD_UPOWER
284-
g_clear_object (&manager->priv->up_client);
285-
manager->priv->up_client = up_client_new ();
286-
#endif
287273

288274
g_object_unref (bus);
289275
}
@@ -603,10 +589,6 @@ csm_consolekit_is_login_session (CsmSystem *system)
603589
static gboolean
604590
csm_consolekit_can_suspend (CsmSystem *system)
605591
{
606-
#ifdef HAVE_OLD_UPOWER
607-
CsmConsolekit *consolekit = CSM_CONSOLEKIT (system);
608-
return up_client_get_can_suspend (consolekit->priv->up_client);
609-
#else
610592
CsmConsolekit *manager = CSM_CONSOLEKIT (system);
611593
gchar *rv;
612594
GVariant *res;
@@ -634,16 +616,11 @@ csm_consolekit_can_suspend (CsmSystem *system)
634616
g_free (rv);
635617

636618
return can_suspend;
637-
#endif
638619
}
639620

640621
static gboolean
641622
csm_consolekit_can_hibernate (CsmSystem *system)
642623
{
643-
#ifdef HAVE_OLD_UPOWER
644-
CsmConsolekit *consolekit = CSM_CONSOLEKIT (system);
645-
return up_client_get_can_hibernate (consolekit->priv->up_client);
646-
#else
647624
CsmConsolekit *manager = CSM_CONSOLEKIT (system);
648625
gchar *rv;
649626
GVariant *res;
@@ -671,7 +648,6 @@ csm_consolekit_can_hibernate (CsmSystem *system)
671648
g_free (rv);
672649

673650
return can_hibernate;
674-
#endif
675651
}
676652

677653
static void
@@ -715,17 +691,6 @@ hibernate_done (GObject *source,
715691
static void
716692
csm_consolekit_suspend (CsmSystem *system, gboolean suspend_then_hibernate)
717693
{
718-
#ifdef HAVE_OLD_UPOWER
719-
CsmConsolekit *consolekit = CSM_CONSOLEKIT (system);
720-
GError *error = NULL;
721-
gboolean ret;
722-
723-
ret = up_client_suspend_sync (consolekit->priv->up_client, NULL, &error);
724-
if (!ret) {
725-
g_warning ("Unexpected suspend failure: %s", error->message);
726-
g_error_free (error);
727-
}
728-
#else
729694
CsmConsolekit *manager = CSM_CONSOLEKIT (system);
730695

731696
gchar *method = "Suspend";
@@ -742,23 +707,11 @@ csm_consolekit_suspend (CsmSystem *system, gboolean suspend_then_hibernate)
742707
NULL,
743708
suspend_done,
744709
manager);
745-
#endif
746710
}
747711

748712
static void
749713
csm_consolekit_hibernate (CsmSystem *system)
750714
{
751-
#ifdef HAVE_OLD_UPOWER
752-
CsmConsolekit *consolekit = CSM_CONSOLEKIT (system);
753-
GError *error = NULL;
754-
gboolean ret;
755-
756-
ret = up_client_hibernate_sync (consolekit->priv->up_client, NULL, &error);
757-
if (!ret) {
758-
g_warning ("Unexpected hibernate failure: %s", error->message);
759-
g_error_free (error);
760-
}
761-
#else
762715
CsmConsolekit *manager = CSM_CONSOLEKIT (system);
763716

764717
g_dbus_proxy_call (manager->priv->ck_proxy,
@@ -769,7 +722,6 @@ csm_consolekit_hibernate (CsmSystem *system)
769722
NULL,
770723
hibernate_done,
771724
manager);
772-
#endif
773725
}
774726

775727
static void

debian/control

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Build-Depends:
1616
libjson-glib-dev (>= 0.10),
1717
libsm-dev,
1818
libsystemd-dev [linux-any],
19-
libupower-glib-dev (>= 0.9.0),
19+
libupower-glib-dev (>= 0.99.11),
2020
libx11-dev,
2121
libxapp-dev (>= 1.0.4),
2222
libxau-dev,
@@ -40,7 +40,7 @@ Depends:
4040
gir1.2-xapp-1.0,
4141
python3-gi,
4242
python3-setproctitle,
43-
upower (>= 0.9.0),
43+
upower (>= 0.99.11),
4444
${gir:Depends},
4545
${misc:Depends},
4646
${python3:Depends},

0 commit comments

Comments
 (0)