forked from qt-creator/qt-creator
ProjectExplorer: Change IDevice::toMap signature
From Store toMap() to toMap(Store). More symmetric code on the user side and better in line with ProjectConfiguration/AspectContainer at the price of a few more lines in the base. Change-Id: I6069c96c250c1846e870879bcb52c58fdd806478 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -158,15 +158,15 @@ void IosDevice::fromMap(const Store &map)
|
||||
m_handler = Handler(map.value(kHandler).toInt());
|
||||
}
|
||||
|
||||
Store IosDevice::toMap() const
|
||||
void IosDevice::toMap(Store &map) const
|
||||
{
|
||||
Store res = IDevice::toMap();
|
||||
IDevice::toMap(map);
|
||||
|
||||
Store vMap;
|
||||
for (auto i = m_extraInfo.cbegin(), end = m_extraInfo.cend(); i != end; ++i)
|
||||
vMap.insert(keyFromString(i.key()), i.value());
|
||||
res.insert(Constants::EXTRA_INFO_KEY, variantFromStore(vMap));
|
||||
res.insert(kHandler, int(m_handler));
|
||||
return res;
|
||||
map.insert(Constants::EXTRA_INFO_KEY, variantFromStore(vMap));
|
||||
map.insert(kHandler, int(m_handler));
|
||||
}
|
||||
|
||||
QString IosDevice::deviceName() const
|
||||
@@ -354,8 +354,10 @@ void IosDeviceManager::deviceInfo(const QString &uid,
|
||||
skipUpdate = true;
|
||||
newDev = const_cast<IosDevice *>(iosDev);
|
||||
} else {
|
||||
Store store;
|
||||
iosDev->toMap(store);
|
||||
newDev = new IosDevice();
|
||||
newDev->fromMap(iosDev->toMap());
|
||||
newDev->fromMap(store);
|
||||
}
|
||||
} else {
|
||||
newDev = new IosDevice(uid);
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
|
||||
protected:
|
||||
void fromMap(const Utils::Store &map) final;
|
||||
Utils::Store toMap() const final;
|
||||
void toMap(Utils::Store &map) const final;
|
||||
|
||||
friend class IosDeviceFactory;
|
||||
friend class Ios::Internal::IosDeviceManager;
|
||||
|
||||
Reference in New Issue
Block a user