diff options
author | flow <flowlnlnln@gmail.com> | 2022-07-31 18:21:59 -0300 |
---|---|---|
committer | flow <flowlnlnln@gmail.com> | 2022-09-20 18:36:09 -0300 |
commit | 87002fb8f84b104a221de07ba99ba0eb5cc6bbb6 (patch) | |
tree | 096f918032a507cd145545a63e34268ac3a03270 /launcher/InstanceCreationTask.cpp | |
parent | 6a50fa35ec0dcb8b91ffc0ce70d4d8b9ee5d9fb8 (diff) | |
download | PrismLauncher-87002fb8f84b104a221de07ba99ba0eb5cc6bbb6.tar.gz PrismLauncher-87002fb8f84b104a221de07ba99ba0eb5cc6bbb6.tar.bz2 PrismLauncher-87002fb8f84b104a221de07ba99ba0eb5cc6bbb6.zip |
fix: hook up setAbortStatus in instance import tasks
Signed-off-by: flow <flowlnlnln@gmail.com>
Diffstat (limited to 'launcher/InstanceCreationTask.cpp')
-rw-r--r-- | launcher/InstanceCreationTask.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/launcher/InstanceCreationTask.cpp b/launcher/InstanceCreationTask.cpp index c8c91997..d7663c2d 100644 --- a/launcher/InstanceCreationTask.cpp +++ b/launcher/InstanceCreationTask.cpp @@ -2,11 +2,22 @@ #include <QDebug> -InstanceCreationTask::InstanceCreationTask() {} +InstanceCreationTask::InstanceCreationTask() = default; void InstanceCreationTask::executeTask() { - if (updateInstance() || createInstance()) { + if (updateInstance()) { + emitSucceeded(); + return; + } + + // If this is set, it means we're updating an instance. Since the previous step likely + // removed some old files, we'd better not let the user abort the next task, since it'd + // put the instance in an invalid state. + // TODO: Figure out an unexpensive way of making such file removal a recoverable transaction. + setAbortStatus(!shouldOverride()); + + if (createInstance()) { emitSucceeded(); return; } |