summaryrefslogtreecommitdiffstats
path: root/src/settings.h
diff options
context:
space:
mode:
authorSteffen Ritter2018-08-15 15:55:10 +0200
committerSteffen Ritter2018-08-15 15:55:10 +0200
commit3d44182a26af01b5c37fd85dadee0683805fc1a9 (patch)
tree5993ac67fcc21c7d0dbc2813d95a88a5a3f254bc /src/settings.h
parentRestructure clock styling, split background and text so shadows work with bgc... (diff)
downloadslxgreeter-3d44182a26af01b5c37fd85dadee0683805fc1a9.tar.gz
slxgreeter-3d44182a26af01b5c37fd85dadee0683805fc1a9.tar.xz
slxgreeter-3d44182a26af01b5c37fd85dadee0683805fc1a9.zip
Make username placeholder configurable
Also make use of conf.d folder for easy overriding of already existing variables
Diffstat (limited to 'src/settings.h')
-rw-r--r--src/settings.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/settings.h b/src/settings.h
index d2213ae..b6c9db0 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -2,8 +2,10 @@
#define SETTINGS_H
#include <QSettings>
+#include <QDir>
#define CONFIG_FILE "/etc/lightdm/qt-lightdm-greeter.conf"
+#define CONFIG_FOLDER "/etc/lightdm/qt-lightdm-greeter.conf.d"
class Settings;
extern Settings *s_settings;
@@ -26,6 +28,20 @@ public:
static QString clockStyle() { return s_settings->value("clock-text-style").toString(); }
static QString clockBackgroundStyle() { return s_settings->value("clock-background-style").toString(); }
static QStringList clockShadow() { return s_settings->value("clock-shadow").toString().split(QRegExp("\\s"), QString::SkipEmptyParts); }
+ static QString usernamePlaceholder() { return s_settings->value("username-placeholder").toString(); }
+
+ static void loadConfigs() {
+ QDir configDir(CONFIG_FOLDER);
+ QFileInfoList fileInfoList = configDir.entryInfoList(QStringList() << "*.conf", QDir::Files, QDir::Name);
+
+ for (QFileInfo fileInfo : fileInfoList) {
+ QString filePath = fileInfo.absoluteFilePath();
+ QSettings setting(filePath, QSettings::NativeFormat);
+ for(QString key : setting.allKeys()) {
+ s_settings->setValue(key, setting.value(key));
+ }
+ }
+ }
};
#endif // SETTINGS_H