aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2016-07-06 09:11:33 -0400
committerKen Moore <ken@pcbsd.org>2016-07-06 09:11:33 -0400
commitbc3f3e3a551960466fc14877829198a20dbb34c4 (patch)
tree352e49667a0c671bdf535a92c17d7aa87b76e5ce /src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp
parentAdd a note that the compton settings will require a restart to take effect. (diff)
downloadlumina-bc3f3e3a551960466fc14877829198a20dbb34c4.tar.gz
lumina-bc3f3e3a551960466fc14877829198a20dbb34c4.tar.bz2
lumina-bc3f3e3a551960466fc14877829198a20dbb34c4.zip
Update the FreeBSD OS class a tiny bit:
1) Update the control panel link to point to SysAdm-client (old control panel is obsolete). 2) Ensure the system validity checks during the screen brightness routine are only run once per session rather than every time (since the type of system will not change over time)
Diffstat (limited to 'src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp')
-rw-r--r--src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp b/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp
index ab68361e..6441d8b7 100644
--- a/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp
+++ b/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp
@@ -24,7 +24,7 @@ QString LOS::AppPrefix(){ return "/usr/local/"; } //Prefix for applications
QString LOS::SysPrefix(){ return "/usr/"; } //Prefix for system
//OS-specific application shortcuts (*.desktop files)
-QString LOS::ControlPanelShortcut(){ return "/usr/local/share/applications/pccontrol.desktop"; } //system control panel
+QString LOS::ControlPanelShortcut(){ return "/usr/local/share/applications/sysadm-client.desktop"; } //system control panel
QString LOS::AppStoreShortcut(){ return "/usr/local/share/applications/appcafe.desktop"; } //graphical app/pkg manager
//OS-specific RSS feeds (Format: QStringList[ <name>::::<url> ]; )
QStringList LOS::RSSFeeds(){
@@ -64,11 +64,18 @@ QStringList LOS::ExternalDevicePaths(){
//Read screen brightness information
int LOS::ScreenBrightness(){
+ //First run a quick check to ensure this is not a VirtualBox VM (no brightness control)
+ static int goodsys = -1; //This will not change over time - only check/set once
+ if(goodsys<0){
+ //Make sure we are not running in VirtualBox (does not work in a VM)
+ QStringList info = LUtils::getCmdOutput("pciconf -lv");
+ if( !info.filter("VirtualBox", Qt::CaseInsensitive).isEmpty() ){ goodsys = 1; }
+ else{ goodsys = 0; } //not a good system
+ }
+ if(goodsys<=0){ return -1; } //not a good system
+
//Returns: Screen Brightness as a percentage (0-100, with -1 for errors)
- //Make sure we are not running in VirtualBox (does not work in a VM)
- QStringList info = LUtils::getCmdOutput("pciconf -lv");
- if( !info.filter("VirtualBox", Qt::CaseInsensitive).isEmpty() ){ return -1; }
- else if( !LUtils::isValidBinary("xbrightness") ){ return -1; } //incomplete install
+ if( !LUtils::isValidBinary("xbrightness") ){ return -1; } //incomplete install
//Now perform the standard brightness checks
if(screenbrightness==-1){ //memory value
if(QFile::exists(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentxbrightness")){ //saved file value
bgstack15