Merge lp:~charlesk/indicator-power/lp-1224931 into lp:indicator-power/13.10

Proposed by Charles Kerr
Status: Merged
Approved by: Ted Gould
Approved revision: 204
Merged at revision: 204
Proposed branch: lp:~charlesk/indicator-power/lp-1224931
Merge into: lp:indicator-power/13.10
Diff against target: 48 lines (+19/-1)
2 files modified
src/device-provider-upower.c (+18/-0)
src/ib-brightness-control.c (+1/-1)
To merge this branch: bzr merge lp:~charlesk/indicator-power/lp-1224931
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+188692@code.launchpad.net

Commit message

Listen for the "Resuming" signal from upower to refresh devices when resuming from suspend/hibernate

Description of the change

Listen for the "Resuming" signal from upower to refresh devices when resuming from suspend/hibernate

To post a comment you must log in.
Ted Gould (ted) wrote :

Makes sense.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/device-provider-upower.c'
2--- src/device-provider-upower.c 2013-06-19 19:47:23 +0000
3+++ src/device-provider-upower.c 2013-10-01 18:57:12 +0000
4@@ -249,6 +249,22 @@
5 }
6
7 static void
8+on_upower_resuming (DbusUPower * unused G_GNUC_UNUSED,
9+ gpointer gself)
10+{
11+ IndicatorPowerDeviceProviderUPower * self;
12+ GHashTableIter iter;
13+ gpointer object_path;
14+
15+ self = INDICATOR_POWER_DEVICE_PROVIDER_UPOWER (gself);
16+
17+ g_debug ("Resumed from hibernate/sleep; queueing all devices for a refresh");
18+ g_hash_table_iter_init (&iter, self->priv->devices);
19+ while (g_hash_table_iter_next (&iter, &object_path, NULL))
20+ refresh_device_soon (self, object_path);
21+}
22+
23+static void
24 on_upower_proxy_ready (GObject * source G_GNUC_UNUSED,
25 GAsyncResult * res,
26 gpointer gself)
27@@ -272,6 +288,8 @@
28 p = self->priv;
29
30 p->upower_proxy = proxy;
31+ g_signal_connect (proxy, "resuming",
32+ G_CALLBACK (on_upower_resuming), self);
33 g_signal_connect (proxy, "device-changed",
34 G_CALLBACK (on_upower_device_changed), self);
35 g_signal_connect (proxy, "device-added",
36
37=== modified file 'src/ib-brightness-control.c'
38--- src/ib-brightness-control.c 2013-08-20 03:41:09 +0000
39+++ src/ib-brightness-control.c 2013-10-01 18:57:12 +0000
40@@ -52,7 +52,7 @@
41 (g_strcmp0 (device_type, "platform") == 0) ||
42 (g_strcmp0 (device_type, "raw") == 0)) {
43 path = g_strdup (g_udev_device_get_sysfs_path (device->data));
44- g_print ("found: %s\n", path);
45+ g_debug ("found: %s", path);
46 break;
47 }
48 }

Subscribers

People subscribed via source and target branches