QNX: Dismantle Slog2InfoRunner, employ RecipeRunner instead

Task-number: QTCREATORBUG-29168
Change-Id: I35d25dd05cbb94a00ee81035f236eff4a4edf96d
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2025-02-20 14:34:35 +01:00
parent 6f4ba9c480
commit bfb5a16d9a
4 changed files with 12 additions and 44 deletions

View File

@@ -8,6 +8,7 @@
#include "slog2inforunner.h"
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/runcontrol.h>
#include <projectexplorer/qmldebugcommandlinearguments.h>
using namespace ProjectExplorer;
@@ -27,7 +28,8 @@ public:
runControl->requestQmlChannel();
auto slog2InfoRunner = new Slog2InfoRunner(runControl);
auto slog2InfoRunner = new RecipeRunner(runControl);
slog2InfoRunner->setRecipe(slog2InfoRecipe(slog2InfoRunner));
worker->addStartDependency(slog2InfoRunner);
auto profiler = runControl->createWorker(ProjectExplorer::Constants::QML_PROFILER_RUNNER);

View File

@@ -196,7 +196,8 @@ public:
});
auto slog2InfoRunner = new Slog2InfoRunner(runControl);
auto slog2InfoRunner = new RecipeRunner(runControl);
slog2InfoRunner->setRecipe(slog2InfoRecipe(slog2InfoRunner));
debuggeeRunner->addStartDependency(slog2InfoRunner);
debugger->addStartDependency(debuggeeRunner);

View File

@@ -7,6 +7,9 @@
#include <projectexplorer/devicesupport/idevice.h>
#include <projectexplorer/runconfigurationaspects.h>
#include <projectexplorer/runcontrol.h>
#include <solutions/tasking/tasktreerunner.h>
#include <utils/qtcprocess.h>
#include <utils/qtcassert.h>
@@ -33,7 +36,7 @@ struct SlogData
void processLogInput(const QString &input);
};
static Group recipe(RunWorker *worker)
Group slog2InfoRecipe(RunWorker *worker)
{
RunControl *runControl = worker->runControl();
QString applicationId = runControl->aspectData<ExecutableAspect>()->executable.fileName();
@@ -90,13 +93,6 @@ static Group recipe(RunWorker *worker)
};
}
Slog2InfoRunner::Slog2InfoRunner(RunControl *runControl)
: RunWorker(runControl)
, m_recipe(recipe(this))
{
setId("Slog2InfoRunner");
}
void SlogData::processRemainingLogData()
{
if (!m_remainingData.isEmpty())
@@ -154,23 +150,4 @@ void SlogData::processLogLine(const QString &line)
m_worker->appendMessage(match.captured(6).trimmed() + '\n', StdOutFormat);
}
void Slog2InfoRunner::start()
{
QTC_CHECK(!m_taskTreeRunner.isRunning());
m_taskTreeRunner.start(m_recipe, {}, [this](DoneWith result) {
if (result == DoneWith::Success)
reportStopped();
else
reportFailure();
});
reportStarted();
}
void Slog2InfoRunner::stop()
{
m_taskTreeRunner.cancel();
reportStopped();
}
} // Qnx::Internal

View File

@@ -3,23 +3,11 @@
#pragma once
#include <projectexplorer/runcontrol.h>
#include <solutions/tasking/tasktreerunner.h>
namespace ProjectExplorer { class RunWorker; }
namespace Tasking { class Group; }
namespace Qnx::Internal {
class Slog2InfoRunner : public ProjectExplorer::RunWorker
{
public:
explicit Slog2InfoRunner(ProjectExplorer::RunControl *runControl);
void start() override;
void stop() override;
private:
Tasking::TaskTreeRunner m_taskTreeRunner;
Tasking::Group m_recipe;
};
Tasking::Group slog2InfoRecipe(ProjectExplorer::RunWorker *worker);
} // Qnx::Internal