[gnome-battery-bench] Fix battery life computation when battery units are mAh



commit 89ab4826cede3db84087e2d4028b9150994206a5
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Wed Jun 24 11:09:29 2015 -0400

    Fix battery life computation when battery units are mAh
    
    Because the wrong field was checked, when battery levels were reported
    in mAh not mWh, battery life computation was skipped entirely.
    
    Fix from Ettl Martin
    
    https://bugzilla.gnome.org/show_bug.cgi?id=743228

 src/power-monitor.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/power-monitor.c b/src/power-monitor.c
index e603fd2..7428d9f 100644
--- a/src/power-monitor.c
+++ b/src/power-monitor.c
@@ -442,7 +442,7 @@ gbb_power_statistics_compute (const GbbPowerState   *base,
             if (base->energy_full_design >= 0)
                 statistics->battery_life_design = 3600 * base->energy_full_design / statistics->power;
         }
-    } else if (current->capacity_now >= 0 && time_elapsed > 0) {
+    } else if (current->charge_now >= 0 && time_elapsed > 0) {
         double charge_used = base->charge_now - current->charge_now;
         if (charge_used > 0) {
             statistics->current = 3600 * (charge_used) / time_elapsed;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]