From 2876885e4acbc879cce792ca608d619afdd3b9f9 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 27 Sep 2024 16:00:10 +0200 Subject: [PATCH] Debugger: Dissolve the DebugServerPortsGatherer::m_channelProviders[] Try to simplify the structure. Lumping them together is not really needed. Change-Id: Ie31411448f66df29326219bcf652fb3da16a54bd Reviewed-by: Jarek Kobus --- src/plugins/debugger/debuggerruncontrol.cpp | 14 +++++++------- src/plugins/debugger/debuggerruncontrol.h | 3 ++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 8468cd40032..555a44a8a58 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -1110,23 +1110,23 @@ DebugServerPortsGatherer::DebugServerPortsGatherer(RunControl *runControl) setId("DebugServerPortsGatherer"); auto portsGatherer = new PortsGatherer(runControl); - for (int i = 0; i < 2; ++i) { - auto channelProvider = new Internal::SubChannelProvider(runControl, portsGatherer); - m_channelProviders[i] = channelProvider; - addStartDependency(channelProvider); - } + m_gdbChannelProvider = new Internal::SubChannelProvider(runControl, portsGatherer); + addStartDependency(m_gdbChannelProvider); + + m_qmlChannelProvider = new Internal::SubChannelProvider(runControl, portsGatherer); + addStartDependency(m_qmlChannelProvider); } DebugServerPortsGatherer::~DebugServerPortsGatherer() = default; QUrl DebugServerPortsGatherer::gdbServer() const { - return m_channelProviders[0]->channel(); + return m_gdbChannelProvider->channel(); } QUrl DebugServerPortsGatherer::qmlServer() const { - return m_channelProviders[1]->channel(); + return m_qmlChannelProvider->channel(); } void DebuggerRunTool::startDebugServerIfNeededAndContinueStartup() diff --git a/src/plugins/debugger/debuggerruncontrol.h b/src/plugins/debugger/debuggerruncontrol.h index db5658a2e87..91a987bece3 100644 --- a/src/plugins/debugger/debuggerruncontrol.h +++ b/src/plugins/debugger/debuggerruncontrol.h @@ -142,9 +142,10 @@ public: QUrl qmlServer() const; private: - std::array m_channelProviders; bool m_useGdbServer = false; bool m_useQmlServer = false; + Internal::SubChannelProvider *m_gdbChannelProvider; + Internal::SubChannelProvider *m_qmlChannelProvider; }; class DebuggerRunWorkerFactory final : public ProjectExplorer::RunWorkerFactory