diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index 3a59b8d665b..563b714e0e8 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -1964,7 +1964,15 @@ Canceler canceler() void RecipeRunner::start() { QTC_CHECK(!m_taskTreeRunner.isRunning()); - m_taskTreeRunner.start(m_recipe, {}, [this](DoneWith result) { + + const Group recipe { + runStorage(), + onGroupSetup([this] { connect(this, &RecipeRunner::canceled, + runStorage().activeStorage(), &RunInterface::canceled); }), + m_recipe + }; + + m_taskTreeRunner.start(recipe, {}, [this](DoneWith result) { if (result == DoneWith::Success) reportStopped(); else @@ -1975,8 +1983,7 @@ void RecipeRunner::start() void RecipeRunner::stop() { - m_taskTreeRunner.cancel(); - reportStopped(); + emit canceled(); } } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/runcontrol.h b/src/plugins/projectexplorer/runcontrol.h index 01ac880b2c2..91e90f9c74a 100644 --- a/src/plugins/projectexplorer/runcontrol.h +++ b/src/plugins/projectexplorer/runcontrol.h @@ -298,7 +298,6 @@ public: explicit ProcessRunnerFactory(const QList &runConfig); }; - PROJECTEXPLORER_EXPORT void addOutputParserFactory(const std::function &); @@ -318,12 +317,17 @@ PROJECTEXPLORER_EXPORT Canceler canceler(); class PROJECTEXPLORER_EXPORT RecipeRunner final : public RunWorker { + Q_OBJECT + public: explicit RecipeRunner(RunControl *runControl) : RunWorker(runControl) {} void setRecipe(const Tasking::Group &recipe) { m_recipe = recipe; } +signals: + void canceled(); + private: void start() final; void stop() final; diff --git a/src/plugins/qnx/slog2inforunner.cpp b/src/plugins/qnx/slog2inforunner.cpp index 5dff6180107..09f1a747c22 100644 --- a/src/plugins/qnx/slog2inforunner.cpp +++ b/src/plugins/qnx/slog2inforunner.cpp @@ -84,13 +84,13 @@ Group slog2InfoRecipe(RunControl *runControl) storage->processRemainingLogData(); }; - return { + return Group { storage, ProcessTask(onTestSetup, onTestDone, CallDoneIf::Error), ProcessTask(onLaunchTimeSetup, onLaunchTimeDone, CallDoneIf::Success), ProcessTask(onLogSetup, onLogError, CallDoneIf::Error), onGroupDone(onCanceled, CallDoneIf::Error) - }; + }.withCancel(canceler()); } void SlogData::processRemainingLogData()