Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions cinnamon-session/csm-consolekit.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
#include <gio/gio.h>
#include <gio/gunixfdlist.h>

#ifdef HAVE_OLD_UPOWER
#define UPOWER_ENABLE_DEPRECATED 1
#include <upower.h>
#endif

#include "csm-system.h"
#include "csm-consolekit.h"
Expand All @@ -51,9 +47,6 @@
{
GDBusProxy *ck_proxy;
GDBusProxy *ck_session_proxy;
#ifdef HAVE_OLD_UPOWER
UpClient *up_client;
#endif
char *session_id;
gchar *session_path;

Expand Down Expand Up @@ -113,9 +106,6 @@
drop_system_inhibitor (consolekit);
drop_delay_inhibitor (consolekit);

#ifdef HAVE_OLD_UPOWER
g_clear_object (&manager->priv->up_client);
#endif

G_OBJECT_CLASS (csm_consolekit_parent_class)->finalize (object);
}
Expand Down Expand Up @@ -280,10 +270,6 @@
g_signal_connect (manager->priv->ck_session_proxy, "g-signal",
G_CALLBACK (ck_session_proxy_signal_cb), manager);

#ifdef HAVE_OLD_UPOWER
g_clear_object (&manager->priv->up_client);
manager->priv->up_client = up_client_new ();
#endif

g_object_unref (bus);
}
Expand Down Expand Up @@ -398,7 +384,7 @@
{
CsmConsolekit *manager = CSM_CONSOLEKIT (system);

/* Use Stop insetad of PowerOff because it will work with

Check failure on line 387 in cinnamon-session/csm-consolekit.c

View workflow job for this annotation

GitHub Actions / build / build (mint22, linuxmintd/mint22-amd64, Mint 22, true) / Mint 22

insetad ==> instead
* Ck and CK2. */
g_dbus_proxy_call (manager->priv->ck_proxy,
"Stop",
Expand Down Expand Up @@ -603,10 +589,6 @@
static gboolean
csm_consolekit_can_suspend (CsmSystem *system)
{
#ifdef HAVE_OLD_UPOWER
CsmConsolekit *consolekit = CSM_CONSOLEKIT (system);
return up_client_get_can_suspend (consolekit->priv->up_client);
#else
CsmConsolekit *manager = CSM_CONSOLEKIT (system);
gchar *rv;
GVariant *res;
Expand Down Expand Up @@ -634,16 +616,11 @@
g_free (rv);

return can_suspend;
#endif
}

static gboolean
csm_consolekit_can_hibernate (CsmSystem *system)
{
#ifdef HAVE_OLD_UPOWER
CsmConsolekit *consolekit = CSM_CONSOLEKIT (system);
return up_client_get_can_hibernate (consolekit->priv->up_client);
#else
CsmConsolekit *manager = CSM_CONSOLEKIT (system);
gchar *rv;
GVariant *res;
Expand Down Expand Up @@ -671,7 +648,6 @@
g_free (rv);

return can_hibernate;
#endif
}

static void
Expand Down Expand Up @@ -715,17 +691,6 @@
static void
csm_consolekit_suspend (CsmSystem *system, gboolean suspend_then_hibernate)
{
#ifdef HAVE_OLD_UPOWER
CsmConsolekit *consolekit = CSM_CONSOLEKIT (system);
GError *error = NULL;
gboolean ret;

ret = up_client_suspend_sync (consolekit->priv->up_client, NULL, &error);
if (!ret) {
g_warning ("Unexpected suspend failure: %s", error->message);
g_error_free (error);
}
#else
CsmConsolekit *manager = CSM_CONSOLEKIT (system);

gchar *method = "Suspend";
Expand All @@ -742,23 +707,11 @@
NULL,
suspend_done,
manager);
#endif
}

static void
csm_consolekit_hibernate (CsmSystem *system)
{
#ifdef HAVE_OLD_UPOWER
CsmConsolekit *consolekit = CSM_CONSOLEKIT (system);
GError *error = NULL;
gboolean ret;

ret = up_client_hibernate_sync (consolekit->priv->up_client, NULL, &error);
if (!ret) {
g_warning ("Unexpected hibernate failure: %s", error->message);
g_error_free (error);
}
#else
CsmConsolekit *manager = CSM_CONSOLEKIT (system);

g_dbus_proxy_call (manager->priv->ck_proxy,
Expand All @@ -769,7 +722,6 @@
NULL,
hibernate_done,
manager);
#endif
}

static void
Expand Down
4 changes: 2 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Build-Depends:
libjson-glib-dev (>= 0.10),
libsm-dev,
libsystemd-dev [linux-any],
libupower-glib-dev (>= 0.9.0),
libupower-glib-dev (>= 0.99.11),
libx11-dev,
libxapp-dev (>= 1.0.4),
libxau-dev,
Expand All @@ -40,7 +40,7 @@ Depends:
gir1.2-xapp-1.0,
python3-gi,
python3-setproctitle,
upower (>= 0.9.0),
upower (>= 0.99.11),
${gir:Depends},
${misc:Depends},
${python3:Depends},
Expand Down
Loading