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: