summaryrefslogtreecommitdiff
path: root/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2017-07-07 09:46:22 +0200
committerhjk <hjk@qt.io>2017-07-07 10:56:25 +0000
commit8376afd9d7f0c9dc8cd6c5e0eaccac61905cad28 (patch)
tree9398fe0faa72e9c508e180108f4327d0af66b374 /src/plugins/remotelinux/remotelinuxdebugsupport.cpp
parent2cacf24b18eaf10c771046979ddb71924e864061 (diff)
downloadqt-creator-8376afd9d7f0c9dc8cd6c5e0eaccac61905cad28.tar.gz
ProjectExplorer: Remove RunControl::worker<Type>()
It looks like the case where workers need talk to each other by only knowing the type of the 'partner' does not exist in practice anymore. With the now-common setup of a 'primary' worker that one can introduce the 'lesser' workers to each other directly. That's also conceptually more robust that picking a partner by type only only from some 'pool' (all the workers in a runcontrol), scales better (it e.g. is imaginable that a RunControl needs more than one PortGatherer in complex setups where more than one device is involved) saves a few cycles, and even removes the need for workers to be qobject_cast-able. Change-Id: Ib3d8c942c893d6c198d9813cce7df28ba3260ce8 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/remotelinux/remotelinuxdebugsupport.cpp')
-rw-r--r--src/plugins/remotelinux/remotelinuxdebugsupport.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
index 48e72e9f4e..2d74283218 100644
--- a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
+++ b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
@@ -52,12 +52,12 @@ LinuxDeviceDebugSupport::LinuxDeviceDebugSupport(RunControl *runControl)
{
setDisplayName("LinuxDeviceDebugSupport");
- auto portsGatherer = new GdbServerPortsGatherer(runControl);
- portsGatherer->setUseGdbServer(isCppDebugging());
- portsGatherer->setUseQmlServer(isQmlDebugging());
+ m_portsGatherer = new GdbServerPortsGatherer(runControl);
+ m_portsGatherer->setUseGdbServer(isCppDebugging());
+ m_portsGatherer->setUseQmlServer(isQmlDebugging());
- auto gdbServer = new GdbServerRunner(runControl);
- gdbServer->addDependency(portsGatherer);
+ auto gdbServer = new GdbServerRunner(runControl, m_portsGatherer);
+ gdbServer->addDependency(m_portsGatherer);
addDependency(gdbServer);
@@ -75,12 +75,9 @@ void LinuxDeviceDebugSupport::start()
return;
}
- auto portsGatherer = runControl()->worker<GdbServerPortsGatherer>();
- QTC_ASSERT(portsGatherer, reportFailure(); return);
-
const QString host = device()->sshParameters().host;
- const Port gdbServerPort = portsGatherer->gdbServerPort();
- const Port qmlServerPort = portsGatherer->qmlServerPort();
+ const Port gdbServerPort = m_portsGatherer->gdbServerPort();
+ const Port qmlServerPort = m_portsGatherer->qmlServerPort();
DebuggerStartParameters params;
params.startMode = AttachToRemoteServer;