From cd2847a8048f50a9cd3e3d3e63ba94363ae0f981 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 21 Jun 2016 10:07:38 -0400 Subject: Add the ability for custom, system-wide environment variable settings within L_ETCDIR/lumina-environment.conf[.dist] This allows a system admin the ability to setup customized build env settings on a global basis - and the user settings are treated as overrides for the system settings. --- src-qt5/core/libLumina/LuminaThemes.cpp | 22 ++++++++++++---------- src-qt5/core/libLumina/LuminaThemes.h | 2 +- 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=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); -- cgit