From 51079157d542679c3b4812963f91ad6f7ac7263b Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 24 Apr 2015 08:22:54 -0400 Subject: 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). --- libLumina/LuminaOS-FreeBSD.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libLumina/LuminaOS-FreeBSD.cpp') 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; } -- cgit