From 0382f33c46b26b6286d45622c97732c4329ddf7d Mon Sep 17 00:00:00 2001 From: flow Date: Mon, 25 Jul 2022 16:48:29 -0300 Subject: [PATCH] fix(ui): pump events to show "Copying modpack files..." text Signed-off-by: flow --- .../modplatform/modpacksch/FTBPackInstallTask.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp b/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp index bad0f149..8483d312 100644 --- a/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp +++ b/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp @@ -280,10 +280,13 @@ void PackInstallTask::downloadPack() void PackInstallTask::install() { + setStatus(tr("Copying modpack files...")); + setProgress(0, filesToCopy.size()); + QCoreApplication::processEvents(); + m_abortable = false; - setStatus(tr("Copying modpack files")); - + int i = 0; for (auto iter = filesToCopy.cbegin(); iter != filesToCopy.cend(); iter++) { auto& to = iter.key(); auto& from = iter.value(); @@ -293,9 +296,13 @@ void PackInstallTask::install() emitFailed(tr("Failed to copy files")); return; } + + setProgress(i++, filesToCopy.size()); + QCoreApplication::processEvents(); } - setStatus(tr("Installing modpack")); + setStatus(tr("Installing modpack...")); + QCoreApplication::processEvents(); auto instanceConfigPath = FS::PathCombine(m_stagingPath, "instance.cfg"); auto instanceSettings = std::make_shared(instanceConfigPath);