summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnne Jan Brouwer <annejan@noprotocol.com>2015-07-17 17:04:44 +0200
committerAnne Jan Brouwer <annejan@noprotocol.com>2015-07-17 17:04:44 +0200
commitb3dce7ca34466d4b62db13380368ad9c6ab07a9b (patch)
treebd92e74ab7943f22e3fa682743ceb27333104f8d
parentc6dbcbe90bc3b12fb627d97d58234ae4f9b32916 (diff)
config update system
-rw-r--r--mainwindow.cpp21
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);