[PATCH] fix fd.o bug 5865 - don't set percentag if chargelevel is 0
Paul Menzel
pm.debian at googlemail.com
Thu Jan 10 04:10:48 PST 2008
Am Donnerstag, den 10.01.2008, 12:53 +0100 schrieb Danny Kukawka:
> 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?!
Ok. 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/65583f52/attachment.pgp
More information about the hal
mailing list