diff options
author | TheKodeToad <TheKodeToad@proton.me> | 2023-03-04 11:07:07 +0000 |
---|---|---|
committer | TheKodeToad <TheKodeToad@proton.me> | 2023-03-04 11:07:07 +0000 |
commit | 87384182a19ea852522af1b0d69420a510c0a94b (patch) | |
tree | 7b0dc3289c375427d7e851310495fd0acc9c3217 | |
parent | f583e617ec86a7538523a99ae008143a787e593b (diff) | |
download | PrismLauncher-87384182a19ea852522af1b0d69420a510c0a94b.tar.gz PrismLauncher-87384182a19ea852522af1b0d69420a510c0a94b.tar.bz2 PrismLauncher-87384182a19ea852522af1b0d69420a510c0a94b.zip |
Fix abort?
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
-rw-r--r-- | launcher/modplatform/modrinth/ModrinthPackExportTask.cpp | 8 | ||||
-rw-r--r-- | launcher/ui/dialogs/ExportMrPackDialog.cpp | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp b/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp index c151edf5..5ddd3408 100644 --- a/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp +++ b/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp @@ -54,8 +54,12 @@ void ModrinthPackExportTask::executeTask() } bool ModrinthPackExportTask::abort() { - if (!task.isNull()) - return task->abort(); + if (!task.isNull() && task->abort()) { + task = nullptr; + emitFailed(tr("Aborted")); + return true; + } + return false; } diff --git a/launcher/ui/dialogs/ExportMrPackDialog.cpp b/launcher/ui/dialogs/ExportMrPackDialog.cpp index 266479b3..13262a7e 100644 --- a/launcher/ui/dialogs/ExportMrPackDialog.cpp +++ b/launcher/ui/dialogs/ExportMrPackDialog.cpp @@ -70,7 +70,8 @@ void ExportMrPackDialog::done(int result) ProgressDialog progress(this); progress.setSkipButton(true, tr("Abort")); - progress.execWithTask(&task); + if (progress.execWithTask(&task) != QDialog::Accepted) + return; } QDialog::done(result); |