Generalize IDevice::qmlProfilerHost

The idea is to have a way for tools to specify what kind of
control channel they would like to use to communicate with
a device without making the choice explicit dependent on
the exact kind of tool to further decouple device and tool
implementations.

The 'hint' values are there to help the device implementation
to decide on which channel to use exactly in case there are
multiple choices. In any case, the tool is responsible to
check that the returned channel is suitable for its operation.

Currently the only choice is "QmlControlChannel" yielding
a simple wrapper around the former IDevice::qmlProfilerHost()
return value.

Other enum values may potentially be {Tcp,LocalSocket}ControlChannel
(to specify a type of transport) AdbChannel (to specify some
generic helper mechanism). It might also turn out that something
more complex than an enum will be needed, e.g. to express
a set of values with priorities or such, but I'd rather
avoid overengineering for now.

Change-Id: Id386425eb3dd2bb395065f0bdb6f67217cd40a71
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
hjk
2016-06-03 19:11:29 +02:00
parent 1e90926966
commit db9437c2e8
8 changed files with 33 additions and 12 deletions

View File

@@ -562,8 +562,10 @@ void QmlProfilerTool::startRemoteTool(ProjectExplorer::RunConfiguration *rc)
IDevice::ConstPtr device = DeviceKitInformation::device(kit);
if (device) {
Connection toolControl = device->toolControlChannel(IDevice::QmlControlChannel);
QTC_ASSERT(toolControl.is<HostName>(), return);
connection.analyzerHost = toolControl.as<HostName>().host();
connection.connParams = device->sshParameters();
connection.analyzerHost = device->qmlProfilerHost();
}
connection.analyzerPort = Utils::Port(port);