mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-28 09:50:09 +01:00
sleep-monitor: use defines for D-Bus paths for upower's sleep-monitor
This commit is contained in:
parent
6864a7036f
commit
400e9fc9fb
1 changed files with 14 additions and 9 deletions
|
|
@ -29,19 +29,20 @@
|
|||
|
||||
#include "nm-sleep-monitor.h"
|
||||
|
||||
#if (defined (SUSPEND_RESUME_SYSTEMD) + defined (SUSPEND_RESUME_CONSOLEKIT) + defined (SUSPEND_RESUME_UPOWER)) != 1
|
||||
#error define one of SUSPEND_RESUME_SYSTEMD, SUSPEND_RESUME_CONSOLEKIT, or SUSPEND_RESUME_UPOWER
|
||||
#endif
|
||||
|
||||
#define UPOWER_DBUS_SERVICE "org.freedesktop.UPower"
|
||||
#if defined (SUSPEND_RESUME_UPOWER)
|
||||
|
||||
#ifdef SUSPEND_RESUME_SYSTEMD
|
||||
#define SUSPEND_DBUS_NAME "org.freedesktop.UPower"
|
||||
#define SUSPEND_DBUS_PATH "/org/freedesktop/UPower"
|
||||
#define SUSPEND_DBUS_INTERFACE "org.freedesktop.UPower"
|
||||
|
||||
#elif defined (SUSPEND_RESUME_SYSTEMD)
|
||||
|
||||
#define SUSPEND_DBUS_NAME "org.freedesktop.login1"
|
||||
#define SUSPEND_DBUS_PATH "/org/freedesktop/login1"
|
||||
#define SUSPEND_DBUS_INTERFACE "org.freedesktop.login1.Manager"
|
||||
|
||||
#else
|
||||
#elif defined(SUSPEND_RESUME_CONSOLEKIT)
|
||||
|
||||
/* ConsoleKit2 has added the same suspend/resume DBUS API that Systemd
|
||||
* uses. http://consolekit2.github.io/ConsoleKit2/#Manager.Inhibit
|
||||
|
|
@ -51,6 +52,10 @@
|
|||
#define SUSPEND_DBUS_PATH "/org/freedesktop/ConsoleKit/Manager"
|
||||
#define SUSPEND_DBUS_INTERFACE "org.freedesktop.ConsoleKit.Manager"
|
||||
|
||||
#else
|
||||
|
||||
#error define one of SUSPEND_RESUME_SYSTEMD, SUSPEND_RESUME_CONSOLEKIT, or SUSPEND_RESUME_UPOWER
|
||||
|
||||
#endif
|
||||
|
||||
struct _NMSleepMonitor {
|
||||
|
|
@ -280,9 +285,9 @@ nm_sleep_monitor_init (NMSleepMonitor *self)
|
|||
G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START
|
||||
| G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
|
||||
NULL,
|
||||
UPOWER_DBUS_SERVICE,
|
||||
"/org/freedesktop/UPower",
|
||||
"org.freedesktop.UPower",
|
||||
SUSPEND_DBUS_NAME,
|
||||
SUSPEND_DBUS_PATH,
|
||||
SUSPEND_DBUS_INTERFACE,
|
||||
NULL, &error);
|
||||
if (self->proxy) {
|
||||
_nm_dbus_signal_connect (self->proxy, "Sleeping", NULL,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue