summaryrefslogtreecommitdiffstats
path: root/application/dialogs
diff options
context:
space:
mode:
authorJan Dalheimer <jan@dalheimer.de>2016-04-06 23:09:30 +0200
committerPetr Mrázek <peterix@gmail.com>2016-04-30 23:59:23 +0200
commit00e5968bd28ab1df33b3a39dbac8cda99aa2a0d2 (patch)
treec930ca4f0edae9bb2bbd1a9ce2fddb2ca5a7bf32 /application/dialogs
parent5ae3b2c11416eb897a08b0d9531843d0357332f8 (diff)
downloadMultiMC-00e5968bd28ab1df33b3a39dbac8cda99aa2a0d2.tar
MultiMC-00e5968bd28ab1df33b3a39dbac8cda99aa2a0d2.tar.gz
MultiMC-00e5968bd28ab1df33b3a39dbac8cda99aa2a0d2.tar.lz
MultiMC-00e5968bd28ab1df33b3a39dbac8cda99aa2a0d2.tar.xz
MultiMC-00e5968bd28ab1df33b3a39dbac8cda99aa2a0d2.zip
NOISSUE Add a skeleton of the wonko system
Diffstat (limited to 'application/dialogs')
-rw-r--r--application/dialogs/ProgressDialog.cpp12
-rw-r--r--application/dialogs/ProgressDialog.h3
2 files changed, 15 insertions, 0 deletions
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> &&task)
+{
+ connect(this, &ProgressDialog::destroyed, task.get(), &Task::deleteLater);
+ return execWithTask(task.release());
+}
+int ProgressDialog::execWithTask(std::unique_ptr<Task> &task)
+{
+ connect(this, &ProgressDialog::destroyed, task.get(), &Task::deleteLater);
+ return execWithTask(task.release());
+}
+
bool ProgressDialog::handleImmediateResult(QDialog::DialogCode &result)
{
if(task->isFinished())
diff --git a/application/dialogs/ProgressDialog.h b/application/dialogs/ProgressDialog.h
index 9ddbceb1..28d4e639 100644
--- a/application/dialogs/ProgressDialog.h
+++ b/application/dialogs/ProgressDialog.h
@@ -16,6 +16,7 @@
#pragma once
#include <QDialog>
+#include <memory>
class Task;
@@ -35,6 +36,8 @@ public:
void updateSize();
int execWithTask(Task *task);
+ int execWithTask(std::unique_ptr<Task> &&task);
+ int execWithTask(std::unique_ptr<Task> &task);
void setSkipButton(bool present, QString label = QString());