diff options
author | Trial97 <alexandru.tripon97@gmail.com> | 2023-08-05 19:09:10 +0300 |
---|---|---|
committer | Trial97 <alexandru.tripon97@gmail.com> | 2023-08-05 19:09:10 +0300 |
commit | b2fdd8359405c93d0d93aa8c68971c986a1f68cb (patch) | |
tree | 59859119373213ce04b2f5e2d7a95227b57be609 /launcher/tasks/ConcurrentTask.cpp | |
parent | 149b6d59cf848a3b3cd50b3aee1c112e9c47e633 (diff) | |
parent | ae793f6cf11658c9abc5111e82d5ba7b3e6af127 (diff) | |
download | PrismLauncher-b2fdd8359405c93d0d93aa8c68971c986a1f68cb.tar.gz PrismLauncher-b2fdd8359405c93d0d93aa8c68971c986a1f68cb.tar.bz2 PrismLauncher-b2fdd8359405c93d0d93aa8c68971c986a1f68cb.zip |
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into download_threads
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher/tasks/ConcurrentTask.cpp')
-rw-r--r-- | launcher/tasks/ConcurrentTask.cpp | 13 |
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() |