Using "model/metadata.h" for file and JSON object naming as well. Using all upper case for naming static meta data constants and functions.
This commit is contained in:
@ -26,7 +26,8 @@ QList<QHash<int, QVariant>> JsonParser::toItemValuesList(const QByteArray& jsonD
|
||||
QHash<int, QVariant> JsonParser::jsonObjectToItemValues(const QJsonObject& itemJsonObject) {
|
||||
QHash<int, QVariant> values;
|
||||
|
||||
// TODO make this more generic (by reading from model meta data)
|
||||
// TODO iterate over "public & editable" roles (the ones that should occur in JSON file)
|
||||
// & use a (static) function to retrieve it (i. e. getRoleValue(int role))
|
||||
values[NameRole] = itemJsonObject[ROLE_NAMES.value(NameRole)].toString();
|
||||
values[DescriptionRole] = itemJsonObject[ROLE_NAMES.value(DescriptionRole)].toString();
|
||||
values[InfoRole] = itemJsonObject[ROLE_NAMES.value(InfoRole)].toString();
|
||||
|
||||
Reference in New Issue
Block a user