From 302268c4d4431d7311500419347163fc78d5a904 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Tue, 29 Nov 2022 13:59:01 +0100 Subject: ProjectExplorer: Remove ChannelForwarder It seems it didn't do anything useful. Change-Id: I7a3cfb7b98734d7bc2d39243559b9cfc34952186 Reviewed-by: hjk --- .../devicesupport/deviceusedportsgatherer.cpp | 48 ++-------------------- .../devicesupport/deviceusedportsgatherer.h | 9 ---- 2 files changed, 3 insertions(+), 54 deletions(-) diff --git a/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp b/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp index 571939c709..6acefeee38 100644 --- a/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp +++ b/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp @@ -162,25 +162,6 @@ void PortsGatherer::stop() reportStopped(); } - -// ChannelForwarder - -/*! - \class ProjectExplorer::ChannelForwarder - - \internal - - \brief The class provides a \c RunWorker handling the forwarding - from one device to another. - - Both endpoints are specified by \c{QUrl}s, typically with - a "tcp" or "socket" scheme. -*/ - -ChannelForwarder::ChannelForwarder(RunControl *runControl) - : RunWorker(runControl) -{} - namespace Internal { // SubChannelProvider @@ -194,9 +175,6 @@ namespace Internal { use port forwarding for one SubChannel in the ChannelProvider implementation. - A device implementation can provide a "ChannelForwarder" - RunWorker non-trivial implementation if needed. - By default it is assumed that no forwarding is needed, i.e. end points provided by the shared endpoint resource provider are directly accessible. @@ -205,30 +183,17 @@ namespace Internal { class SubChannelProvider : public RunWorker { public: - SubChannelProvider(RunControl *runControl, RunWorker *sharedEndpointGatherer) + SubChannelProvider(RunControl *runControl) : RunWorker(runControl) { setId("SubChannelProvider"); - - m_portGatherer = qobject_cast(sharedEndpointGatherer); - if (m_portGatherer) { - if (auto forwarder = runControl->createWorker("ChannelForwarder")) { - m_channelForwarder = qobject_cast(forwarder); - if (m_channelForwarder) { - m_channelForwarder->addStartDependency(m_portGatherer); - addStartDependency(m_channelForwarder); - } - } - } } void start() final { m_channel.setScheme(urlTcpScheme()); m_channel.setHost(device()->toolControlChannel(IDevice::ControlChannelHint()).host()); - if (m_channelForwarder) - m_channel.setPort(m_channelForwarder->recordedData("LocalPort").toUInt()); - else if (m_portGatherer) + if (m_portGatherer) m_channel.setPort(m_portGatherer->findEndPoint().port()); reportStarted(); } @@ -238,7 +203,6 @@ public: private: QUrl m_channel; PortsGatherer *m_portGatherer = nullptr; - ChannelForwarder *m_channelForwarder = nullptr; }; } // Internal @@ -280,14 +244,8 @@ ChannelProvider::ChannelProvider(RunControl *runControl, int requiredChannels) { setId("ChannelProvider"); - RunWorker *sharedEndpoints = runControl->createWorker("SharedEndpointGatherer"); - if (!sharedEndpoints) { - // null is a legit value indicating 'no need to share'. - sharedEndpoints = new PortsGatherer(runControl); - } - for (int i = 0; i < requiredChannels; ++i) { - auto channelProvider = new Internal::SubChannelProvider(runControl, sharedEndpoints); + auto channelProvider = new Internal::SubChannelProvider(runControl); m_channelProviders.append(channelProvider); addStartDependency(channelProvider); } diff --git a/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.h b/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.h index be7f12aa63..a438df7a81 100644 --- a/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.h +++ b/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.h @@ -70,15 +70,6 @@ private: Utils::PortList m_portList; }; -class PROJECTEXPLORER_EXPORT ChannelForwarder : public RunWorker -{ - Q_OBJECT - -public: - explicit ChannelForwarder(RunControl *runControl); - -}; - class PROJECTEXPLORER_EXPORT ChannelProvider : public RunWorker { Q_OBJECT -- cgit v1.2.3