forked from qt-creator/qt-creator
QNX: Dismantle Slog2InfoRunner, employ RecipeRunner instead
Task-number: QTCREATORBUG-29168 Change-Id: I35d25dd05cbb94a00ee81035f236eff4a4edf96d Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
#include "slog2inforunner.h"
|
#include "slog2inforunner.h"
|
||||||
|
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
|
#include <projectexplorer/runcontrol.h>
|
||||||
#include <projectexplorer/qmldebugcommandlinearguments.h>
|
#include <projectexplorer/qmldebugcommandlinearguments.h>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
@@ -27,7 +28,8 @@ public:
|
|||||||
|
|
||||||
runControl->requestQmlChannel();
|
runControl->requestQmlChannel();
|
||||||
|
|
||||||
auto slog2InfoRunner = new Slog2InfoRunner(runControl);
|
auto slog2InfoRunner = new RecipeRunner(runControl);
|
||||||
|
slog2InfoRunner->setRecipe(slog2InfoRecipe(slog2InfoRunner));
|
||||||
worker->addStartDependency(slog2InfoRunner);
|
worker->addStartDependency(slog2InfoRunner);
|
||||||
|
|
||||||
auto profiler = runControl->createWorker(ProjectExplorer::Constants::QML_PROFILER_RUNNER);
|
auto profiler = runControl->createWorker(ProjectExplorer::Constants::QML_PROFILER_RUNNER);
|
||||||
|
@@ -196,7 +196,8 @@ public:
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
auto slog2InfoRunner = new Slog2InfoRunner(runControl);
|
auto slog2InfoRunner = new RecipeRunner(runControl);
|
||||||
|
slog2InfoRunner->setRecipe(slog2InfoRecipe(slog2InfoRunner));
|
||||||
debuggeeRunner->addStartDependency(slog2InfoRunner);
|
debuggeeRunner->addStartDependency(slog2InfoRunner);
|
||||||
|
|
||||||
debugger->addStartDependency(debuggeeRunner);
|
debugger->addStartDependency(debuggeeRunner);
|
||||||
|
@@ -7,6 +7,9 @@
|
|||||||
|
|
||||||
#include <projectexplorer/devicesupport/idevice.h>
|
#include <projectexplorer/devicesupport/idevice.h>
|
||||||
#include <projectexplorer/runconfigurationaspects.h>
|
#include <projectexplorer/runconfigurationaspects.h>
|
||||||
|
#include <projectexplorer/runcontrol.h>
|
||||||
|
|
||||||
|
#include <solutions/tasking/tasktreerunner.h>
|
||||||
|
|
||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
@@ -33,7 +36,7 @@ struct SlogData
|
|||||||
void processLogInput(const QString &input);
|
void processLogInput(const QString &input);
|
||||||
};
|
};
|
||||||
|
|
||||||
static Group recipe(RunWorker *worker)
|
Group slog2InfoRecipe(RunWorker *worker)
|
||||||
{
|
{
|
||||||
RunControl *runControl = worker->runControl();
|
RunControl *runControl = worker->runControl();
|
||||||
QString applicationId = runControl->aspectData<ExecutableAspect>()->executable.fileName();
|
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()
|
void SlogData::processRemainingLogData()
|
||||||
{
|
{
|
||||||
if (!m_remainingData.isEmpty())
|
if (!m_remainingData.isEmpty())
|
||||||
@@ -154,23 +150,4 @@ void SlogData::processLogLine(const QString &line)
|
|||||||
m_worker->appendMessage(match.captured(6).trimmed() + '\n', StdOutFormat);
|
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
|
} // Qnx::Internal
|
||||||
|
@@ -3,23 +3,11 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <projectexplorer/runcontrol.h>
|
namespace ProjectExplorer { class RunWorker; }
|
||||||
|
namespace Tasking { class Group; }
|
||||||
#include <solutions/tasking/tasktreerunner.h>
|
|
||||||
|
|
||||||
namespace Qnx::Internal {
|
namespace Qnx::Internal {
|
||||||
|
|
||||||
class Slog2InfoRunner : public ProjectExplorer::RunWorker
|
Tasking::Group slog2InfoRecipe(ProjectExplorer::RunWorker *worker);
|
||||||
{
|
|
||||||
public:
|
|
||||||
explicit Slog2InfoRunner(ProjectExplorer::RunControl *runControl);
|
|
||||||
|
|
||||||
void start() override;
|
|
||||||
void stop() override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
Tasking::TaskTreeRunner m_taskTreeRunner;
|
|
||||||
Tasking::Group m_recipe;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // Qnx::Internal
|
} // Qnx::Internal
|
||||||
|
Reference in New Issue
Block a user