aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/indicator-power.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/indicator-power.c b/src/indicator-power.c
index 800ac5a..3908f14 100644
--- a/src/indicator-power.c
+++ b/src/indicator-power.c
@@ -533,6 +533,7 @@ get_primary_device (GVariant *devices)
for (i = 0; i < n_devices; i++)
{
+ time = 0;
device = g_variant_get_child_value (devices, i);
g_variant_get (device,
"(susdut)",
@@ -561,6 +562,10 @@ get_primary_device (GVariant *devices)
else if (state == UP_DEVICE_STATE_CHARGING)
{
charging = TRUE;
+ if (time == 0) /* Battery broken */
+ {
+ primary_device_charging = device;
+ }
if (time > max_charging_time)
{
max_charging_time = time;