ProjectExplorer: Move common bits of IDeviceFactory::canRestore

... to the single user.

As effect, all but the ios re-implementation are not needed.

Change-Id: I3c8b8c5d4ab3c8eac70c0bd534c5f1b33f8a3063
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2018-10-05 12:57:04 +02:00
parent 0c2101d816
commit f2411aa290
17 changed files with 4 additions and 48 deletions

View File

@@ -69,8 +69,6 @@ ProjectExplorer::IDevice::Ptr IosDeviceFactory::create() const
bool IosDeviceFactory::canRestore(const QVariantMap &map) const
{
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*"))

View File

@@ -67,11 +67,6 @@ ProjectExplorer::IDevice::Ptr IosSimulatorFactory::create() const
return ProjectExplorer::IDevice::Ptr();
}
bool IosSimulatorFactory::canRestore(const QVariantMap &map) const
{
return ProjectExplorer::IDevice::typeFromMap(map) == deviceType();
}
ProjectExplorer::IDevice::Ptr IosSimulatorFactory::restore(const QVariantMap &map) const
{
QTC_ASSERT(canRestore(map), return ProjectExplorer::IDevice::Ptr());

View File

@@ -41,7 +41,6 @@ public:
bool canCreate() const override;
ProjectExplorer::IDevice::Ptr create() const override;
bool canRestore(const QVariantMap &map) const override;
ProjectExplorer::IDevice::Ptr restore(const QVariantMap &map) const override;
};