summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-12-15 21:56:50 -0500
committerisanae <14251494+isanae@users.noreply.github.com>2019-12-15 21:56:50 -0500
commitf3c5cebb6e9262625105d4339a54a810d7816811 (patch)
treef8a241de842327e80581b504a042f93d79e4d0e8 /src/mainwindow.cpp
parentdcf88361d49da262acaac335d1317a5d7ef42ded (diff)
fixed exiting before QThread joins when pressing the X twice
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index a29ea8ab..d1578d85 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -1317,18 +1317,25 @@ void MainWindow::closeEvent(QCloseEvent* event)
//
// for 2), the settings have been saved and the window can just close
- if (ModOrganizerExiting()) {
+ if (ModOrganizerCanCloseNow()) {
// the user has confirmed if necessary and all settings have been saved,
// just close it
QMainWindow::closeEvent(event);
- } else {
- // never close the window because settings might need to be changed
- event->ignore();
+ return;
+ }
- // start the process of exiting, which may require confirmation by calling
- // canExit(), among other things
- ExitModOrganizer();
+ if (ModOrganizerExiting()) {
+ // ignore repeated attempts
+ event->ignore();
+ return;
}
+
+ // never close the window because settings might need to be changed
+ event->ignore();
+
+ // start the process of exiting, which may require confirmation by calling
+ // canExit(), among other things
+ ExitModOrganizer();
}
bool MainWindow::canExit()