diff options
author | Anne Jan Brouwer <annejan@noprotocol.com> | 2015-07-17 17:04:44 +0200 |
---|---|---|
committer | Anne Jan Brouwer <annejan@noprotocol.com> | 2015-07-17 17:04:44 +0200 |
commit | b3dce7ca34466d4b62db13380368ad9c6ab07a9b (patch) | |
tree | bd92e74ab7943f22e3fa682743ceb27333104f8d | |
parent | c6dbcbe90bc3b12fb627d97d58234ae4f9b32916 (diff) |
config update system
-rw-r--r-- | mainwindow.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp index 26c8ab22..762e4e55 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -137,6 +137,8 @@ bool MainWindow::checkConfig() { QSettings &settings(getSettings()); + QString version = settings.value("version").toString(); + if (firstRun) { settings.beginGroup( "mainwindow" ); restoreGeometry(settings.value( "geometry", saveGeometry() ).toByteArray()); @@ -230,6 +232,24 @@ bool MainWindow::checkConfig() { destroyTrayIcon(); } + // Config updates + if (version != VERSION) { + qDebug() << "Config update from version " + version; + // QStringList ver = version.split("."); + // qDebug() << ver; + // worry ^ about that next time, since this is first implement + if (autoclearSeconds < 5) { + autoclearSeconds = 10; + } + passwordLength = 16; + passwordChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890~!@#$%^&*()_-+={}[]|:;<>,.?"; + if (!pwgenExecutable.isEmpty()) { + usePwgen = true; + } else { + usePwgen = false; + } + } + firstRun = false; // TODO: this needs to be before we try to access the store, @@ -355,6 +375,7 @@ void MainWindow::config() { QSettings &settings(getSettings()); + settings.setValue("version", VERSION); settings.setValue("passExecutable", passExecutable); settings.setValue("gitExecutable", gitExecutable); settings.setValue("gpgExecutable", gpgExecutable); |