aboutsummaryrefslogtreecommitdiff
path: root/launcher/launch/steps/Update.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/launch/steps/Update.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/launch/steps/Update.cpp')
-rw-r--r--launcher/launch/steps/Update.cpp23
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();
}
}