Commit 89ab4826 authored by Owen W. Taylor's avatar Owen W. Taylor
Browse files

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
parent 0d54e729
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment