summaryrefslogtreecommitdiff
path: root/src/gpm-prefs-core.c
diff options
context:
space:
mode:
authorStefan Seyfried <[email protected]>2014-04-09 15:12:17 +0200
committerStefan Seyfried <[email protected]>2014-04-09 15:12:17 +0200
commitd59f4b8bd38e1628af3a992ae8e96b8e069ab738 (patch)
treebb895796d71a346eff190714b865928d82980422 /src/gpm-prefs-core.c
parent220a4e0a64aca0579f50e6e57d4eca848b3ac57f (diff)
downloadmate-power-manager-d59f4b8bd38e1628af3a992ae8e96b8e069ab738.tar.bz2
mate-power-manager-d59f4b8bd38e1628af3a992ae8e96b8e069ab738.tar.xz
port mate-power-manager to upower-0.99 API
fix mate-power-manager for current upower versions
Diffstat (limited to 'src/gpm-prefs-core.c')
-rw-r--r--src/gpm-prefs-core.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gpm-prefs-core.c b/src/gpm-prefs-core.c
index 7a2662d..6abb792 100644
--- a/src/gpm-prefs-core.c
+++ b/src/gpm-prefs-core.c
@@ -811,7 +811,9 @@ gpm_prefs_init (GpmPrefs *prefs)
UpDevice *device;
UpDeviceKind kind;
GpmBrightness *brightness;
+#if !UP_CHECK_VERSION(0, 99, 0)
gboolean ret;
+#endif
guint i;
GDBusProxy *proxy;
@@ -897,9 +899,11 @@ gpm_prefs_init (GpmPrefs *prefs)
else {
/* are we allowed to shutdown? */
egg_console_kit_can_stop (prefs->priv->console, &prefs->priv->can_shutdown, NULL);
+#if !UP_CHECK_VERSION(0, 99, 0)
/* get values from UpClient */
prefs->priv->can_suspend = up_client_get_can_suspend (prefs->priv->client);
prefs->priv->can_hibernate = up_client_get_can_hibernate (prefs->priv->client);
+#endif
}
if (LOGIND_RUNNING()) {
@@ -953,14 +957,14 @@ gpm_prefs_init (GpmPrefs *prefs)
brightness = gpm_brightness_new ();
prefs->priv->has_lcd = gpm_brightness_has_hw (brightness);
g_object_unref (brightness);
-
+#if !UP_CHECK_VERSION(0, 99, 0)
/* get device list */
ret = up_client_enumerate_devices_sync (prefs->priv->client, NULL, &error);
if (!ret) {
egg_warning ("failed to get device list: %s", error->message);
g_error_free (error);
}
-
+#endif
devices = up_client_get_devices (prefs->priv->client);
for (i=0; i<devices->len; i++) {
device = g_ptr_array_index (devices, i);