forked from qt-creator/qt-creator
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:
33
src/libs/solutions/tasking/tasktreerunner.cpp
Normal file
33
src/libs/solutions/tasking/tasktreerunner.cpp
Normal 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
|
||||
Reference in New Issue
Block a user