aboutsummaryrefslogtreecommitdiff
path: root/launcher/tasks/ConcurrentTask.cpp
diff options
context:
space:
mode:
authorTrial97 <alexandru.tripon97@gmail.com>2023-06-15 12:39:20 +0300
committerTrial97 <alexandru.tripon97@gmail.com>2023-06-15 12:39:20 +0300
commit1f2b0ad698a892f0d1c163d3181655205636a8a0 (patch)
treebdc91e0ba67d4e78c4c990d654094467f1085d79 /launcher/tasks/ConcurrentTask.cpp
parent47372c2fbd2592c6841f4f456d656d8915d3598b (diff)
parent9908e115aa6bdfcceefd1425406d1b6d1c1bdec4 (diff)
downloadPrismLauncher-1f2b0ad698a892f0d1c163d3181655205636a8a0.tar.gz
PrismLauncher-1f2b0ad698a892f0d1c163d3181655205636a8a0.tar.bz2
PrismLauncher-1f2b0ad698a892f0d1c163d3181655205636a8a0.zip
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into installed_mods
Diffstat (limited to 'launcher/tasks/ConcurrentTask.cpp')
-rw-r--r--launcher/tasks/ConcurrentTask.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/launcher/tasks/ConcurrentTask.cpp b/launcher/tasks/ConcurrentTask.cpp
index 5ee14505..9aada5e6 100644
--- a/launcher/tasks/ConcurrentTask.cpp
+++ b/launcher/tasks/ConcurrentTask.cpp
@@ -138,19 +138,18 @@ void ConcurrentTask::startNext()
connect(next.get(), &Task::progress, this, [this, next](qint64 current, qint64 total) { subTaskProgress(next, current, total); });
m_doing.insert(next.get(), next);
+ qsizetype num_starts = qMin(m_queue.size(), m_total_max_size - m_doing.size());
auto task_progress = std::make_shared<TaskStepProgress>(next->getUid());
m_task_progress.insert(next->getUid(), task_progress);
updateState();
updateStepProgress(*task_progress.get(), Operation::ADDED);
-
QCoreApplication::processEvents();
QMetaObject::invokeMethod(next.get(), &Task::start, Qt::QueuedConnection);
// Allow going up the number of concurrent tasks in case of tasks being added in the middle of a running task.
- int num_starts = qMin(m_queue.size(), m_total_max_size - m_doing.size());
for (int i = 0; i < num_starts; i++)
QMetaObject::invokeMethod(this, &ConcurrentTask::startNext, Qt::QueuedConnection);
}