diff options
author | Mike Blumenkrantz <michael.blumenkrantz@gmail.com> | 2010-05-18 20:15:11 +0000 |
---|---|---|
committer | Mike Blumenkrantz <michael.blumenkrantz@gmail.com> | 2010-05-18 20:15:11 +0000 |
commit | fb6a6462c97e34e62ac8f766649076b993750c17 (patch) | |
tree | bb8ed11224693adf0f8b623afe2418f254c33d99 /src/modules/battery | |
parent | dd4fa1244b3ef24e4b9abf1b9b46068f557354d3 (diff) | |
download | enlightenment-fb6a6462c97e34e62ac8f766649076b993750c17.tar.gz |
udev: recalc last full charge on update in case battery loses maxlife between module restarts
all: do not display time if full && have power
SVN revision: 48985
Diffstat (limited to 'src/modules/battery')
-rw-r--r-- | src/modules/battery/e_mod_main.c | 6 | ||||
-rw-r--r-- | src/modules/battery/e_mod_udev.c | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/modules/battery/e_mod_main.c b/src/modules/battery/e_mod_main.c index beac7fa2e0..2c747b4dd2 100644 --- a/src/modules/battery/e_mod_main.c +++ b/src/modules/battery/e_mod_main.c @@ -323,7 +323,11 @@ _battery_device_update(void) return; /* not ready yet, no properties received for any battery */ if (batnum > 0) full /= batnum; - + if ((full == 100) && have_power) + { + time_left = -1; + time_full = -1; + } if (time_left < 1) time_left = -1; if (time_full < 1) time_full = -1; diff --git a/src/modules/battery/e_mod_udev.c b/src/modules/battery/e_mod_udev.c index be0f3ab205..73e8dc72c3 100644 --- a/src/modules/battery/e_mod_udev.c +++ b/src/modules/battery/e_mod_udev.c @@ -213,8 +213,8 @@ _battery_udev_battery_update(const char *syspath, Battery *bat) GET_STR(bat, model, POWER_SUPPLY_MODEL_NAME); GET_STR(bat, vendor, POWER_SUPPLY_MANUFACTURER); GET_NUM(bat, design_charge, POWER_SUPPLY_ENERGY_FULL_DESIGN); - GET_NUM(bat, last_full_charge, POWER_SUPPLY_ENERGY_FULL); } + GET_NUM(bat, last_full_charge, POWER_SUPPLY_ENERGY_FULL); test = eeze_udev_syspath_get_property(bat->udi, "POWER_SUPPLY_ENERGY_NOW"); if (test) { |