* PowerStatus now checks if full_capacity is valid, based on a patch by tqh.
This closes bug #4305. +alphabranch git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32888 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
4fcdbc69a6
commit
6761e2d915
@ -332,7 +332,9 @@ PowerStatusView::Update(bool force)
|
||||
|
||||
_GetBatteryInfo(&fBatteryInfo, fBatteryID);
|
||||
|
||||
fPercent = (100 * fBatteryInfo.capacity) / fBatteryInfo.full_capacity;
|
||||
if (fBatteryInfo.full_capacity != 0)
|
||||
fPercent = (100 * fBatteryInfo.capacity) / fBatteryInfo.full_capacity;
|
||||
|
||||
fTimeLeft = fBatteryInfo.time_left;
|
||||
if ((fBatteryInfo.state & BATTERY_CHARGING) != 0)
|
||||
fOnline = true;
|
||||
|
Loading…
Reference in New Issue
Block a user