ios: remove temporary devices

Developer mode activation generates temporary devices that will never
be usable again. Remove them if they were picked up.

Change-Id: Iff35b640d2c2e8394b108fd8d224a2b6ea8e1626
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
Fawzi Mohamed
2014-02-25 22:20:16 +01:00
parent 0db9d98db3
commit 8695c64012
3 changed files with 15 additions and 6 deletions

View File

@@ -63,7 +63,13 @@ ProjectExplorer::IDevice::Ptr IosDeviceFactory::create(Core::Id id) const
bool IosDeviceFactory::canRestore(const QVariantMap &map) const
{
return ProjectExplorer::IDevice::typeFromMap(map) == Constants::IOS_DEVICE_TYPE;
if (ProjectExplorer::IDevice::typeFromMap(map) != Constants::IOS_DEVICE_TYPE)
return false;
QVariantMap vMap = map.value(QLatin1String(Constants::EXTRA_INFO_KEY)).toMap();
if (vMap.isEmpty()
|| vMap.value(QLatin1String("deviceName")).toString() == QLatin1String("*unknown*"))
return false; // transient device (probably generated during an activation)
return true;
}
ProjectExplorer::IDevice::Ptr IosDeviceFactory::restore(const QVariantMap &map) const