[PATCH] fix util_compute_time_remaining(...) to prevent remove battery.remaining_time

Danny Kukawka danny.kukawka at web.de
Thu Nov 24 13:56:54 PST 2005


Hi,

this patch fixes problems with util_compute_time_remaining(...). Currently the 
property battery.remaining_time is removed if time or chargeLevel not changed 
between two events (because of return -1 to prevent div-by-zero).

I added the last chargeRate to the hash table, now we use the this value if 
nothing changed to return a valid remaining time instead of -1.

Please review.

Cheers,

Danny

 util.c |   39 +++++++++++++++++++++++----------------
 1 files changed, 23 insertions(+), 16 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hal-fix-compute_remaining_time.diff
Type: text/x-diff
Size: 2598 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20051124/5b3b6533/hal-fix-compute_remaining_time.bin


More information about the hal mailing list