From e656c951e59bbde0eba9e23dfb3c7f10a4249af3 Mon Sep 17 00:00:00 2001 From: Vesa Pikki Date: Sat, 4 Jul 2009 11:06:29 +0300 Subject: [PATCH] Settings are now saved before window has closed. This enables us to check if toolbar is visible or not. Earlier we saved settings after the window was closed and checking for toolbar visibility was not feasible anymore. --- gui/mainwindow.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 9159e15a8..d58afda7c 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -96,7 +96,6 @@ MainWindow::MainWindow() : MainWindow::~MainWindow() { - SaveSettings(); } void MainWindow::CreateLanguageMenuItems() @@ -184,7 +183,7 @@ void MainWindow::SaveSettings() mSettings->setValue(SETTINGS_SHOW_SECURITY, mUI.mActionShowSecurity->isChecked()); mSettings->setValue(SETTINGS_SHOW_STYLE, mUI.mActionShowStyle->isChecked()); mSettings->setValue(SETTINGS_SHOW_ERRORS, mUI.mActionShowErrors->isChecked()); - mSettings->setValue(SETTINGS_TOOLBARS_SHOW, mUI.mActionToolbar->isChecked()); + mSettings->setValue(SETTINGS_TOOLBARS_SHOW, mUI.mToolBar->isVisible()); mApplications->SaveSettings(mSettings); @@ -440,8 +439,10 @@ void MainWindow::UncheckAll() void MainWindow::closeEvent(QCloseEvent *event) { // Check that we aren't checking files - if (!mThread->IsChecking()) + if (!mThread->IsChecking()) { + SaveSettings(); event->accept(); + } else { QString text(tr("Cannot exit while checking.\n\n" \