From 15d6e1df1ba2129049bf7e5c25f4eea8004910b0 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 5 Jan 2023 08:50:37 +0100 Subject: [PATCH] Debugger: Use a full class for DebuggerRunWorkerFactory This continues the work started with de6c7696d2ce8. Change-Id: Ifc306347f2346909a9eba39c74449c559a7c2f76 Reviewed-by: Christian Stenger --- src/plugins/debugger/debuggerplugin.cpp | 7 +------ src/plugins/debugger/debuggerruncontrol.cpp | 12 +++++++++++- src/plugins/debugger/debuggerruncontrol.h | 8 +++++++- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 7453e720da0..f33880d3fc4 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -709,12 +709,7 @@ public: DebuggerKitAspect debuggerKitAspect; CommonOptionsPage commonOptionsPage; - RunWorkerFactory debuggerWorkerFactory{ - RunWorkerFactory::make(), - {ProjectExplorer::Constants::DEBUG_RUN_MODE}, - {}, // All local run configs? - {PE::DESKTOP_DEVICE_TYPE, "DockerDeviceType"} - }; + DebuggerRunWorkerFactory debuggerWorkerFactory; // FIXME: Needed? // QString mainScript = runConfig->property("mainScript").toString(); diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 62bb6b7edf3..13283b5416b 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -1073,4 +1073,14 @@ void DebugServerRunner::setAttachPid(ProcessHandle pid) m_pid = pid; } -} // namespace Debugger +// DebuggerRunWorkerFactory + +DebuggerRunWorkerFactory::DebuggerRunWorkerFactory() +{ + setProduct(); + addSupportedRunMode(ProjectExplorer::Constants::DEBUG_RUN_MODE); + addSupportedDeviceType(ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE); + addSupportedDeviceType("DockerDeviceType"); +} + +} // Debugger diff --git a/src/plugins/debugger/debuggerruncontrol.h b/src/plugins/debugger/debuggerruncontrol.h index 6daca73a2c4..4c5198b4c3b 100644 --- a/src/plugins/debugger/debuggerruncontrol.h +++ b/src/plugins/debugger/debuggerruncontrol.h @@ -155,7 +155,13 @@ private: bool m_useMulti = true; }; +class DebuggerRunWorkerFactory final : public ProjectExplorer::RunWorkerFactory +{ +public: + DebuggerRunWorkerFactory(); +}; + extern DEBUGGER_EXPORT const char DebugServerRunnerWorkerId[]; extern DEBUGGER_EXPORT const char GdbServerPortGathererWorkerId[]; -} // namespace Debugger +} // Debugger