aboutsummaryrefslogtreecommitdiff
path: root/libLumina/LuminaUtils.cpp
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-07-29 09:56:58 -0400
committerKen Moore <moorekou@gmail.com>2015-07-29 09:56:58 -0400
commit51408596d87abd667b8bfccea4f4f39a59d4b46a (patch)
treedb116e939e613a4029143ffa6954aef20376ea5a /libLumina/LuminaUtils.cpp
parentDo not have lumina-open show the crash handler if a "pc-su" process returns e... (diff)
downloadlumina-51408596d87abd667b8bfccea4f4f39a59d4b46a.tar.gz
lumina-51408596d87abd667b8bfccea4f4f39a59d4b46a.tar.bz2
lumina-51408596d87abd667b8bfccea4f4f39a59d4b46a.zip
Add the ability to use an optional "_ifexists" tag at the end of any "session_*" settings in luminaDesktop.conf. This will check for the existance of the given value (absolute paths only), and skip the assignment if it does not exist.
Diffstat (limited to 'libLumina/LuminaUtils.cpp')
-rw-r--r--libLumina/LuminaUtils.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/libLumina/LuminaUtils.cpp b/libLumina/LuminaUtils.cpp
index d39440fe..4633c765 100644
--- a/libLumina/LuminaUtils.cpp
+++ b/libLumina/LuminaUtils.cpp
@@ -438,7 +438,14 @@ void LUtils::LoadSystemDefaults(bool skipOS){
//Change in 0.8.5 - use "_" instead of "." within variables names - need backwards compat for a little while
if(var.contains(".")){ var.replace(".","_"); }
//Now parse the variable and put the value in the proper file
-
+
+ //Special handling for values which need to exist first
+ if(var.endsWith("_ifexists") ){
+ var = var.remove("_ifexists"); //remove this flag from the variable
+ //Check if the value exists (absolute path only)
+ if(!QFile::exists(val)){ continue; } //skip this line - value/file does not exist
+ }
+ //Parse/save the value
if(var=="session_enablenumlock"){ sesset << "EnableNumlock="+ istrue; }
else if(var=="session_playloginaudio"){ sesset << "PlayStartupAudio="+istrue; }
else if(var=="session_playlogoutaudio"){ sesset << "PlayLogoutAudio="+istrue; }
bgstack15