From 87002fb8f84b104a221de07ba99ba0eb5cc6bbb6 Mon Sep 17 00:00:00 2001 From: flow Date: Sun, 31 Jul 2022 18:21:59 -0300 Subject: fix: hook up setAbortStatus in instance import tasks Signed-off-by: flow --- launcher/InstanceCreationTask.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'launcher/InstanceCreationTask.cpp') 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 -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; } -- cgit