Commit 4d421aca authored by hjk's avatar hjk

Kits: Avoid some of the deprecated QString uses with Core::Id

Change-Id: I40f4a0ff63fd99ecb1a9d8a35f034b1a48d6de84
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 2d177eb7
......@@ -181,7 +181,7 @@ QList<IDevice::Ptr> DeviceManager::fromMap(const QVariantMap &map)
const QVariantMap defaultDevsMap = map.value(QLatin1String(DefaultDevicesKey)).toMap();
for (QVariantMap::ConstIterator it = defaultDevsMap.constBegin();
it != defaultDevsMap.constEnd(); ++it) {
d->defaultDevices.insert(Core::Id(it.key()), Core::Id(it.value().toString()));
d->defaultDevices.insert(Core::Id::fromString(it.key()), Core::Id::fromSetting(it.value()));
}
const QVariantList deviceList = map.value(QLatin1String(DeviceListKey)).toList();
foreach (const QVariant &v, deviceList) {
......@@ -203,7 +203,7 @@ QVariantMap DeviceManager::toMap() const
typedef QHash<Core::Id, Core::Id> TypeIdHash;
for (TypeIdHash::ConstIterator it = d->defaultDevices.constBegin();
it != d->defaultDevices.constEnd(); ++it) {
defaultDeviceMap.insert(it.key().toString(), it.value().toString());
defaultDeviceMap.insert(it.key().toString(), it.value().toSetting());
}
map.insert(QLatin1String(DefaultDevicesKey), defaultDeviceMap);
QVariantList deviceList;
......
......@@ -477,7 +477,7 @@ bool Kit::fromMap(const QVariantMap &data)
QVariantMap extra = data.value(QLatin1String(DATA_KEY)).toMap();
const QVariantMap::ConstIterator cend = extra.constEnd();
for (QVariantMap::ConstIterator it = extra.constBegin(); it != cend; ++it)
setValue(Id(it.key()), it.value());
setValue(Id::fromString(it.key()), it.value());
return true;
}
......
......@@ -355,11 +355,10 @@ KitManager::KitList KitManager::restoreKits(const Utils::FileName &fileName)
qPrintable(fileName.toUserOutput()), i);
}
}
const QString defaultId = data.value(QLatin1String(KIT_DEFAULT_KEY)).toString();
if (defaultId.isEmpty())
const Core::Id id = Core::Id::fromSetting(data.value(QLatin1String(KIT_DEFAULT_KEY)));
if (!id.isValid())
return result;
const Core::Id id = Core::Id(defaultId);
foreach (Kit *k, result.kits) {
if (k->id() == id) {
result.defaultKit = id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment