aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.cpp
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2017-08-17 16:04:15 +0000
committerWeblate <noreply@weblate.org>2017-08-17 16:04:15 +0000
commitda678fc7fa150351ce15acf8fed2c90dde244db7 (patch)
tree8c5702ce54b5e533b61c5a2ce555e5b5bdde1d48 /src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.cpp
parentTranslated using Weblate (French) (diff)
parentMerge remote-tracking branch 'origin/master' (diff)
downloadlumina-da678fc7fa150351ce15acf8fed2c90dde244db7.tar.gz
lumina-da678fc7fa150351ce15acf8fed2c90dde244db7.tar.bz2
lumina-da678fc7fa150351ce15acf8fed2c90dde244db7.zip
Merge remote-tracking branch 'origin/master'
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.cpp50
1 files changed, 20 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..fdeb8966 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.cpp
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.cpp
@@ -6,6 +6,7 @@
#define LTHEMEENGINE_DATADIR "/usr/local/share"
#endif
+#include <QDebug>
QString lthemeengine::configPath(){
return QDir::homePath() + "/.config/lthemeengine/";
@@ -25,19 +26,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 +47,9 @@ 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
- }
+ dirs << QString(getenv("XDG_DATA_DIRS")).split(":");
+ for(int i=0; i<dirs.length(); i++){ dirs[i].append("/lthemeengine/qss/"); }
+ if(dirs.isEmpty()){ dirs << LTHEMEENGINE_DATADIR"/lthemeengine/qss/"; } //no XDG settings - use the hardcoded path
return dirs;
}
@@ -66,24 +61,19 @@ 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
- }
+ dirs << QString(getenv("XDG_DATA_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
+ qDebug() << "Got Color Dirs:" << dirs;
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