[gnome-session] build: Remove UPower 0.9 support



commit d8b8665dae18700cc4caae5e857b1c23a005a62e
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Nov 15 17:35:17 2017 +0100

    build: Remove UPower 0.9 support
    
    The 1.0 API has been current for 4 years, so we shouldn't need to
    support the old 0.9 API. mutter, gnome-shell, gnome-control-center and
    gnome-settings-daemon all support the newer 1.0 API.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=787806

 gnome-session/gsm-consolekit.c |   54 +--------------------------------------
 meson.build                    |    9 ------
 2 files changed, 2 insertions(+), 61 deletions(-)
---
diff --git a/gnome-session/gsm-consolekit.c b/gnome-session/gsm-consolekit.c
index 34b5d35..44ee25f 100644
--- a/gnome-session/gsm-consolekit.c
+++ b/gnome-session/gsm-consolekit.c
@@ -31,11 +31,6 @@
 #include <gio/gio.h>
 #include <gio/gunixfdlist.h>
 
-#ifdef HAVE_OLD_UPOWER
-#define UPOWER_ENABLE_DEPRECATED 1
-#include <upower.h>
-#endif
-
 #include "gsm-system.h"
 #include "gsm-consolekit.h"
 
@@ -51,9 +46,7 @@ struct _GsmConsolekitPrivate
 {
         GDBusProxy      *ck_proxy;
         GDBusProxy      *ck_session_proxy;
-#ifdef HAVE_OLD_UPOWER
-        UpClient        *up_client;
-#endif
+
         char            *session_id;
         gchar           *session_path;
 
@@ -113,10 +106,6 @@ gsm_consolekit_finalize (GObject *object)
         drop_system_inhibitor (consolekit);
         drop_delay_inhibitor (consolekit);
 
-#ifdef HAVE_OLD_UPOWER
-        g_clear_object (&manager->priv->up_client);
-#endif
-
         G_OBJECT_CLASS (gsm_consolekit_parent_class)->finalize (object);
 }
 
@@ -280,11 +269,6 @@ gsm_consolekit_init (GsmConsolekit *manager)
         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);
 }
 
@@ -603,10 +587,6 @@ gsm_consolekit_is_login_session (GsmSystem *system)
 static gboolean
 gsm_consolekit_can_suspend (GsmSystem *system)
 {
-#ifdef HAVE_OLD_UPOWER
-        GsmConsolekit *consolekit = GSM_CONSOLEKIT (system);
-        return up_client_get_can_suspend (consolekit->priv->up_client);
-#else
         GsmConsolekit *manager = GSM_CONSOLEKIT (system);
         gchar *rv;
         GVariant *res;
@@ -634,16 +614,11 @@ gsm_consolekit_can_suspend (GsmSystem *system)
         g_free (rv);
 
         return can_suspend;
-#endif
 }
 
 static gboolean
 gsm_consolekit_can_hibernate (GsmSystem *system)
 {
-#ifdef HAVE_OLD_UPOWER
-        GsmConsolekit *consolekit = GSM_CONSOLEKIT (system);
-        return up_client_get_can_hibernate (consolekit->priv->up_client);
-#else
         GsmConsolekit *manager = GSM_CONSOLEKIT (system);
         gchar *rv;
         GVariant *res;
@@ -671,7 +646,6 @@ gsm_consolekit_can_hibernate (GsmSystem *system)
         g_free (rv);
 
         return can_hibernate;
-#endif
 }
 
 static void
@@ -715,17 +689,6 @@ hibernate_done (GObject      *source,
 static void
 gsm_consolekit_suspend (GsmSystem *system)
 {
-#ifdef HAVE_OLD_UPOWER
-        GsmConsolekit *consolekit = GSM_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
         GsmConsolekit *manager = GSM_CONSOLEKIT (system);
 
         g_dbus_proxy_call (manager->priv->ck_proxy,
@@ -736,23 +699,11 @@ gsm_consolekit_suspend (GsmSystem *system)
                            NULL,
                            suspend_done,
                            manager);
-#endif
 }
 
 static void
 gsm_consolekit_hibernate (GsmSystem *system)
 {
-#ifdef HAVE_OLD_UPOWER
-        GsmConsolekit *consolekit = GSM_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
         GsmConsolekit *manager = GSM_CONSOLEKIT (system);
 
         g_dbus_proxy_call (manager->priv->ck_proxy,
@@ -763,7 +714,6 @@ gsm_consolekit_hibernate (GsmSystem *system)
                            NULL,
                            hibernate_done,
                            manager);
-#endif
 }
 
 static void
@@ -902,7 +852,7 @@ gsm_consolekit_prepare_shutdown (GsmSystem *system,
         if (res == NULL) {
                 g_warning ("Failed to get delay inhibitor: %s", error->message);
                 g_error_free (error);
-                /* We may fail here with CK or UPOWER and that's ok */
+                /* We may fail here with CK and that's ok */
         } else {
                 g_variant_get (res, "(h)", &idx);
 
diff --git a/meson.build b/meson.build
index b8659c9..016541f 100644
--- a/meson.build
+++ b/meson.build
@@ -178,14 +178,6 @@ session_bin_deps = session_deps + [
 
 enable_session_selector = get_option('enable-session-selector')
 
-# FIXME: We can only support old upower
-#        https://bugzilla.gnome.org/show_bug.cgi?id=710383
-upower_glib_dep = dependency('upower-glib', version: '< 0.99.0', required: false)
-session_bin_deps += upower_glib_dep
-
-have_old_power = upower_glib_dep.found()
-config_h.set('HAVE_OLD_UPOWER', have_old_power)
-
 # Check for gconf
 enable_gconf = get_option('enable-gconf')
 if enable_gconf
@@ -363,7 +355,6 @@ output += '        IPv6 support:             ' + have_ipv6.to_string() + '\n'
 output += '        XRender support:          ' + have_xrender.to_string() + '\n'
 output += '        XSync support:            ' + have_xsync.to_string() + '\n'
 output += '        XTest support:            ' + have_xtest.to_string() + '\n'
-output += '        Legacy UPower backend:    ' + have_old_power.to_string() + '\n'
 output += '        Build Docbook:            ' + enable_docbook.to_string() + '\n'
 output += '        Build manpages:           ' + enable_man.to_string()
 message(output)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]