diff --git a/src/personsmodel.h b/src/personsmodel.h --- a/src/personsmodel.h +++ b/src/personsmodel.h @@ -56,7 +56,8 @@ GroupsRole, ///groups QStringList - UserRole = Qt::UserRole + 0x1000 ///< in case it's needed to extend, use this one to start from + UserRole = Qt::UserRole + 0x1000, ///< in case it's needed to extend, use this one to start from + PhoneNumberRole }; Q_ENUM(Role) diff --git a/src/personsmodel.cpp b/src/personsmodel.cpp --- a/src/personsmodel.cpp +++ b/src/personsmodel.cpp @@ -123,6 +123,7 @@ roles.insert(PersonUriRole, "personUri"); roles.insert(PersonVCardRole, "personVCard"); roles.insert(ContactsVCardRole, "contactsVCard"); + roles.insert(PhoneNumberRole, "phoneNumber"); return roles; } @@ -188,6 +189,8 @@ return QVariant::fromValue(metacontacts[personIndex[personUri].row()].contacts()); case PersonsModel::GroupsRole: return person->customProperty(QStringLiteral("all-groups")); + case PersonsModel::PhoneNumberRole: + return person->customProperty(AbstractContact::PhoneNumberProperty); } return QVariant(); }