summaryrefslogtreecommitdiff
path: root/src/gpm-statistics.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-04-22 18:00:55 +0200
committerStefano Karapetsas <[email protected]>2014-04-22 18:00:55 +0200
commitd96bb779e9d88d83ba2bf54e8610bf966dcdf1c9 (patch)
treebb895796d71a346eff190714b865928d82980422 /src/gpm-statistics.c
parent8cb168b752f4130e88daefa400bb9bf07cf18227 (diff)
parentd59f4b8bd38e1628af3a992ae8e96b8e069ab738 (diff)
downloadmate-power-manager-d96bb779e9d88d83ba2bf54e8610bf966dcdf1c9.tar.bz2
mate-power-manager-d96bb779e9d88d83ba2bf54e8610bf966dcdf1c9.tar.xz
Merge pull request #98 from seife/master
make m-p-m work with current upower-0.99
Diffstat (limited to 'src/gpm-statistics.c')
-rw-r--r--src/gpm-statistics.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/gpm-statistics.c b/src/gpm-statistics.c
index 98b5632..13489dc 100644
--- a/src/gpm-statistics.c
+++ b/src/gpm-statistics.c
@@ -1236,6 +1236,12 @@ gpm_stats_device_added_cb (UpClient *client, UpDevice *device, gpointer user_dat
* gpm_stats_device_changed_cb:
**/
static void
+#if UP_CHECK_VERSION(0, 99, 0)
+gpm_stats_device_changed_cb (UpClient *client, GParamSpec *pspec, gpointer user_data)
+{
+ gpm_stats_button_update_ui();
+}
+#else
gpm_stats_device_changed_cb (UpClient *client, UpDevice *device, gpointer user_data)
{
const gchar *object_path;
@@ -1246,6 +1252,7 @@ gpm_stats_device_changed_cb (UpClient *client, UpDevice *device, gpointer user_d
if (g_strcmp0 (current_device, object_path) == 0)
gpm_stats_update_info_data (device);
}
+#endif
/**
* gpm_stats_device_removed_cb:
@@ -1794,11 +1801,12 @@ main (int argc, char *argv[])
wakeups = up_wakeups_new ();
g_signal_connect (wakeups, "data-changed", G_CALLBACK (gpm_stats_data_changed_cb), NULL);
-
+#if !UP_CHECK_VERSION(0, 99, 0)
/* coldplug */
ret = up_client_enumerate_devices_sync (client, NULL, NULL);
if (!ret)
goto out;
+#endif
devices = up_client_get_devices (client);
/* add devices in visually pleasing order */
@@ -1814,7 +1822,11 @@ main (int argc, char *argv[])
/* connect now the coldplug is done */
g_signal_connect (client, "device-added", G_CALLBACK (gpm_stats_device_added_cb), NULL);
g_signal_connect (client, "device-removed", G_CALLBACK (gpm_stats_device_removed_cb), NULL);
+#if UP_CHECK_VERSION(0, 99, 0)
+ g_signal_connect (client, "notify", G_CALLBACK (gpm_stats_device_changed_cb), NULL);
+#else
g_signal_connect (client, "device-changed", G_CALLBACK (gpm_stats_device_changed_cb), NULL);
+#endif
/* set current device */
if (devices->len > 0) {
@@ -1854,8 +1866,9 @@ main (int argc, char *argv[])
gtk_widget_show (widget);
gtk_main ();
-
+#if !UP_CHECK_VERSION(0, 99, 0)
out:
+#endif
g_object_unref (settings);
g_object_unref (client);
g_object_unref (wakeups);