Mercurial > trustbridge
diff ui/mainwindow.cpp @ 499:077b4342d69b
Default autostart to true and change setting to bool
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Fri, 25 Apr 2014 10:16:46 +0000 |
parents | fa56a9403939 |
children | 20973a56d5ec |
line wrap: on
line diff
--- a/ui/mainwindow.cpp Fri Apr 25 10:16:18 2014 +0000 +++ b/ui/mainwindow.cpp Fri Apr 25 10:16:46 2014 +0000 @@ -392,11 +392,11 @@ connect(mAutoStartOption, SIGNAL(stateChanged(int)), this, SLOT(saveAutoStart(int))); mSettings.beginGroup("settings"); - int autoUpdate = mSettings.value("autoupdate").toInt(); - int autoStart = mSettings.value("autostart").toInt(); + bool autoUpdate = mSettings.value("autoupdate", false).toBool(); + bool autoStart = mSettings.value("autostart", true).toBool(); mSettings.endGroup(); - mAutoUpdateOption->setCheckState(autoUpdate > 0 ? Qt::Checked : Qt::Unchecked); - mAutoStartOption->setCheckState(autoStart > 0 ? Qt::Checked : Qt::Unchecked); + mAutoUpdateOption->setCheckState(autoUpdate ? Qt::Checked : Qt::Unchecked); + mAutoStartOption->setCheckState(autoStart ? Qt::Checked : Qt::Unchecked); // The buttons. @@ -732,14 +732,14 @@ void MainWindow::saveAutoUpdate(int state) { mSettings.beginGroup("settings"); - mSettings.setValue("autoupdate", state); + mSettings.setValue("autoupdate", state != Qt::Unchecked); mSettings.endGroup(); } void MainWindow::saveAutoStart(int state) { mSettings.beginGroup("settings"); - mSettings.setValue("autostart", state); + mSettings.setValue("autostart", state != Qt::Unchecked); mSettings.endGroup(); }