forked from qt-creator/qt-creator
ProjectExplorer: Use run device as fallback for build device
This is not necessarily a permanent solution, but does something sensible and suppresses warnings about non-existent build devices. Alternatives would be to always enforce the existence of a build device (fallback to "Desktop") as done for the run device, or enforce a build device only and consider "no run device" as "same as build device. Change-Id: Ib84670c63a6c416524ab4740419ede6b99981c43 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -1301,7 +1301,12 @@ Utils::Id BuildDeviceKitAspect::id()
|
||||
IDevice::ConstPtr BuildDeviceKitAspect::device(const Kit *k)
|
||||
{
|
||||
QTC_ASSERT(DeviceManager::instance()->isLoaded(), return IDevice::ConstPtr());
|
||||
return DeviceManager::instance()->find(deviceId(k));
|
||||
IDevice::ConstPtr dev = DeviceManager::instance()->find(deviceId(k));
|
||||
// Use the "run" device as fallback if no build device is present.
|
||||
// FIXME: Think about whether this shouldn't be the other way round.
|
||||
if (!dev)
|
||||
dev = DeviceKitAspect::device(k);
|
||||
return dev;
|
||||
}
|
||||
|
||||
Utils::Id BuildDeviceKitAspect::deviceId(const Kit *k)
|
||||
|
Reference in New Issue
Block a user