diff options
Diffstat (limited to 'launcher/launch/steps/Update.cpp')
-rw-r--r-- | launcher/launch/steps/Update.cpp | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/launcher/launch/steps/Update.cpp b/launcher/launch/steps/Update.cpp index 8df2bc67..f23c0bb4 100644 --- a/launcher/launch/steps/Update.cpp +++ b/launcher/launch/steps/Update.cpp @@ -18,14 +18,12 @@ void Update::executeTask() { - if(m_aborted) - { + if (m_aborted) { emitFailed(tr("Task aborted.")); return; } m_updateTask.reset(m_parent->instance()->createUpdateTask(m_mode)); - if(m_updateTask) - { + if (m_updateTask) { connect(m_updateTask.get(), &Task::finished, this, &Update::updateFinished); connect(m_updateTask.get(), &Task::progress, this, &Update::setProgress); connect(m_updateTask.get(), &Task::stepProgress, this, &Update::propagateStepProgress); @@ -44,13 +42,10 @@ void Update::proceed() void Update::updateFinished() { - if(m_updateTask->wasSuccessful()) - { + if (m_updateTask->wasSuccessful()) { m_updateTask.reset(); emitSucceeded(); - } - else - { + } else { QString reason = tr("Instance update failed because: %1\n\n").arg(m_updateTask->failReason()); m_updateTask.reset(); emit logLine(reason, MessageLevel::Fatal); @@ -60,21 +55,17 @@ void Update::updateFinished() bool Update::canAbort() const { - if(m_updateTask) - { + if (m_updateTask) { return m_updateTask->canAbort(); } return true; } - bool Update::abort() { m_aborted = true; - if(m_updateTask) - { - if(m_updateTask->canAbort()) - { + if (m_updateTask) { + if (m_updateTask->canAbort()) { return m_updateTask->abort(); } } |