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:
hjk
2024-08-01 12:52:36 +02:00
parent 54333873f4
commit b6eff1b9cf
13 changed files with 32 additions and 32 deletions

View File

@@ -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);

View File

@@ -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;