From 0c18fbc31f8f0cad3c6375dcb59911b8fb2af025 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Thu, 24 Nov 2022 15:27:46 +0100 Subject: [PATCH] ProjectExplorer: Provide task tree adapter for DeviceProcessKiller Change-Id: I45133dcba07d5fc5fa721c0af13ba86f75985a5e Reviewed-by: Christian Kandeler --- src/plugins/projectexplorer/devicesupport/idevice.cpp | 10 ++++++++++ src/plugins/projectexplorer/devicesupport/idevice.h | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index 0e1ae93a25a..2845e4defe1 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -683,4 +683,14 @@ void DeviceProcessKiller::start() m_signalOperation->killProcess(m_processPath.path()); } +KillerAdapter::KillerAdapter() +{ + connect(task(), &DeviceProcessKiller::done, this, &KillerAdapter::done); +} + +void KillerAdapter::start() +{ + task()->start(); +} + } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/devicesupport/idevice.h b/src/plugins/projectexplorer/devicesupport/idevice.h index 067262bcd57..71528bfb837 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.h +++ b/src/plugins/projectexplorer/devicesupport/idevice.h @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -294,4 +295,13 @@ private: QString m_errorString; }; +class PROJECTEXPLORER_EXPORT KillerAdapter : public Utils::Tasking::TaskAdapter +{ +public: + KillerAdapter(); + void start() final; +}; + } // namespace ProjectExplorer + +QTC_DECLARE_CUSTOM_TASK(Killer, ProjectExplorer::KillerAdapter);