aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/appearancepage.cpp2
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.cpp45
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.h8
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/main.cpp2
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.cpp2
5 files changed, 38 insertions, 21 deletions
diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine/appearancepage.cpp b/src-qt5/core/lumina-theme-engine/src/lthemeengine/appearancepage.cpp
index 2c125ea8..b9175d6e 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/appearancepage.cpp
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/appearancepage.cpp
@@ -310,7 +310,7 @@ void AppearancePage::readSettings()
QDir("/").mkpath(lthemeengine::userColorSchemePath());
findColorSchemes(lthemeengine::userColorSchemePath());
- findColorSchemes(lthemeengine::sharedColorSchemePath());
+ findColorSchemes(lthemeengine::sharedColorSchemePath().join(", "));
if(m_ui->colorSchemeComboBox->count() == 0)
{
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 1316cd75..c0c23f24 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.cpp
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.cpp
@@ -85,20 +85,37 @@ QString lthemeengine::userStyleSheetPath()
return configPath() + "qss/";
}
-QString lthemeengine::sharedStyleSheetPath()
-{
- return LTHEMEENGINE_DATADIR"/lthemeengine/qss/";
-}
-
-QString lthemeengine::userColorSchemePath()
-{
- return configPath() + "colors/";
-}
-
-QString lthemeengine::sharedColorSchemePath()
-{
- return LTHEMEENGINE_DATADIR"/lthemeengine/colors/";
-}
+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
+ }
+ return dirs;
+ }
+
+ QString lthemeengine::userColorSchemePath(){
+ return configPath() + "colors/";
+ }
+
+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
+ }
+ return dirs;
+ }
QString lthemeengine::systemLanguageID()
{
diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.h b/src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.h
index 7493b39c..171f720a 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.h
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.h
@@ -35,8 +35,8 @@
#define LTHEMEENGINE_TOSTRING(s) #s
#define LTHEMEENGINE_STRINGIFY(s) LTHEMEENGINE_TOSTRING(s)
-#define LTHEMEENGINE_VERSION_INT (LTHEMEENGINE_VERSION_MAJOR<<8 | QT5CT_VERSION_MINOR)
-#define LTHEMEENGINE_VERSION_STR LTHEMEENGINE_STRINGIFY(QT5CT_VERSION_MAJOR.QT5CT_VERSION_MINOR)
+#define LTHEMEENGINE_VERSION_INT (LTHEMEENGINE_VERSION_MAJOR<<8 | LTHEMEENGINE_VERSION_MINOR)
+#define LTHEMEENGINE_VERSION_STR LTHEMEENGINE_STRINGIFY(LTHEMEENGINE_VERSION_MAJOR.QT5CT_VERSION_MINOR)
#include <QString>
#include <QStringList>
@@ -48,9 +48,9 @@ public:
static QString configFile();
static QStringList iconPaths();
static QString userStyleSheetPath();
- static QString sharedStyleSheetPath();
+ static QStringList sharedStyleSheetPath();
static QString userColorSchemePath();
- static QString sharedColorSchemePath();
+ static QStringList sharedColorSchemePath();
static QString systemLanguageID();
private:
diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine/main.cpp b/src-qt5/core/lumina-theme-engine/src/lthemeengine/main.cpp
index 481242cd..1961d17d 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/main.cpp
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/main.cpp
@@ -49,7 +49,7 @@ int main(int argc, char **argv)
app.installTranslator(&qt_translator);
qDebug("Configuration path: %s", qPrintable(lthemeengine::configPath()));
- qDebug("Shared QSS path: %s", qPrintable(lthemeengine::sharedStyleSheetPath()));
+ qDebug("Shared QSS path: %s", qPrintable(lthemeengine::sharedStyleSheetPath().join(", ")));
//checking environment
QStringList errorMessages;
diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.cpp b/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.cpp
index 56aedf4d..10f21f48 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.cpp
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.cpp
@@ -160,7 +160,7 @@ void QSSPage::readSettings()
//load stylesheets
m_ui->qssListWidget->clear();
findStyleSheets(lthemeengine::userStyleSheetPath());
- findStyleSheets(lthemeengine::sharedStyleSheetPath());
+ findStyleSheets(lthemeengine::sharedStyleSheetPath().join(", "));
QSettings settings(lthemeengine::configFile(), QSettings::IniFormat);
QStringList styleSheets = settings.value("Interface/stylesheets").toStringList();
bgstack15