TaskTree: Introduce TaskTreeRunner

This addresses the 30th point in the bugreport below.

Task-number: QTCREATORBUG-28741
Change-Id: Ifa157311b3aae413b19075d36e11c75e6066881d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2024-01-13 12:37:26 +01:00
parent 14f6954026
commit 7e7318d47d
4 changed files with 87 additions and 4 deletions

View File

@@ -0,0 +1,33 @@
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "tasktreerunner.h"
#include "tasktree.h"
namespace Tasking {
TaskTreeRunner::~TaskTreeRunner() = default;
void TaskTreeRunner::start(const Group &recipe)
{
m_taskTree.reset(new TaskTree(recipe));
connect(m_taskTree.get(), &TaskTree::done, this, [this](DoneWith result) {
m_taskTree.release()->deleteLater();
emit done(result);
});
m_taskTree->start();
}
void TaskTreeRunner::stop()
{
if (m_taskTree)
m_taskTree->stop();
}
void TaskTreeRunner::reset()
{
m_taskTree.reset();
}
} // namespace Tasking