From 2d9c19509308bd01545db9a689db5eb9fafdf577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 28 Jan 2015 10:51:07 +0100 Subject: [PATCH] PowerStatus: use the design capacity if needed. * When the last full capacity is not available, use the design capacity of the battery instead. --- src/apps/powerstatus/ACPIDriverInterface.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/apps/powerstatus/ACPIDriverInterface.cpp b/src/apps/powerstatus/ACPIDriverInterface.cpp index 58a282002e..1036a9f2e2 100644 --- a/src/apps/powerstatus/ACPIDriverInterface.cpp +++ b/src/apps/powerstatus/ACPIDriverInterface.cpp @@ -109,6 +109,8 @@ Battery::GetBatteryInfoCached(battery_info* info) info->current_rate = fCachedInfo.current_rate; info->capacity = fCachedInfo.capacity; info->full_capacity = fExtendedBatteryInfo.last_full_charge; + if (info->full_capacity < 0) + info->full_capacity = fExtendedBatteryInfo.design_capacity; fRateBuffer.AddRate(fCachedInfo.current_rate); if (fCachedInfo.current_rate > 0 && fRateBuffer.GetMeanRate() != 0) {