aboutsummaryrefslogtreecommitdiff
path: root/libLumina/LuminaOS-FreeBSD.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-04-24 08:22:54 -0400
committerKen Moore <ken@pcbsd.org>2015-04-24 08:22:54 -0400
commit51079157d542679c3b4812963f91ad6f7ac7263b (patch)
treea975142648f7bc46276c4d1076e6933133687cbe /libLumina/LuminaOS-FreeBSD.cpp
parentRe-arrange the startup procedures a bit: (diff)
downloadlumina-51079157d542679c3b4812963f91ad6f7ac7263b.tar.gz
lumina-51079157d542679c3b4812963f91ad6f7ac7263b.tar.bz2
lumina-51079157d542679c3b4812963f91ad6f7ac7263b.zip
Make sure to check for the existance of the "xbrightness" utility when doing the screen brightness checks on FreeBSD. This prevents issues with incomplete installations (it will just skip brightness controls).
Diffstat (limited to 'libLumina/LuminaOS-FreeBSD.cpp')
-rw-r--r--libLumina/LuminaOS-FreeBSD.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libLumina/LuminaOS-FreeBSD.cpp b/libLumina/LuminaOS-FreeBSD.cpp
index 39eae307..7ef782d9 100644
--- a/libLumina/LuminaOS-FreeBSD.cpp
+++ b/libLumina/LuminaOS-FreeBSD.cpp
@@ -22,7 +22,7 @@ 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::AppStoreShortcut(){ return "/usr/local/share/applications/softmanager.desktop"; } //graphical app/pkg manager
-QString LOS::QtConfigShortcut(){ return "/usr/local/bin/qtconfig-qt4"; } //qtconfig binary (NOT *.desktop file)
+QString LOS::QtConfigShortcut(){ return ""; } //qtconfig binary (NOT *.desktop file)
// ==== ExternalDevicePaths() ====
QStringList LOS::ExternalDevicePaths(){
@@ -58,6 +58,7 @@ int LOS::ScreenBrightness(){
//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
//Now perform the standard brightness checks
if(screenbrightness==-1){ //memory value
if(QFile::exists(QDir::homePath()+"/.lumina/.currentxbrightness")){ //saved file value
@@ -70,6 +71,7 @@ int LOS::ScreenBrightness(){
//Set screen brightness
void LOS::setScreenBrightness(int percent){
+ if(percent == -1){ return; } //This is usually an invalid value passed directly to the setter
//ensure bounds
if(percent<0){percent=0;}
else if(percent>100){ percent=100; }
bgstack15