aboutsummaryrefslogtreecommitdiff
path: root/launcher/tasks/ConcurrentTask.cpp
diff options
context:
space:
mode:
authorTayou <31988415+TayouVR@users.noreply.github.com>2023-08-07 10:32:38 +0200
committerGitHub <noreply@github.com>2023-08-07 10:32:38 +0200
commit9afa7cc91fd889b146c609c6a59f7f7b3d995d9f (patch)
tree20ef3bd30beedca4995875485e468ee323d52096 /launcher/tasks/ConcurrentTask.cpp
parentb572f75dbaad61cf305f1fd4f60ba94d74bfa3fa (diff)
parent75c7df46a7022a46d447bb96fbde619e5d65db05 (diff)
downloadPrismLauncher-9afa7cc91fd889b146c609c6a59f7f7b3d995d9f.tar.gz
PrismLauncher-9afa7cc91fd889b146c609c6a59f7f7b3d995d9f.tar.bz2
PrismLauncher-9afa7cc91fd889b146c609c6a59f7f7b3d995d9f.zip
Merge branch 'develop' into icon-indexing
Signed-off-by: Tayou <31988415+TayouVR@users.noreply.github.com>
Diffstat (limited to 'launcher/tasks/ConcurrentTask.cpp')
-rw-r--r--launcher/tasks/ConcurrentTask.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/launcher/tasks/ConcurrentTask.cpp b/launcher/tasks/ConcurrentTask.cpp
index 9aada5e6..88492346 100644
--- a/launcher/tasks/ConcurrentTask.cpp
+++ b/launcher/tasks/ConcurrentTask.cpp
@@ -194,7 +194,7 @@ void ConcurrentTask::subTaskStatus(Task::Ptr task, const QString& msg)
auto task_progress = m_task_progress.value(task->getUid());
task_progress->status = msg;
task_progress->state = TaskStepState::Running;
-
+
emit stepProgress(*task_progress);
if (totalSize() == 1) {
@@ -207,7 +207,7 @@ void ConcurrentTask::subTaskDetails(Task::Ptr task, const QString& msg)
auto task_progress = m_task_progress.value(task->getUid());
task_progress->details = msg;
task_progress->state = TaskStepState::Running;
-
+
emit stepProgress(*task_progress);
if (totalSize() == 1) {
@@ -220,7 +220,7 @@ void ConcurrentTask::subTaskProgress(Task::Ptr task, qint64 current, qint64 tota
auto task_progress = m_task_progress.value(task->getUid());
task_progress->update(current, total);
-
+
emit stepProgress(*task_progress);
updateStepProgress(*task_progress, Operation::CHANGED);
updateState();
@@ -233,7 +233,7 @@ void ConcurrentTask::subTaskProgress(Task::Ptr task, qint64 current, qint64 tota
void ConcurrentTask::subTaskStepProgress(Task::Ptr task, TaskStepProgress const& task_progress)
{
Operation op = Operation::ADDED;
-
+
if (!m_task_progress.contains(task_progress.uid)) {
m_task_progress.insert(task_progress.uid, std::make_shared<TaskStepProgress>(task_progress));
op = Operation::ADDED;
@@ -254,12 +254,10 @@ void ConcurrentTask::subTaskStepProgress(Task::Ptr task, TaskStepProgress const&
emit stepProgress(*tp.get());
updateStepProgress(*tp.get(), op);
}
-
}
void ConcurrentTask::updateStepProgress(TaskStepProgress const& changed_progress, Operation op)
{
-
switch (op) {
case Operation::ADDED:
m_stepProgress += changed_progress.current;
@@ -274,9 +272,8 @@ void ConcurrentTask::updateStepProgress(TaskStepProgress const& changed_progress
m_stepTotalProgress -= changed_progress.old_total;
m_stepProgress += changed_progress.current;
m_stepTotalProgress += changed_progress.total;
- break;
+ break;
}
-
}
void ConcurrentTask::updateState()