[PATCH] fix fd.o bug 5865 - don't set percentag if chargelevel is 0
Danny Kukawka
danny.kukawka at web.de
Thu Jan 10 03:53:56 PST 2008
On Donnerstag, 10. Januar 2008, Paul Menzel wrote:
> Am Montag, den 07.01.2008, 19:20 +0100 schrieb Danny Kukawka:
> > if (current_charge != pci->current_charge) {
> > - pci->current_charge = current_charge;
> > dbus_error_init (&err); +
> > pci->current_charge = current_charge; dbus_error_init (&err);
> > libhal_device_set_property_int (halctx, hal_device_udi,
> > "battery.charge_level.current", current_charge, &err); -
> > if (current_charge != 0)
> > + if (current_charge != 0) {
> > percentage = (100.0 / 7.0) *
> > current_charge;
>
> Why is the term divided by 7?
I assume because the battery/device return max. 7 levels?!
Danyn
More information about the hal
mailing list