aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src-qt5/core/libLumina/LuminaThemes.cpp22
-rw-r--r--src-qt5/core/libLumina/LuminaThemes.h2
2 files changed, 13 insertions, 11 deletions
diff --git a/src-qt5/core/libLumina/LuminaThemes.cpp b/src-qt5/core/libLumina/LuminaThemes.cpp
index d9ca537b..7fe625a7 100644
--- a/src-qt5/core/libLumina/LuminaThemes.cpp
+++ b/src-qt5/core/libLumina/LuminaThemes.cpp
@@ -272,19 +272,21 @@ QStringList LTHEME::cursorInformation(QString name){
return out;
}
-QStringList LTHEME::CustomEnvSettings(){ //view all the key=value settings
- static QStringList info = QStringList();
- static QDateTime lastcheck = QDateTime();
- if(lastcheck.isNull() || lastcheck < QFileInfo(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/envsettings.conf").lastModified()){
- lastcheck = QDateTime::currentDateTime();
- info = LUtils::readFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/envsettings.conf");
+QStringList LTHEME::CustomEnvSettings(bool useronly){ //view all the key=value settings
+ QStringList newinfo;
+ if(!useronly){
+ QStringList sysfiles; sysfiles << L_ETCDIR+"/lumina_environment.conf" << LOS::LuminaShare()+"lumina_environment.conf";
+ for(int i=0; i<sysfiles.length() && newinfo.isEmpty(); i++){
+ newinfo << LUtils::readFile(sysfiles[i]);
+ }
}
- return info;
+ newinfo << LUtils::readFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/envsettings.conf");
+ return newinfo;
}
void LTHEME::LoadCustomEnvSettings(){
//will push the custom settings into the environment (recommended before loading the initial QApplication)
- QStringList info = LTHEME::CustomEnvSettings();
+ QStringList info = LTHEME::CustomEnvSettings(false); //all settings
if(info.isEmpty()){
//Ensure the file exists, and create it otherwise;
if(!QFile::exists( QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/envsettings.conf")){
@@ -304,7 +306,7 @@ void LTHEME::LoadCustomEnvSettings(){
bool LTHEME::setCustomEnvSetting(QString var, QString val){
//variable/value pair (use an empty val to clear it)
- QStringList info = LTHEME::CustomEnvSettings();
+ QStringList info = LTHEME::CustomEnvSettings(true); //user only
bool changed = false;
if(!info.filter(var+"=").isEmpty()){
for(int i=0; i<info.length(); i++){
@@ -321,7 +323,7 @@ bool LTHEME::setCustomEnvSetting(QString var, QString val){
QString LTHEME::readCustomEnvSetting(QString var){
QStringList info = LTHEME::CustomEnvSettings().filter(var+"=");
- for(int i=0; i<info.length(); i++){
+ for(int i=info.length()-1; i>=0; i--){
if(info[i].startsWith(var+"=")){
return info[i].section("=",1,100).simplified();
}
diff --git a/src-qt5/core/libLumina/LuminaThemes.h b/src-qt5/core/libLumina/LuminaThemes.h
index f0b8c2b6..39602f58 100644
--- a/src-qt5/core/libLumina/LuminaThemes.h
+++ b/src-qt5/core/libLumina/LuminaThemes.h
@@ -50,7 +50,7 @@ public:
static QStringList cursorInformation(QString name); //returns: [Name, Comment, Sample Image File]
//Environment settings
- static QStringList CustomEnvSettings(); //view all the key=value settings
+ static QStringList CustomEnvSettings(bool useronly = false); //view all the key=value settings
static void LoadCustomEnvSettings(); //will push the custom settings into the environment (recommended before loading the initial QApplication)
static bool setCustomEnvSetting(QString var, QString val); //variable/value pair (use an empty val to clear it)
static QString readCustomEnvSetting(QString var);
bgstack15