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

Proposed by Charles Kerr
Status: Merged
Approved by: Ted Gould
Approved revision: 190
Merged at revision: 189
Proposed branch: lp:~charlesk/indicator-power/lp-1216030
Merge into: lp:indicator-power/13.10
Diff against target: 41 lines (+5/-5)
2 files modified
src/device.c (+2/-2)
tests/test-device.cc (+3/-3)
To merge this branch: bzr merge lp:~charlesk/indicator-power/lp-1216030
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+181875@code.launchpad.net

Description of the change

Don't show the time remaining for a discharging battery if it exceeds 24 hours because it's probably an erroneous time estimate.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ted Gould (ted) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/device.c'
2--- src/device.c 2013-08-23 13:57:22 +0000
3+++ src/device.c 2013-08-23 17:17:31 +0000
4@@ -631,7 +631,7 @@
5 g_string_printf (verbose_time, _("%s to charge"), readable_timestr);
6 g_string_printf (accessible_time, _("%s to charge"), accessible_timestr);
7 }
8- else if ((state == UP_DEVICE_STATE_DISCHARGING) && (time <= (60*60*12)))
9+ else if ((state == UP_DEVICE_STATE_DISCHARGING) && (time <= (60*60*24)))
10 {
11 g_string_assign (terse_time, readable_timestr);
12 g_string_printf (verbose_time, _("%s left"), readable_timestr);
13@@ -639,7 +639,7 @@
14 }
15 else
16 {
17- /* if there's more than 12 hours remaining, we don't show it */
18+ /* if there's more than 24 hours remaining, we don't show it */
19 }
20
21 g_free (readable_timestr);
22
23=== modified file 'tests/test-device.cc'
24--- tests/test-device.cc 2013-08-23 04:58:00 +0000
25+++ tests/test-device.cc 2013-08-23 17:17:31 +0000
26@@ -523,12 +523,12 @@
27 "(50%)",
28 "Battery (1 hour 1 minute left, 50%)");
29
30- // discharging, > 12 hours left
31- // we don't show the clock time when > 12 hours dischargin
32+ // discharging, > 24 hours left
33+ // we don't show the clock time when > 24 hours discharging
34 g_object_set (o, INDICATOR_POWER_DEVICE_KIND, UP_DEVICE_KIND_BATTERY,
35 INDICATOR_POWER_DEVICE_STATE, UP_DEVICE_STATE_DISCHARGING,
36 INDICATOR_POWER_DEVICE_PERCENTAGE, 50.0,
37- INDICATOR_POWER_DEVICE_TIME, guint64(60*60*13),
38+ INDICATOR_POWER_DEVICE_TIME, guint64(60*60*25),
39 NULL);
40 check_label (device, "Battery");
41 check_header (device, "(50%)",

Subscribers

People subscribed via source and target branches