From 0d9c62d678c77c99686d19545082a910413fd9d0 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 13 May 2015 08:30:56 -0400 Subject: Fix a couple possible parsing issues with loading system/lumina defaults (remember case sensitivity!) --- libLumina/LuminaUtils.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'libLumina') diff --git a/libLumina/LuminaUtils.cpp b/libLumina/LuminaUtils.cpp index e3aa6f13..cbf3b382 100644 --- a/libLumina/LuminaUtils.cpp +++ b/libLumina/LuminaUtils.cpp @@ -295,9 +295,11 @@ void LUtils::LoadSystemDefaults(bool skipOS){ QString val = tmp[i].section("=",1,1).section("#",0,0).toLower().simplified(); QString istrue = (val=="true") ? "true": "false"; //Now parse the variable and put the value in the proper file - if(var=="panel1.pixelsize"){ - if(val.endsWith("%H")){ val = QString::number( (screenGeom.height()*val.section("%",0,0).toDouble())/100 ); }//adjust value to a percentage of the height of the screen - else if(val.endsWith("%W")){ val = QString::number( (screenGeom.width()*val.section("%",0,0).toDouble())/100 ); }//adjust value to a percentage of the width of the screen + if(var=="panel1.pixelsize"){ + //qDebug() << "Panel Size:" << val; + if(val.endsWith("%h")){ val = QString::number( (screenGeom.height()*val.section("%",0,0).toDouble())/100 ); }//adjust value to a percentage of the height of the screen + else if(val.endsWith("%w")){ val = QString::number( (screenGeom.width()*val.section("%",0,0).toDouble())/100 ); }//adjust value to a percentage of the width of the screen + //qDebug() << " -- Adjusted:" << val; deskset << "height="+val; } else if(var=="panel1.autohide"){ deskset << "hidepanel="+istrue; } @@ -315,8 +317,8 @@ void LUtils::LoadSystemDefaults(bool skipOS){ QString istrue = (val=="true") ? "true": "false"; //Now parse the variable and put the value in the proper file if(var=="panel2.pixelsize"){ - if(val.endsWith("%H")){ val = QString::number( (screenGeom.height()*val.section("%",0,0).toDouble())/100 ); }//adjust value to a percentage of the height of the screen - else if(val.endsWith("%W")){ val = QString::number( (screenGeom.width()*val.section("%",0,0).toDouble())/100 ); }//adjust value to a percentage of the width of the screen + if(val.endsWith("%h")){ val = QString::number( (screenGeom.height()*val.section("%",0,0).toDouble())/100 ); }//adjust value to a percentage of the height of the screen + else if(val.endsWith("%w")){ val = QString::number( (screenGeom.width()*val.section("%",0,0).toDouble())/100 ); }//adjust value to a percentage of the width of the screen deskset << "height="+val; } else if(var=="panel2.autohide"){ deskset << "hidepanel="+istrue; } @@ -359,18 +361,21 @@ void LUtils::LoadSystemDefaults(bool skipOS){ QStringList systhemes = LTHEME::availableSystemThemes(); QStringList syscolors = LTHEME::availableSystemColors(); //theme file - if( !themesettings[0].startsWith("/") || !QFile::exists(themesettings[0]) ){ + if( !themesettings[0].startsWith("/") || !QFile::exists(themesettings[0]) || !themesettings[1].endsWith(".qss.template")){ + themesettings[0] = themesettings[0].section(".qss",0,0).simplified(); for(int i=0; i