Fix abort?

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
TheKodeToad 2023-03-04 11:07:07 +00:00
parent f583e617ec
commit 87384182a1
2 changed files with 8 additions and 3 deletions

View File

@ -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;
}

View File

@ -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);