From b1f32d5edaf6291f03985584fca84a6180fafccb Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 23 Aug 2013 12:07:06 -0500 Subject: as per the changes in https://wiki.ubuntu.com/Power?action=diff&rev2=39&rev1=38, hide the discharge time remaining if it's > 24 hours --- src/device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/device.c b/src/device.c index 26b4c04..9dc4647 100644 --- a/src/device.c +++ b/src/device.c @@ -631,7 +631,7 @@ indicator_power_device_get_text (const IndicatorPowerDevice * device, g_string_printf (verbose_time, _("%s to charge"), readable_timestr); g_string_printf (accessible_time, _("%s to charge"), accessible_timestr); } - else if ((state == UP_DEVICE_STATE_DISCHARGING) && (time <= (60*60*12))) + else if ((state == UP_DEVICE_STATE_DISCHARGING) && (time <= (60*60*24))) { g_string_assign (terse_time, readable_timestr); g_string_printf (verbose_time, _("%s left"), readable_timestr); @@ -639,7 +639,7 @@ indicator_power_device_get_text (const IndicatorPowerDevice * device, } else { - /* if there's more than 12 hours remaining, we don't show it */ + /* if there's more than 24 hours remaining, we don't show it */ } g_free (readable_timestr); -- cgit v1.2.3 From 90f4785b783466015127e1d37627ee81de182f2f Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 23 Aug 2013 12:10:26 -0500 Subject: update the tests to look at the 24 hour threshold --- tests/test-device.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test-device.cc b/tests/test-device.cc index 130ef16..0ccd8d1 100644 --- a/tests/test-device.cc +++ b/tests/test-device.cc @@ -523,12 +523,12 @@ TEST_F(DeviceTest, Labels) "(50%)", "Battery (1 hour 1 minute left, 50%)"); - // discharging, > 12 hours left - // we don't show the clock time when > 12 hours dischargin + // discharging, > 24 hours left + // we don't show the clock time when > 24 hours discharging g_object_set (o, INDICATOR_POWER_DEVICE_KIND, UP_DEVICE_KIND_BATTERY, INDICATOR_POWER_DEVICE_STATE, UP_DEVICE_STATE_DISCHARGING, INDICATOR_POWER_DEVICE_PERCENTAGE, 50.0, - INDICATOR_POWER_DEVICE_TIME, guint64(60*60*13), + INDICATOR_POWER_DEVICE_TIME, guint64(60*60*25), NULL); check_label (device, "Battery"); check_header (device, "(50%)", -- cgit v1.2.3