forked from qt-creator/qt-creator
Handle IDeviceFactory restoring in base class
Change-Id: Idb892bcff6b91dbc11a8271915e5cc86d1669e74 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -38,6 +38,7 @@ IosDeviceFactory::IosDeviceFactory()
|
||||
setDisplayName(IosDevice::name());
|
||||
setCombinedIcon(":/ios/images/iosdevicesmall.png",
|
||||
":/ios/images/iosdevice.png");
|
||||
setConstructionFunction([] { return ProjectExplorer::IDevice::Ptr(new IosDevice); });
|
||||
}
|
||||
|
||||
bool IosDeviceFactory::canRestore(const QVariantMap &map) const
|
||||
@@ -49,14 +50,5 @@ bool IosDeviceFactory::canRestore(const QVariantMap &map) const
|
||||
return true;
|
||||
}
|
||||
|
||||
ProjectExplorer::IDevice::Ptr IosDeviceFactory::restore(const QVariantMap &map) const
|
||||
{
|
||||
IosDevice *newDev = new IosDevice;
|
||||
newDev->fromMap(map);
|
||||
// updating the active ones should be enough...
|
||||
//IosDeviceManager::instance()->updateInfo(newDev->uniqueDeviceID());
|
||||
return ProjectExplorer::IDevice::Ptr(newDev);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Ios
|
||||
|
||||
@@ -37,7 +37,6 @@ public:
|
||||
IosDeviceFactory();
|
||||
|
||||
bool canRestore(const QVariantMap &map) const override;
|
||||
ProjectExplorer::IDevice::Ptr restore(const QVariantMap &map) const override;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -40,14 +40,7 @@ IosSimulatorFactory::IosSimulatorFactory()
|
||||
setDisplayName(tr("iOS Simulator"));
|
||||
setCombinedIcon(":/ios/images/iosdevicesmall.png",
|
||||
":/ios/images/iosdevice.png");
|
||||
}
|
||||
|
||||
ProjectExplorer::IDevice::Ptr IosSimulatorFactory::restore(const QVariantMap &map) const
|
||||
{
|
||||
QTC_ASSERT(canRestore(map), return ProjectExplorer::IDevice::Ptr());
|
||||
const ProjectExplorer::IDevice::Ptr device = ProjectExplorer::IDevice::Ptr(new IosSimulator());
|
||||
device->fromMap(map);
|
||||
return device;
|
||||
setConstructionFunction([] { return ProjectExplorer::IDevice::Ptr(new IosSimulator()); });
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -35,8 +35,6 @@ class IosSimulatorFactory : public ProjectExplorer::IDeviceFactory
|
||||
Q_OBJECT
|
||||
public:
|
||||
IosSimulatorFactory();
|
||||
|
||||
ProjectExplorer::IDevice::Ptr restore(const QVariantMap &map) const override;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user