fix(ui): pump events to show "Copying modpack files..." text

Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
flow 2022-07-25 16:48:29 -03:00 committed by Sefa Eyeoglu
parent 13372f3f99
commit 0382f33c46
No known key found for this signature in database
GPG Key ID: C10411294912A422

View File

@ -280,10 +280,13 @@ void PackInstallTask::downloadPack()
void PackInstallTask::install() void PackInstallTask::install()
{ {
setStatus(tr("Copying modpack files..."));
setProgress(0, filesToCopy.size());
QCoreApplication::processEvents();
m_abortable = false; m_abortable = false;
setStatus(tr("Copying modpack files")); int i = 0;
for (auto iter = filesToCopy.cbegin(); iter != filesToCopy.cend(); iter++) { for (auto iter = filesToCopy.cbegin(); iter != filesToCopy.cend(); iter++) {
auto& to = iter.key(); auto& to = iter.key();
auto& from = iter.value(); auto& from = iter.value();
@ -293,9 +296,13 @@ void PackInstallTask::install()
emitFailed(tr("Failed to copy files")); emitFailed(tr("Failed to copy files"));
return; 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 instanceConfigPath = FS::PathCombine(m_stagingPath, "instance.cfg");
auto instanceSettings = std::make_shared<INISettingsObject>(instanceConfigPath); auto instanceSettings = std::make_shared<INISettingsObject>(instanceConfigPath);