summaryrefslogtreecommitdiff
path: root/battstat/battstat-upower.c
diff options
context:
space:
mode:
Diffstat (limited to 'battstat/battstat-upower.c')
-rw-r--r--battstat/battstat-upower.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/battstat/battstat-upower.c b/battstat/battstat-upower.c
index 55929491..f42de3fd 100644
--- a/battstat/battstat-upower.c
+++ b/battstat/battstat-upower.c
@@ -86,14 +86,17 @@ battstat_upower_initialise (void (*callback) (void))
GCancellable *cancellable = g_cancellable_new();
GError *gerror;
-#if !UP_CHECK_VERSION(0, 9, 99)
+#if !UP_CHECK_VERSION(0, 99, 0)
if (! up_client_enumerate_devices_sync( upc, cancellable, &gerror ) ) {
sprintf(error_str, "Unable to enumerate upower devices: %s\n", gerror->message);
goto error_shutdownclient;
}
#endif
-
+#if UP_CHECK_VERSION(0, 99, 0)
+ g_signal_connect_after( upc, "notify", device_cb, NULL );
+#else
g_signal_connect_after( upc, "device-changed", device_cb, NULL );
+#endif
g_signal_connect_after( upc, "device-added", device_cb, NULL );
g_signal_connect_after( upc, "device-removed", device_cb, NULL );