diff options
author | Ken Moore <ken@ixsystems.com> | 2016-10-11 09:25:23 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2016-10-11 09:25:23 -0400 |
commit | c82b3b2e3b10210583f8ae606fc78cfc5b0daad1 (patch) | |
tree | 252599366b0bae3edbfe092b6287fc3638b5935d /src-qt5/core | |
parent | Update the links for the Gitter chat and bug tracker in lumina-info. (diff) | |
download | lumina-c82b3b2e3b10210583f8ae606fc78cfc5b0daad1.tar.gz lumina-c82b3b2e3b10210583f8ae606fc78cfc5b0daad1.tar.bz2 lumina-c82b3b2e3b10210583f8ae606fc78cfc5b0daad1.zip |
Adjust the FreeBSD CPU temperature routine to use the dev.cpu.* values if available, and fall back on the hw.acpi values otherwise (direct readings seem to be more accurate in some instances).
Diffstat (limited to 'src-qt5/core')
-rw-r--r-- | src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp b/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp index 5cdf18bc..d0e8cb4e 100644 --- a/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp +++ b/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp @@ -292,8 +292,10 @@ QString LOS::FileSystemCapacity(QString dir) { //Return: percentage capacity as QStringList LOS::CPUTemperatures(){ //Returns: List containing the temperature of any CPU's ("50C" for example) static QStringList vars = QStringList(); QStringList temps; - if(vars.isEmpty()){ temps = LUtils::getCmdOutput("sysctl -i hw.").filter(".temperature:"); } - else{ temps = LUtils::getCmdOutput("sysctl "+vars.join(" ")); vars.clear(); } + if(vars.isEmpty()){ + temps = LUtils::getCmdOutput("sysctl -i dev.cpu").filter(".temperature:"); //try direct readings first + if(temps.isEmpty()){ LUtils::getCmdOutput("sysctl -i hw.acpi").filter(".temperature:"); } // then try acpi values + }else{ temps = LUtils::getCmdOutput("sysctl "+vars.join(" ")); vars.clear(); } temps.sort(); for(int i=0; i<temps.length(); i++){ |