aboutsummaryrefslogtreecommitdiff
path: root/libLumina
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-01-28 16:00:18 -0500
committerKen Moore <ken@pcbsd.org>2015-01-28 16:00:18 -0500
commitdafad8a8999f061ef13aa3fbc3ff131839cfe155 (patch)
treeeb4f90dd91910a778f4e0e4f901740ccf4c69a64 /libLumina
parentClean up how Lumina loads the startapps files. Now it will combine any files ... (diff)
downloadlumina-dafad8a8999f061ef13aa3fbc3ff131839cfe155.tar.gz
lumina-dafad8a8999f061ef13aa3fbc3ff131839cfe155.tar.bz2
lumina-dafad8a8999f061ef13aa3fbc3ff131839cfe155.zip
Add the ability for the distribution defaults to use just the name of the system theme/color to use instead of requiring the full path. This allows for much simpler cross-OS usage and settings (for when Lumina starts including multiple themes/colors out-of-box)
Diffstat (limited to 'libLumina')
-rw-r--r--libLumina/LuminaUtils.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/libLumina/LuminaUtils.cpp b/libLumina/LuminaUtils.cpp
index 488af6a8..0294755f 100644
--- a/libLumina/LuminaUtils.cpp
+++ b/libLumina/LuminaUtils.cpp
@@ -248,6 +248,30 @@ void LUtils::LoadSystemDefaults(bool skipOS){
else if(var=="theme.font"){ themesettings[3] = val; }
else if(var=="theme.fontsize"){ themesettings[4] = val; }
}
+ //Now double check that the custom theme/color files exist and reset it will the full path as necessary
+ if(setTheme){
+ QStringList systhemes = LTHEME::availableSystemThemes();
+ QStringList syscolors = LTHEME::availableSystemColors();
+ //theme file
+ if( !themesettings[0].startsWith("/") || !QFile::exists(themesettings[0]) ){
+ for(int i=0; i<systhemes.length(); i++){
+ if(systhemes[i].startsWith(themesettings[0]+"::::")){
+ themesettings[0] = systhemes[i].section("::::",1,1); //Replace with the full path
+ break;
+ }
+ }
+ }
+ //color file
+ if( !themesettings[1].startsWith("/") || !QFile::exists(themesettings[1]) ){
+ for(int i=0; i<syscolors.length(); i++){
+ if(syscolors[i].startsWith(themesettings[1]+"::::")){
+ themesettings[1] = syscolors[i].section("::::",1,1); //Replace with the full path
+ break;
+ }
+ }
+ }
+ }
+
//Ensure that the settings directory exists
QString setdir = QDir::homePath()+"/.lumina/LuminaDE";
if(!QFile::exists(setdir)){
bgstack15