diff options
Diffstat (limited to 'src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp')
-rw-r--r-- | src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp b/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp index 9804fbae..11c0d468 100644 --- a/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp +++ b/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp @@ -289,8 +289,13 @@ void LOS::systemSuspend(){ //Battery Availability bool LOS::hasBattery(){ - int val = LUtils::getCmdOutput("apm -l").join("").toInt(); - return (val >= 0 && val <= 100); + static int hasbat = -1; + if(hasbat < 0 ){ + int val = batteryCharge(); + if(val >= 0 && val <= 100){ hasbat = 1; } + else{ hasbat = 0; } + } + return (hasbat==1); } //Battery Charge Level |