Added IdRole for the server generated UUID of the items.
This commit is contained in:
@ -55,12 +55,25 @@ QString ModelItem::toString() const {
|
||||
// result.append(value.toString());
|
||||
result.append(QString("%1: %2\n").arg(roleName, data(role).toString()));
|
||||
}
|
||||
|
||||
const UserRoles idRole = IdRole;
|
||||
QVariant idValue = data(idRole);
|
||||
if (!idValue.isNull()) {
|
||||
const QString idRoleName = ROLE_NAMES.value(idRole);
|
||||
result.append(QString("%1: %2\n").arg(idRoleName, idValue.toString()));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
QJsonObject ModelItem::toJsonObject() const {
|
||||
QJsonObject itemObject;
|
||||
// TODO add UUID and dates (entry, modification, end)
|
||||
const UserRoles idRole = IdRole;
|
||||
QVariant idValue = data(idRole);
|
||||
if (!idValue.isNull()) {
|
||||
const QString idRoleName = ROLE_NAMES.value(idRole);
|
||||
itemObject.insert(idRoleName, idValue.toString());
|
||||
}
|
||||
|
||||
QListIterator<UserRoles> i(USER_FACING_ROLES);
|
||||
while (i.hasNext()) {
|
||||
|
||||
Reference in New Issue
Block a user