aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.cpp')
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.cpp46
1 files changed, 16 insertions, 30 deletions
diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.cpp b/src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.cpp
index 979c8c43..36b0c2fa 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.cpp
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.cpp
@@ -25,19 +25,16 @@ QStringList lthemeengine::iconPaths(){
paths << "/usr/local/share/icons";
}
else{
- foreach (QString p, xdgDataDirs.split(":"))
- paths << QDir(p + "/icons/").absolutePath();
+ foreach (QString p, xdgDataDirs.split(":")){ paths << QDir(p + "/icons/").absolutePath(); }
+ }
+ if(xdgDataHome.isEmpty()){ xdgDataHome = QDir::homePath() + "/.local/share"; }
+ paths << "/usr/share/pixmaps";
+ paths << xdgDataHome + "/icons";
+ paths.removeDuplicates();
+ //remove invalid
+ foreach (QString p, paths){
+ if(!QDir(p).exists()){ paths.removeAll(p); }
}
- if(xdgDataHome.isEmpty())
- xdgDataHome = QDir::homePath() + "/.local/share";
- paths << "/usr/share/pixmaps";
- paths << xdgDataHome + "/icons";
- paths.removeDuplicates();
- //remove invalid
- foreach (QString p, paths){
- if(!QDir(p).exists())
- paths.removeAll(p);
- }
return paths;
}
@@ -49,12 +46,8 @@ QStringList lthemeengine::sharedStyleSheetPath(){
QStringList dirs;
dirs << QString(getenv("XDG_CONFIG_HOME"));
dirs << QString(getenv("XDG_CONFIG_DIRS")).split(":");
- for(int i=0; i<dirs.length(); i++){
- dirs[i].append("/lthemeengine/colors/");
- }
- if(dirs.isEmpty()){
- dirs << LTHEMEENGINE_DATADIR"/lthemeengine/qss/"; //no XDG settings - use the hardcoded path
- }
+ for(int i=0; i<dirs.length(); i++){ dirs[i].append("/lthemeengine/colors/"); }
+ if(dirs.isEmpty()){ dirs << LTHEMEENGINE_DATADIR"/lthemeengine/qss/"; } //no XDG settings - use the hardcoded path
return dirs;
}
@@ -66,24 +59,17 @@ QStringList lthemeengine::sharedColorSchemePath(){
QStringList dirs;
dirs << QString(getenv("XDG_CONFIG_HOME"));
dirs << QString(getenv("XDG_CONFIG_DIRS")).split(":");
- for(int i=0; i<dirs.length(); i++){
- dirs[i].append("/lthemeengine/colors/");
- }
- if(dirs.isEmpty()){
- dirs << LTHEMEENGINE_DATADIR"/lthemeengine/colors/"; //no XDG settings - use the hardcoded path
- }
+ for(int i=0; i<dirs.length(); i++){ dirs[i].append("/lthemeengine/colors/"); }
+ if(dirs.isEmpty()){ dirs << LTHEMEENGINE_DATADIR"/lthemeengine/colors/"; } //no XDG settings - use the hardcoded path
return dirs;
}
QString lthemeengine::systemLanguageID(){
#ifdef Q_OS_UNIX
QByteArray v = qgetenv ("LC_ALL");
- if (v.isEmpty())
- v = qgetenv ("LC_MESSAGES");
- if (v.isEmpty())
- v = qgetenv ("LANG");
- if (!v.isEmpty())
- return QLocale (v).name();
+ if (v.isEmpty()){ v = qgetenv ("LC_MESSAGES"); }
+ if (v.isEmpty()){ v = qgetenv ("LANG"); }
+ if (!v.isEmpty()){ return QLocale (v).name(); }
#endif
return QLocale::system().name();
}
bgstack15