From 00e5968bd28ab1df33b3a39dbac8cda99aa2a0d2 Mon Sep 17 00:00:00 2001 From: Jan Dalheimer Date: Wed, 6 Apr 2016 23:09:30 +0200 Subject: NOISSUE Add a skeleton of the wonko system --- application/dialogs/ProgressDialog.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'application/dialogs/ProgressDialog.cpp') diff --git a/application/dialogs/ProgressDialog.cpp b/application/dialogs/ProgressDialog.cpp index 17ab79cd..5d7c7968 100644 --- a/application/dialogs/ProgressDialog.cpp +++ b/application/dialogs/ProgressDialog.cpp @@ -97,6 +97,18 @@ int ProgressDialog::execWithTask(Task *task) } } +// TODO: only provide the unique_ptr overloads +int ProgressDialog::execWithTask(std::unique_ptr &&task) +{ + connect(this, &ProgressDialog::destroyed, task.get(), &Task::deleteLater); + return execWithTask(task.release()); +} +int ProgressDialog::execWithTask(std::unique_ptr &task) +{ + connect(this, &ProgressDialog::destroyed, task.get(), &Task::deleteLater); + return execWithTask(task.release()); +} + bool ProgressDialog::handleImmediateResult(QDialog::DialogCode &result) { if(task->isFinished()) -- cgit v1.2.3