From cabc210f238dfb89d535d4169bcff884c2616ea3 Mon Sep 17 00:00:00 2001 From: raveit65 Date: Sun, 10 Nov 2013 01:56:41 +0100 Subject: upower: fix upower version --- battstat/battstat-upower.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'battstat/battstat-upower.c') diff --git a/battstat/battstat-upower.c b/battstat/battstat-upower.c index 55929491..f10e6fc4 100644 --- a/battstat/battstat-upower.c +++ b/battstat/battstat-upower.c @@ -86,7 +86,7 @@ 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; -- cgit v1.2.1 From 1e464e89fa0305266e72e3fce43f49e59b4a8ef8 Mon Sep 17 00:00:00 2001 From: raveit65 Date: Sun, 10 Nov 2013 03:03:38 +0100 Subject: battstat: use g_signal notify for upower-1.0 --- battstat/battstat-upower.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'battstat/battstat-upower.c') diff --git a/battstat/battstat-upower.c b/battstat/battstat-upower.c index f10e6fc4..f42de3fd 100644 --- a/battstat/battstat-upower.c +++ b/battstat/battstat-upower.c @@ -92,8 +92,11 @@ battstat_upower_initialise (void (*callback) (void)) 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 ); -- cgit v1.2.1