Bug #40

The laptop contains two batteries but the time left won't be summed up.

Added by custos - 815 days ago. Updated 803 days ago.

Status:Closed Start:
Priority:Low Due date:
Assigned to:- % Done:

0%

Category:KThinkBat for Kicker
Target version:KThinkBat 0.2.10 for Kicker
Resolution:

fixed


Description

Hello,

I probably found a small bug.
When running your laptop in battery mode and using two batteries the time left won't be added. However the sum-up works for the energy left.

Nevertheless it is a great tool and I thank you for your nice work.

Best,

custos

batinfosum-batCount.patch (508 Bytes) Raiko Nitzsche -, 30.12.2007 21:41

History

Updated by Raiko Nitzsche - 808 days ago

I have the same problem and after a mail exchange with Tobias about the logic of the code, I think I now have the real cause of the problem. It's a wrong type of the variable batCount in batinfosum.cpp (see patch file).

The variable is declared as bool, but used as a counter of the numbers of batteries installed. With two batteries it is summing up to 2 and then it is compared like:
if(batCount > 1)

but as batCound is a bool it can never be larger than 1 (at least not with my compiler GCC 3.4.4).
After changing the type of the variable to INT, things seem to work correctly.

ciao
Raiko

Updated by Tobias Roeser 803 days ago

  • Status changed from New to Closed
  • Resolution set to fixed

Thanks for finding out. Fixed in r226.

Also available in: Atom PDF