Don't set missing model item values to default value from JSON object.
This commit is contained in:
@ -98,12 +98,16 @@ ModelItemValues JsonParser::jsonObjectToItemValues(const QJsonObject& itemJsonOb
|
||||
values.insert(keyValuePair.first, keyValuePair.second);
|
||||
}
|
||||
|
||||
QListIterator<UserRoles> i(USER_FACING_ROLES);
|
||||
while (i.hasNext()) {
|
||||
const UserRoles role = i.next();
|
||||
std::pair<int, QVariant> keyValuePair = getKeyValuePair(itemJsonObject, role);
|
||||
values.insert(keyValuePair.first, keyValuePair.second);
|
||||
for (auto iter = itemJsonObject.constBegin(), end = itemJsonObject.constEnd(); iter != end;
|
||||
++iter) {
|
||||
const QString roleName = iter.key();
|
||||
if (ROLE_NAMES.values().contains(roleName)) {
|
||||
const int role = ROLE_NAMES.key(roleName.toLatin1());
|
||||
std::pair<int, QVariant> keyValuePair = getKeyValuePair(itemJsonObject, role);
|
||||
values.insert(keyValuePair.first, keyValuePair.second);
|
||||
}
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user