On Mon, 2016-03-21 at 10:16 +0100, Aleksander Morgado wrote:
> On 20/03/16 20:39, poma wrote:
> > 
> > "Newer upower versions no longer emit that signal since this
> > handled by systemd."
> > by Michael Biebl <[email protected]>
> > https://lists.freedesktop.org/archives/devkit-devel/2014-March/0015
> > 75.html
> > 
> > See also "Plans for UPower 1.0"
> > by Richard Hughes <[email protected]>
> > https://lists.freedesktop.org/archives/devkit-devel/2013-January/00
> > 1339.html
> > 
> > Signed-off-by: poma <[email protected]>
> Yeah, it may be a good idea to remove this. I explicitly avoided
> talking
> about upower in the NEWS, only because of this.
> 
> But NetworkManager still has the same build option; is there anything
> we're missing? or is it that NM should also remove upower support for
> suspend/resume?

I wasn't really tracking the deprecation stuff for UPower and NM,
though Lubomir might have.  The only question I'd have is whether
people use current versions of NM and MM on systems that still run
older versions of UPower, and if so, how long do we support that.

Dan

> > 
> > ---
> >  configure.ac                  |   8 +--
> >  src/Makefile.am               |   5 --
> >  src/mm-sleep-monitor-upower.c | 150 ------------------------------
> > ------------
> >  3 files changed, 2 insertions(+), 161 deletions(-)
> >  delete mode 100644 src/mm-sleep-monitor-upower.c
> > 
> > diff --git a/configure.ac b/configure.ac
> > index ada1f5a..3453d51 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -186,7 +186,7 @@ dnl------------------------------------------
> > -----------------------------------
> >  dnl Suspend/resume support
> >  dnl
> >  
> > -AC_ARG_WITH(suspend-resume, AS_HELP_STRING([--with-suspend-
> > resume=no|upower|systemd], [Build ModemManager with specific
> > suspend/resume support]))
> > +AC_ARG_WITH(suspend-resume, AS_HELP_STRING([--with-suspend-
> > resume=no|systemd], [Build ModemManager with specific
> > suspend/resume support]))
> >  
> >  if test "x$with_suspend_resume" = "x"; then
> >     with_suspend_resume="none"
> > @@ -196,20 +196,16 @@ case $with_suspend_resume in
> >      none)
> >          AC_DEFINE(WITH_SUSPEND_RESUME, 0, [Define if you have
> > suspend-resume support])
> >          ;;
> > -    upower)
> > -        AC_DEFINE(WITH_SUSPEND_RESUME, 1, [Define if you have
> > suspend-resume support])
> > -        ;;
> >      systemd)
> >          PKG_CHECK_MODULES(SYSTEMD_INHIBIT, [libsystemd >= 209],,
> >                            [PKG_CHECK_MODULES(SYSTEMD_INHIBIT,
> > [libsystemd-login >= 183])])
> >          AC_DEFINE(WITH_SUSPEND_RESUME, 1, [Define if you have
> > suspend-resume support])
> >          ;;
> >      *)
> > -        AC_MSG_ERROR(--with-suspend-resume must be one of [none,
> > upower, systemd])
> > +        AC_MSG_ERROR(--with-suspend-resume must be one of [none,
> > systemd])
> >          ;;
> >  esac
> >  
> > -AM_CONDITIONAL(SUSPEND_RESUME_UPOWER,  test
> > "x$with_suspend_resume" = "xupower")
> >  AM_CONDITIONAL(SUSPEND_RESUME_SYSTEMD, test
> > "x$with_suspend_resume" = "xsystemd")
> >  
> >  dnl---------------------------------------------------------------
> > --------------
> > diff --git a/src/Makefile.am b/src/Makefile.am
> > index bee1dfe..7322a8a 100644
> > --- a/src/Makefile.am
> > +++ b/src/Makefile.am
> > @@ -295,11 +295,6 @@ if SUSPEND_RESUME_SYSTEMD
> >  ModemManager_SOURCES += mm-sleep-monitor.h mm-sleep-monitor-
> > systemd.c
> >  endif
> >  
> > -# Additional suspend/resume support via upower
> > -if SUSPEND_RESUME_UPOWER
> > -ModemManager_SOURCES += mm-sleep-monitor.h mm-sleep-monitor-
> > upower.c
> > -endif
> > -
> >  # Additional QMI support in ModemManager
> >  if WITH_QMI
> >  ModemManager_SOURCES += \
> > diff --git a/src/mm-sleep-monitor-upower.c b/src/mm-sleep-monitor-
> > upower.c
> > deleted file mode 100644
> > index 237e3c4..0000000
> > --- a/src/mm-sleep-monitor-upower.c
> > +++ /dev/null
> > @@ -1,150 +0,0 @@
> > -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-
> > offset: 4 -*- */
> > -/*
> > - * This program is free software; you can redistribute it and/or
> > modify
> > - * it under the terms of the GNU General Public License as
> > published by
> > - * the Free Software Foundation; either version 2 of the License,
> > or
> > - * (at your option) any later version.
> > - *
> > - * This program is distributed in the hope that it will be useful,
> > - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > - * GNU General Public License for more details.
> > - *
> > - * You should have received a copy of the GNU General Public
> > License along
> > - * with this program; if not, write to the Free Software
> > Foundation, Inc.,
> > - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
> > - *
> > - * (C) Copyright 2012 Red Hat, Inc.
> > - * Author: Matthias Clasen <[email protected]>
> > - *
> > - * Port to GDBus:
> > - * (C) Copyright 2015 Aleksander Morgado <[email protected]
> > >
> > - */
> > -
> > -#include "config.h"
> > -
> > -#include <errno.h>
> > -#include <string.h>
> > -#include <sys/stat.h>
> > -#include <gio/gio.h>
> > -
> > -#include "mm-log.h"
> > -#include "mm-utils.h"
> > -#include "mm-sleep-monitor.h"
> > -
> > -#define UPOWER_NAME       "org.freedesktop.UPower"
> > -#define UPOWER_PATH       "/org/freedesktop/UPower"
> > -#define UPOWER_INTERFACE  "org.freedesktop.UPower"
> > -
> > -struct _MMSleepMonitor {
> > -    GObject parent_instance;
> > -
> > -    GDBusProxy *upower_proxy;
> > -};
> > -
> > -struct _MMSleepMonitorClass {
> > -    GObjectClass parent_class;
> > -
> > -    void (*sleeping) (MMSleepMonitor *monitor);
> > -    void (*resuming) (MMSleepMonitor *monitor);
> > -};
> > -
> > -
> > -enum {
> > -    SLEEPING,
> > -    RESUMING,
> > -    LAST_SIGNAL,
> > -};
> > -static guint signals[LAST_SIGNAL] = {0};
> > -
> > -G_DEFINE_TYPE (MMSleepMonitor, mm_sleep_monitor, G_TYPE_OBJECT);
> > -
> > -/*****************************************************************
> > ***/
> > -
> > -static void
> > -signal_cb (GDBusProxy  *proxy,
> > -           const gchar *sendername,
> > -           const gchar *signalname,
> > -           GVariant    *args,
> > -           gpointer     data)
> > -{
> > -    MMSleepMonitor *self = data;
> > -
> > -    if (strcmp (signalname, "Sleeping") == 0) {
> > -        mm_dbg ("[sleep-monitor] received UPower sleeping
> > signal");
> > -        g_signal_emit (self, signals[SLEEPING], 0);
> > -    } else if (strcmp (signalname, "Resuming") == 0) {
> > -        mm_dbg ("[sleep-monitor] received UPower resuming
> > signal");
> > -        g_signal_emit (self, signals[RESUMING], 0);
> > -    }
> > -}
> > -
> > -static void
> > -on_proxy_acquired (GObject *object,
> > -                   GAsyncResult *res,
> > -                   MMSleepMonitor *self)
> > -{
> > -    GError *error = NULL;
> > -
> > -    self->upower_proxy = g_dbus_proxy_new_for_bus_finish (res,
> > &error);
> > -    if (!self->upower_proxy) {
> > -        mm_warn ("[sleep-monitor] failed to acquire UPower proxy:
> > %s", error->message);
> > -        g_clear_error (&error);
> > -        return;
> > -    }
> > -
> > -    g_signal_connect (self->upower_proxy, "g-signal", G_CALLBACK
> > (signal_cb), self);
> > -}
> > -
> > -static void
> > -mm_sleep_monitor_init (MMSleepMonitor *self)
> > -{
> > -    g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
> > -                              G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START
> > |
> > -                              G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPE
> > RTIES,
> > -                              NULL,
> > -                              UPOWER_NAME, UPOWER_PATH,
> > UPOWER_INTERFACE,
> > -                              NULL,
> > -                              (GAsyncReadyCallback)
> > on_proxy_acquired, self);
> > -}
> > -
> > -static void
> > -finalize (GObject *object)
> > -{
> > -    MMSleepMonitor *self = MM_SLEEP_MONITOR (object);
> > -
> > -    if (self->upower_proxy)
> > -        g_object_unref (self->upower_proxy);
> > -
> > -    if (G_OBJECT_CLASS (mm_sleep_monitor_parent_class)->finalize
> > != NULL)
> > -        G_OBJECT_CLASS (mm_sleep_monitor_parent_class)->finalize
> > (object);
> > -}
> > -
> > -static void
> > -mm_sleep_monitor_class_init (MMSleepMonitorClass *klass)
> > -{
> > -    GObjectClass *gobject_class;
> > -
> > -    gobject_class = G_OBJECT_CLASS (klass);
> > -
> > -    gobject_class->finalize = finalize;
> > -
> > -    signals[SLEEPING] = g_signal_new (MM_SLEEP_MONITOR_SLEEPING,
> > -                                      MM_TYPE_SLEEP_MONITOR,
> > -                                      G_SIGNAL_RUN_LAST,
> > -                                      G_STRUCT_OFFSET
> > (MMSleepMonitorClass, sleeping),
> > -                                      NULL,                   /*
> > accumulator      */
> > -                                      NULL,                   /*
> > accumulator data */
> > -                                      g_cclosure_marshal_VOID__VOI
> > D,
> > -                                      G_TYPE_NONE, 0);
> > -    signals[RESUMING] = g_signal_new (MM_SLEEP_MONITOR_RESUMING,
> > -                                      MM_TYPE_SLEEP_MONITOR,
> > -                                      G_SIGNAL_RUN_LAST,
> > -                                      G_STRUCT_OFFSET
> > (MMSleepMonitorClass, resuming),
> > -                                      NULL,                   /*
> > accumulator      */
> > -                                      NULL,                   /*
> > accumulator data */
> > -                                      g_cclosure_marshal_VOID__VOI
> > D,
> > -                                      G_TYPE_NONE, 0);
> > -}
> > -
> > -MM_DEFINE_SINGLETON_GETTER (MMSleepMonitor, mm_sleep_monitor_get,
> > MM_TYPE_SLEEP_MONITOR);
> > 
> 
_______________________________________________
ModemManager-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel

Reply via email to