handle file removal in ExportToZipTask

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2023-07-17 16:55:26 +03:00
parent 78ee63af38
commit 64041a84a2
5 changed files with 26 additions and 16 deletions

View File

@ -208,14 +208,10 @@ void ModrinthPackExportTask::buildZip()
});
connect(zipTask.get(), &Task::succeeded, this, &ModrinthPackExportTask::emitSucceeded);
connect(zipTask.get(), &Task::aborted, this, [this]() {
QFile::remove(output);
emitAborted();
});
connect(zipTask.get(), &Task::aborted, this, &ModrinthPackExportTask::emitAborted);
connect(zipTask.get(), &Task::failed, this, [this, progressStep](QString reason) {
progressStep->state = TaskStepState::Failed;
stepProgress(*progressStep);
QFile::remove(output);
emitFailed(reason);
});
connect(zipTask.get(), &Task::stepProgress, this, &ModrinthPackExportTask::propogateStepProgress);