Added QFutureWatcher

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>

abort

forgot

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2023-07-17 17:42:15 +03:00
parent fe73d696cb
commit b0940d696b
3 changed files with 61 additions and 27 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);