aboutsummaryrefslogtreecommitdiff
path: root/launcher/tasks
diff options
context:
space:
mode:
authorPandaNinjas <admin@malwarefight.wip.la>2023-07-04 16:41:34 -0400
committerGitHub <noreply@github.com>2023-07-04 16:41:34 -0400
commit4509fde410beab8687d605d0a7fd39038ab94183 (patch)
tree1835295bdd4a1293a3547f2abef6e0b4cd364278 /launcher/tasks
parent34cf28712c254ba378bdbf728471d0dfbb4ab58f (diff)
parentdedc9e4edc2769c62f33b6564f3009414245d9f3 (diff)
downloadPrismLauncher-4509fde410beab8687d605d0a7fd39038ab94183.tar.gz
PrismLauncher-4509fde410beab8687d605d0a7fd39038ab94183.tar.bz2
PrismLauncher-4509fde410beab8687d605d0a7fd39038ab94183.zip
Merge branch 'develop' into fix-implicit-fallthrough
Signed-off-by: PandaNinjas <admin@malwarefight.wip.la>
Diffstat (limited to 'launcher/tasks')
-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);
}