From 578532388386ead1ac88973a345628fb34cf7abe Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Thu, 27 Feb 2025 13:52:07 +0100 Subject: [PATCH] RecipeRunner: Introduce RunInterface For communication between RunControl and run recipes. Change-Id: Idf4a187384be057fa9f023a69e810cb3261d5fab Reviewed-by: hjk --- src/plugins/projectexplorer/runcontrol.cpp | 11 +++++++++++ src/plugins/projectexplorer/runcontrol.h | 12 ++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index 68dcff41f15..3a59b8d665b 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -1950,6 +1950,17 @@ ProcessRunnerFactory::ProcessRunnerFactory(const QList &runConfigs) setSupportedRunConfigs(runConfigs); } +Storage runStorage() +{ + static Storage theRunStorage; + return theRunStorage; +} + +Canceler canceler() +{ + return [] { return std::make_pair(runStorage().activeStorage(), &RunInterface::canceled); }; +} + void RecipeRunner::start() { QTC_CHECK(!m_taskTreeRunner.isRunning()); diff --git a/src/plugins/projectexplorer/runcontrol.h b/src/plugins/projectexplorer/runcontrol.h index fd2c31c4004..01ac880b2c2 100644 --- a/src/plugins/projectexplorer/runcontrol.h +++ b/src/plugins/projectexplorer/runcontrol.h @@ -304,6 +304,18 @@ void addOutputParserFactory(const std::function createOutputParsers(Target *target); +class PROJECTEXPLORER_EXPORT RunInterface : public QObject +{ + Q_OBJECT + +signals: + void canceled(); +}; + +PROJECTEXPLORER_EXPORT Tasking::Storage runStorage(); +using Canceler = std::function()>; +PROJECTEXPLORER_EXPORT Canceler canceler(); + class PROJECTEXPLORER_EXPORT RecipeRunner final : public RunWorker { public: