Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanek Bevendorff <janek@jbev.net>2020-04-26 02:31:38 +0300
committerJanek Bevendorff <janek@jbev.net>2020-05-02 23:30:27 +0300
commit596d2cf425c3c8495b4c4a58c61798afe9fdd536 (patch)
treef550255e5355098dd91ba9cd73c7289ac5b352d3 /src/core/Bootstrap.cpp
parent5add01243d6c86c6d59d5018f860add377575259 (diff)
Refactor Config.
Replaces all string configuration options with enum types that can be checked by the compiler. This prevents spelling errors, in-place configuration definitions, and inconsistent default values. The default value config getter signature was removed in favour of consistently and centrally default-initialised configuration values. Individual default values were adjusted for better security, such as the default password length, which was increased from 16 characters to 32. The already existing config option deprecation map was extended by a general migration procedure using configuration versioning. Settings were split into Roaming and Local settings, which go to their respective AppData locations on Windows. Fixes #2574 Fixes #2193
Diffstat (limited to 'src/core/Bootstrap.cpp')
-rw-r--r--src/core/Bootstrap.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/Bootstrap.cpp b/src/core/Bootstrap.cpp
index 99b950928..3f5a67a05 100644
--- a/src/core/Bootstrap.cpp
+++ b/src/core/Bootstrap.cpp
@@ -100,7 +100,7 @@ namespace Bootstrap
void restoreMainWindowState(MainWindow& mainWindow)
{
// start minimized if configured
- if (config()->get("GUI/MinimizeOnStartup").toBool()) {
+ if (config()->get(Config::GUI_MinimizeOnStartup).toBool()) {
#ifdef Q_OS_WIN
mainWindow.showMinimized();
#else
@@ -110,14 +110,14 @@ namespace Bootstrap
mainWindow.bringToFront();
}
- if (config()->get("OpenPreviousDatabasesOnStartup").toBool()) {
- const QStringList fileNames = config()->get("LastOpenedDatabases").toStringList();
+ if (config()->get(Config::OpenPreviousDatabasesOnStartup).toBool()) {
+ const QStringList fileNames = config()->get(Config::LastOpenedDatabases).toStringList();
for (const QString& filename : fileNames) {
if (!filename.isEmpty() && QFile::exists(filename)) {
mainWindow.openDatabase(filename);
}
}
- auto lastActiveFile = config()->get("LastActiveDatabase").toString();
+ auto lastActiveFile = config()->get(Config::LastActiveDatabase).toString();
if (!lastActiveFile.isEmpty()) {
mainWindow.openDatabase(lastActiveFile);
}