forked from qt-creator/qt-creator
Qnx: Fix crash when running with no device
"Run" should be disabled if active the kit contains not QNX device. Task-number: QTCREATORBUG-12143 Change-Id: I6cf9c70a8c3fc2ec63833e93840c9310345bc2b6 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Tobias Hunger
parent
7a45450831
commit
f7ac0adf7f
@@ -157,15 +157,15 @@ bool QnxRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMode mo
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const QnxRunConfiguration * const rc = qobject_cast<QnxRunConfiguration *>(runConfiguration);
|
const QnxRunConfiguration * const rc = qobject_cast<QnxRunConfiguration *>(runConfiguration);
|
||||||
if (mode == DebugRunMode || mode == QmlProfilerRunMode) {
|
const QnxDeviceConfiguration::ConstPtr dev = DeviceKitInformation::device(runConfiguration->target()->kit())
|
||||||
const QnxDeviceConfiguration::ConstPtr dev = DeviceKitInformation::device(runConfiguration->target()->kit())
|
.dynamicCast<const QnxDeviceConfiguration>();
|
||||||
.dynamicCast<const QnxDeviceConfiguration>();
|
if (dev.isNull())
|
||||||
if (dev.isNull())
|
return false;
|
||||||
return false;
|
|
||||||
|
if (mode == DebugRunMode || mode == QmlProfilerRunMode)
|
||||||
return rc->portsUsedByDebuggers() <= dev->freePorts().count();
|
return rc->portsUsedByDebuggers() <= dev->freePorts().count();
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user