diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-06-11 20:25:22 +0200 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-06-11 20:25:22 +0200 |
| commit | a64ff3c7bb52007e5bb344eda11026116b4cb273 (patch) | |
| tree | 87e28848f7182b9b8455cf2c42b21f0687bc0a7f /src | |
| parent | a769bc00611ecba57f9abd5832450e19127fb930 (diff) | |
Add Qt bug report in comment and use while() instead of do { } while();.
Diffstat (limited to 'src')
| -rw-r--r-- | src/installationmanager.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/installationmanager.cpp b/src/installationmanager.cpp index e21a1006..b9f35af8 100644 --- a/src/installationmanager.cpp +++ b/src/installationmanager.cpp @@ -182,6 +182,7 @@ bool InstallationManager::extractFiles(QString extractPath, QString title, bool // Note: Using a loop with a progressUpdate() that only wake-up the loop. The event-loop // will be used in a loop and not via exec() because connecting to QProgressDialog::setValue // and using .exec() creates huge recursion that leads to stack-overflow. + // See https://bugreports.qt.io/browse/QTBUG-10561 QEventLoop loop; connect(this, &InstallationManager::progressUpdate, &loop, &QEventLoop::wakeUp, Qt::QueuedConnection); @@ -222,15 +223,15 @@ bool InstallationManager::extractFiles(QString extractPath, QString title, bool installationProgress->setModal(true); installationProgress->show(); - do { + while (!futureWatcher.isFinished()) { + loop.processEvents(QEventLoop::AllEvents | QEventLoop::WaitForMoreEvents); if (currentProgress != installationProgress->value()) { installationProgress->setValue(currentProgress); } if (currentFileName != installationProgress->labelText()) { installationProgress->setLabelText(currentFileName); } - loop.processEvents(QEventLoop::AllEvents | QEventLoop::WaitForMoreEvents); - } while (!futureWatcher.isFinished()); + } installationProgress->hide(); |
