[PATCH] fix fd.o bug 5865 - don't set percentag if chargelevel is 0
Paul Menzel
pm.debian at googlemail.com
Thu Jan 10 02:32:12 PST 2008
Hi,
you did not change this, but I have question.
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?
> - libhal_device_set_property_int (halctx, hal_device_udi,
> - "battery.charge_level.percentage", percentage, &err);
> + libhal_device_set_property_int (halctx, hal_device_udi,
> + "battery.charge_level.percentage", percentage, &err);
> + } else {
> + libhal_device_remove_property(halctx, hal_device_udi,
> + "battery.charge_level.percentage", &err);
> + }
> }
Thanks,
Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://lists.freedesktop.org/archives/hal/attachments/20080110/38c58a8f/attachment.pgp
More information about the hal
mailing list