Merge lp:~khurshid-alam/unity-settings-daemon/fix-low-battery-notifications into lp:unity-settings-daemon

Proposed by Khurshid Alam
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 4194
Merged at revision: 4194
Proposed branch: lp:~khurshid-alam/unity-settings-daemon/fix-low-battery-notifications
Merge into: lp:unity-settings-daemon
Diff against target: 74 lines (+2/-27)
1 file modified
plugins/power/gsd-power-manager.c (+2/-27)
To merge this branch: bzr merge lp:~khurshid-alam/unity-settings-daemon/fix-low-battery-notifications
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
Review via email: mp+369223@code.launchpad.net

Commit message

power: Remove 'on AC' check from warning-levels
UPower already does this for us, to avoid warning levels being set
when the batteries didn't notice the AC yet.

To post a comment you must log in.
Revision history for this message
Khurshid Alam (khurshid-alam) wrote :

This is part of upower .99 port of g-s-d, but most of the commits are not required for unity. So I cherry picked only the most commit since double check is happening here.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks, looks fine. One comment, it would help if you included reference to upstream commits when it's a backport, e.g in this case seems to be
https://gitlab.gnome.org/GNOME/gnome-settings-daemon/commit/88e384e3

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/power/gsd-power-manager.c'
2--- plugins/power/gsd-power-manager.c 2016-06-15 15:40:17 +0000
3+++ plugins/power/gsd-power-manager.c 2019-06-24 06:33:38 +0000
4@@ -1171,14 +1171,6 @@
5 "time-to-empty", &time_to_empty,
6 NULL);
7
8- /* check to see if the batteries have not noticed we are on AC */
9- if (kind == UP_DEVICE_KIND_BATTERY) {
10- if (!up_client_get_on_battery (manager->priv->up_client)) {
11- g_warning ("ignoring low message as we are not on battery power");
12- goto out;
13- }
14- }
15-
16 if (kind == UP_DEVICE_KIND_BATTERY) {
17
18 /* if the user has no other batteries, drop the "Laptop" wording */
19@@ -1287,7 +1279,6 @@
20 /* TRANSLATORS: this is the sound description */
21 CA_PROP_EVENT_DESCRIPTION, _("Battery is low"), NULL);
22
23-out:
24 if (icon != NULL)
25 g_object_unref (icon);
26 g_free (message);
27@@ -1312,14 +1303,6 @@
28 "time-to-empty", &time_to_empty,
29 NULL);
30
31- /* check to see if the batteries have not noticed we are on AC */
32- if (kind == UP_DEVICE_KIND_BATTERY) {
33- if (!up_client_get_on_battery (manager->priv->up_client)) {
34- g_warning ("ignoring critically low message as we are not on battery power");
35- goto out;
36- }
37- }
38-
39 if (kind == UP_DEVICE_KIND_BATTERY) {
40
41 /* if the user has no other batteries, drop the "Laptop" wording */
42@@ -1468,7 +1451,7 @@
43 CA_PROP_EVENT_DESCRIPTION, _("Battery is critically low"), NULL);
44 break;
45 }
46-out:
47+
48 if (icon != NULL)
49 g_object_unref (icon);
50 g_free (message);
51@@ -1489,14 +1472,6 @@
52 "kind", &kind,
53 NULL);
54
55- /* check to see if the batteries have not noticed we are on AC */
56- if (kind == UP_DEVICE_KIND_BATTERY) {
57- if (!up_client_get_on_battery (manager->priv->up_client)) {
58- g_warning ("ignoring critically low message as we are not on battery power");
59- goto out;
60- }
61- }
62-
63 if (kind == UP_DEVICE_KIND_BATTERY) {
64
65 /* TRANSLATORS: laptop battery is really, really, low */
66@@ -1596,7 +1571,7 @@
67 CA_PROP_EVENT_ID, "battery-caution",
68 /* TRANSLATORS: this is the sound description */
69 CA_PROP_EVENT_DESCRIPTION, _("Battery is critically low"), NULL);
70-out:
71+
72 if (icon != NULL)
73 g_object_unref (icon);
74 g_free (message);

Subscribers

People subscribed via source and target branches