ProjectExplorer: Fail more gracefully

... when SomeDevice::portsGatheringMethod() is not implemented.

That's more a debugging help than an actual solution for the user.

Change-Id: I2ab97f6fb00c4d5cfebb60e58cf948d725f3d6a6
Reviewed-by: Wolfgang Bremer <wolfgang.bremer@pelagicore.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2017-08-07 16:14:35 +02:00
parent 096253bf6e
commit 17d6ed15ca

View File

@@ -65,8 +65,9 @@ DeviceUsedPortsGatherer::~DeviceUsedPortsGatherer()
void DeviceUsedPortsGatherer::start(const IDevice::ConstPtr &device)
{
QTC_ASSERT(!d->connection, return);
QTC_ASSERT(device && device->portsGatheringMethod(), return);
QTC_ASSERT(!d->connection, emit error("No connection"); return);
QTC_ASSERT(device && device->portsGatheringMethod(),
emit error("Not implemented"); return);
d->device = device;
d->connection = QSsh::acquireConnection(device->sshParameters());