diff options
author | BirdZhang <0312birdzhang@gmail.com> | 2019-08-29 13:40:58 +0800 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2020-08-06 15:57:23 +0200 |
commit | 9d403329ad1ad1d6ef3acb936e617666aa902a6f (patch) | |
tree | 7bf62c2ae4547249ab31c9de580d23f823708dde /src/service.c | |
parent | 960b4eccb7c66668ab2a2b7e13c22cd6d1a11d41 (diff) | |
download | ayatana-indicator-power-9d403329ad1ad1d6ef3acb936e617666aa902a6f.tar.gz ayatana-indicator-power-9d403329ad1ad1d6ef3acb936e617666aa902a6f.tar.bz2 ayatana-indicator-power-9d403329ad1ad1d6ef3acb936e617666aa902a6f.zip |
Do not divide by battery size if percent less than 0.01
Diffstat (limited to 'src/service.c')
-rw-r--r-- | src/service.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/service.c b/src/service.c index 06a74de..be17a55 100644 --- a/src/service.c +++ b/src/service.c @@ -1342,10 +1342,12 @@ create_totalled_battery_device (const GList * devices) const time_t t = indicator_power_device_get_time (walk); const UpDeviceState state = indicator_power_device_get_state (walk); - ++n_batteries; if (percent > 0.01) - sum_percent += percent; + { + sum_percent += percent; + ++n_batteries; + } if (state == UP_DEVICE_STATE_CHARGING) { |