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

@ -146,11 +146,8 @@ void ExportInstanceDialog::doExport()
auto task = makeShared<MMCZip::ExportToZipTask>(output, m_instance->instanceRoot(), files, "", true);
connect(task.get(), &Task::failed, this, [this, output](QString reason) {
CustomMessageBox::selectable(this, tr("Error"), reason, QMessageBox::Critical)->show();
QFile::remove(output);
});
connect(task.get(), &Task::aborted, this, [output] { QFile::remove(output); });
connect(task.get(), &Task::failed, this,
[this, output](QString reason) { CustomMessageBox::selectable(this, tr("Error"), reason, QMessageBox::Critical)->show(); });
connect(task.get(), &Task::finished, this, [task] { task->deleteLater(); });
ProgressDialog progress(this);