diff options
author | Richard Hughes <richard@hughsie.com> | 2009-03-09 09:32:45 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2009-03-09 09:32:45 +0000 |
commit | 23d3397b5bde78d852eb0237e370c68435069021 (patch) | |
tree | 2da3b56b0350c893808853cbabb9a0dd7b68b2d2 /src/dkp-supply.c | |
parent | 57e849f64b9700895a456ee86d0a419e24efe9e8 (diff) |
trivial: correct the percentage change calculation with the new code
Diffstat (limited to 'src/dkp-supply.c')
-rw-r--r-- | src/dkp-supply.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/dkp-supply.c b/src/dkp-supply.c index 5f0b934..def5dd6 100644 --- a/src/dkp-supply.c +++ b/src/dkp-supply.c @@ -355,6 +355,11 @@ dkp_supply_refresh_battery (DkpSupply *supply) /* we only coldplug once, as these values will never change */ supply->priv->has_coldplug_values = TRUE; + } else { + /* get the old full */ + g_object_get (device, + "energy-full", &energy_full, + NULL); } status = g_strstrip (sysfs_get_string (native_path, "status")); @@ -384,8 +389,10 @@ dkp_supply_refresh_battery (DkpSupply *supply) } /* some batteries don't update last_full attribute */ - if (energy > energy_full) + if (energy > energy_full) { + egg_warning ("energy %f bigger than full %f", energy, energy_full); energy_full = energy; + } /* present voltage */ voltage = sysfs_get_double (native_path, "voltage_now") / 1000000.0; |