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 <jaroslaw.kobus@qt.io>
This commit is contained in:
hjk
2024-09-27 16:00:10 +02:00
parent 49c53ffb4b
commit 2876885e4a
2 changed files with 9 additions and 8 deletions

View File

@@ -1110,23 +1110,23 @@ DebugServerPortsGatherer::DebugServerPortsGatherer(RunControl *runControl)
setId("DebugServerPortsGatherer"); setId("DebugServerPortsGatherer");
auto portsGatherer = new PortsGatherer(runControl); auto portsGatherer = new PortsGatherer(runControl);
for (int i = 0; i < 2; ++i) { m_gdbChannelProvider = new Internal::SubChannelProvider(runControl, portsGatherer);
auto channelProvider = new Internal::SubChannelProvider(runControl, portsGatherer); addStartDependency(m_gdbChannelProvider);
m_channelProviders[i] = channelProvider;
addStartDependency(channelProvider); m_qmlChannelProvider = new Internal::SubChannelProvider(runControl, portsGatherer);
} addStartDependency(m_qmlChannelProvider);
} }
DebugServerPortsGatherer::~DebugServerPortsGatherer() = default; DebugServerPortsGatherer::~DebugServerPortsGatherer() = default;
QUrl DebugServerPortsGatherer::gdbServer() const QUrl DebugServerPortsGatherer::gdbServer() const
{ {
return m_channelProviders[0]->channel(); return m_gdbChannelProvider->channel();
} }
QUrl DebugServerPortsGatherer::qmlServer() const QUrl DebugServerPortsGatherer::qmlServer() const
{ {
return m_channelProviders[1]->channel(); return m_qmlChannelProvider->channel();
} }
void DebuggerRunTool::startDebugServerIfNeededAndContinueStartup() void DebuggerRunTool::startDebugServerIfNeededAndContinueStartup()

View File

@@ -142,9 +142,10 @@ public:
QUrl qmlServer() const; QUrl qmlServer() const;
private: private:
std::array<Internal::SubChannelProvider *, 2> m_channelProviders;
bool m_useGdbServer = false; bool m_useGdbServer = false;
bool m_useQmlServer = false; bool m_useQmlServer = false;
Internal::SubChannelProvider *m_gdbChannelProvider;
Internal::SubChannelProvider *m_qmlChannelProvider;
}; };
class DebuggerRunWorkerFactory final : public ProjectExplorer::RunWorkerFactory class DebuggerRunWorkerFactory final : public ProjectExplorer::RunWorkerFactory