diff options
author | Michael Bohlender <michael.bohlender@kdemail.net> | 2017-03-19 20:59:33 +0100 |
---|---|---|
committer | Michael Bohlender <michael.bohlender@kdemail.net> | 2017-03-19 20:59:33 +0100 |
commit | dfc0042f5b22bf6aa873b10b25e5b661f1754ecf (patch) | |
tree | 725af4685ecb30a7ab24a7e3a7cf55d8e34351ee /framework/domain/peoplemodel.cpp | |
parent | 5b25db7bbfaa907e03fa3ec0b2675c17981b69b0 (diff) | |
download | kube-dfc0042f5b22bf6aa873b10b25e5b661f1754ecf.tar.gz kube-dfc0042f5b22bf6aa873b10b25e5b661f1754ecf.zip |
add firstname and lastname roles to peoplemodel, update ui to display them
Diffstat (limited to 'framework/domain/peoplemodel.cpp')
-rw-r--r-- | framework/domain/peoplemodel.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/framework/domain/peoplemodel.cpp b/framework/domain/peoplemodel.cpp index 7cc2f3fa..d33c6703 100644 --- a/framework/domain/peoplemodel.cpp +++ b/framework/domain/peoplemodel.cpp | |||
@@ -50,7 +50,9 @@ QHash< int, QByteArray > PeopleModel::roleNames() const | |||
50 | {Emails, "emails"}, | 50 | {Emails, "emails"}, |
51 | {Addressbook, "addressbook"}, | 51 | {Addressbook, "addressbook"}, |
52 | {Type, "type"}, | 52 | {Type, "type"}, |
53 | {DomainObject, "domainObject"} | 53 | {DomainObject, "domainObject"}, |
54 | {FirstName, "firstName"}, | ||
55 | {LastName, "lastName"} | ||
54 | }; | 56 | }; |
55 | return roles; | 57 | return roles; |
56 | } | 58 | } |
@@ -70,6 +72,10 @@ QVariant PeopleModel::data(const QModelIndex &idx, int role) const | |||
70 | return "contact"; | 72 | return "contact"; |
71 | case DomainObject: | 73 | case DomainObject: |
72 | return QVariant::fromValue(contact); | 74 | return QVariant::fromValue(contact); |
75 | case FirstName: | ||
76 | return "FIRSTNAME"; | ||
77 | case LastName: | ||
78 | return contact->getFn(); | ||
73 | } | 79 | } |
74 | return QSortFilterProxyModel::data(idx, role); | 80 | return QSortFilterProxyModel::data(idx, role); |
75 | } | 81 | } |