From d1c42e69c1819def3098bfac0fd96f2eb39226e9 Mon Sep 17 00:00:00 2001 From: AL <26797547+Al12rs@users.noreply.github.com> Date: Sun, 7 Jun 2020 17:44:06 +0200 Subject: Make even the last direct call to checkForProblemsImpl use the async version. --- src/mainwindow.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/mainwindow.cpp') 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 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(), this); problems.exec(); -- cgit v1.3.1