aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2018-05-15 06:16:45 -0400
committerKen Moore <ken@ixsystems.com>2018-05-15 06:16:45 -0400
commit622045ecde460eb44d9e4191cf46de7de0111fd5 (patch)
tree9177233da79e1053782384b369533cbfb713e569
parentQuick update for some of the Lumina unified files. Getting plugins ready to go. (diff)
downloadlumina-622045ecde460eb44d9e4191cf46de7de0111fd5.tar.gz
lumina-622045ecde460eb44d9e4191cf46de7de0111fd5.tar.bz2
lumina-622045ecde460eb44d9e4191cf46de7de0111fd5.zip
Quick update for LuminaOS-FreeBSD.
Make the battery existance check and a couple other 1-time checks faster for subsequent runs.
-rw-r--r--src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp9
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
bgstack15