diff options
| -rw-r--r-- | src/mainwindow.cpp | 14 | ||||
| -rw-r--r-- | src/mainwindow.h | 4 |
2 files changed, 10 insertions, 8 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 9559583b..4a5175e6 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1098,15 +1098,15 @@ bool MainWindow::errorReported(QString &logFile) return false; } -void MainWindow::checkForProblemsAsync() { - QtConcurrent::run([this]() { - checkForProblems(); +QFuture<void> MainWindow::checkForProblemsAsync() { + return QtConcurrent::run([this]() { + checkForProblemsImpl(); }); } -void MainWindow::checkForProblems() +void MainWindow::checkForProblemsImpl() { - TimeThis tt("MainWindow::checkForProblems()"); + TimeThis tt("MainWindow::checkForProblemsImpl()"); { QMutexLocker lk(&m_CheckForProblemsMutex); if (m_CheckingForProblems) { @@ -5886,7 +5886,9 @@ void MainWindow::on_bsaList_itemChanged(QTreeWidgetItem*, int) void MainWindow::on_actionNotifications_triggered() { - checkForProblems(); + auto future = checkForProblemsAsync(); + + future.waitForFinished(); ProblemsDialog problems(m_PluginContainer.plugins<QObject>(), this); problems.exec(); diff --git a/src/mainwindow.h b/src/mainwindow.h index ac172474..14987c0d 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -248,7 +248,7 @@ private: bool extractProgress(QProgressDialog &extractProgress, int percentage, std::string fileName); // Performs checks, sets the m_NumberOfProblems and signals checkForProblemsDone(). - void checkForProblems(); + void checkForProblemsImpl(); void setCategoryListVisible(bool visible); @@ -535,7 +535,7 @@ private slots: void scheduleCheckForProblems(); // Perform the actual problem check in another thread. - void checkForProblemsAsync(); + QFuture<void> checkForProblemsAsync(); void saveModMetas(); |
