summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/logic/InstanceList.cpp8
-rw-r--r--application/MainWindow.cpp4
-rw-r--r--application/pages/instance/LegacyUpgradePage.cpp2
3 files changed, 6 insertions, 8 deletions
diff --git a/api/logic/InstanceList.cpp b/api/logic/InstanceList.cpp
index a3f2e487..993ae92d 100644
--- a/api/logic/InstanceList.cpp
+++ b/api/logic/InstanceList.cpp
@@ -718,7 +718,7 @@ public:
// FIXME/TODO: add ability to abort during instance commit retries
bool abort() override
{
- if(m_child)
+ if(m_child && m_child->canAbort())
{
return m_child->abort();
}
@@ -726,9 +726,9 @@ public:
}
bool canAbort() const override
{
- if(m_child)
+ if(m_child && m_child->canAbort())
{
- return m_child->canAbort();
+ return true;
}
return false;
}
@@ -746,7 +746,6 @@ protected:
private slots:
void childSucceded()
{
- m_child.reset();
unsigned sleepTime = backoff();
if(m_parent->commitStagedInstance(m_stagingPath, m_instanceName, m_groupName))
{
@@ -764,7 +763,6 @@ private slots:
}
void childFailed(const QString & reason)
{
- m_child.reset();
m_parent->destroyStagingPath(m_stagingPath);
emitFailed(reason);
}
diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp
index 78b0a907..f144fcbd 100644
--- a/application/MainWindow.cpp
+++ b/application/MainWindow.cpp
@@ -1283,7 +1283,7 @@ void MainWindow::runModalTask(Task *task)
void MainWindow::instanceFromInstanceTask(InstanceTask *rawTask)
{
- std::unique_ptr<Task> task(MMC->instances()->wrapInstanceTask(rawTask));
+ unique_qobject_ptr<Task> task(MMC->instances()->wrapInstanceTask(rawTask));
runModalTask(task.get());
}
@@ -1300,7 +1300,7 @@ void MainWindow::on_actionCopyInstance_triggered()
copyTask->setName(copyInstDlg.instName());
copyTask->setGroup(copyInstDlg.instGroup());
copyTask->setIcon(copyInstDlg.iconKey());
- std::unique_ptr<Task> task(MMC->instances()->wrapInstanceTask(copyTask));
+ unique_qobject_ptr<Task> task(MMC->instances()->wrapInstanceTask(copyTask));
runModalTask(task.get());
}
diff --git a/application/pages/instance/LegacyUpgradePage.cpp b/application/pages/instance/LegacyUpgradePage.cpp
index 15fd10cc..af800b03 100644
--- a/application/pages/instance/LegacyUpgradePage.cpp
+++ b/application/pages/instance/LegacyUpgradePage.cpp
@@ -40,7 +40,7 @@ void LegacyUpgradePage::on_upgradeButton_clicked()
upgradeTask->setName(newName);
upgradeTask->setGroup(MMC->instances()->getInstanceGroup(m_inst->id()));
upgradeTask->setIcon(m_inst->iconKey());
- std::unique_ptr<Task> task(MMC->instances()->wrapInstanceTask(upgradeTask));
+ unique_qobject_ptr<Task> task(MMC->instances()->wrapInstanceTask(upgradeTask));
runModalTask(task.get());
}