From 9937a075bd77b36f1e8cb7cc9182139b95d66048 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 1 Jun 2012 13:37:05 -0500 Subject: in indicator_power_device_get_time_details(), don't list 'not present' for AC Adapters that have no % and no time estimate --- src/device.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/device.c b/src/device.c index 75a4139..ae886cc 100644 --- a/src/device.c +++ b/src/device.c @@ -518,7 +518,8 @@ indicator_power_device_get_time_details (const IndicatorPowerDevice * device, const time_t time = indicator_power_device_get_time (device); const UpDeviceState state = indicator_power_device_get_state (device); const gdouble percentage = indicator_power_device_get_percentage (device); - const gchar * device_name = device_kind_to_localised_string (indicator_power_device_get_kind(device)); + const UpDeviceKind kind = indicator_power_device_get_kind (device); + const gchar * device_name = device_kind_to_localised_string (kind); if (time > 0) { @@ -567,6 +568,12 @@ indicator_power_device_get_time_details (const IndicatorPowerDevice * device, *accessible_name = g_strdup (*details); *short_details = g_strdup_printf (_("(%.0lf%%)"), percentage); } + else if (kind == UP_DEVICE_KIND_LINE_POWER) + { + *details = g_strdup (device_name); + *accessible_name = g_strdup (device_name); + *short_details = g_strdup (device_name); + } else { *details = g_strdup_printf (_("%s (not present)"), device_name); -- cgit v1.2.3