diff options
Diffstat (limited to 'framework/src/domain/contactcontroller.cpp')
-rw-r--r-- | framework/src/domain/contactcontroller.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/framework/src/domain/contactcontroller.cpp b/framework/src/domain/contactcontroller.cpp index 49f78b40..90ef6323 100644 --- a/framework/src/domain/contactcontroller.cpp +++ b/framework/src/domain/contactcontroller.cpp | |||
@@ -19,6 +19,7 @@ | |||
19 | #include "contactcontroller.h" | 19 | #include "contactcontroller.h" |
20 | 20 | ||
21 | #include <sink/applicationdomaintype.h> | 21 | #include <sink/applicationdomaintype.h> |
22 | #include <KContacts/VCardConverter> | ||
22 | 23 | ||
23 | ContactController::ContactController() | 24 | ContactController::ContactController() |
24 | : Kube::Controller(), | 25 | : Kube::Controller(), |
@@ -40,11 +41,24 @@ void ContactController::loadContact(const QVariant &contact) | |||
40 | { | 41 | { |
41 | if (auto c = contact.value<Sink::ApplicationDomain::Contact::Ptr>()) { | 42 | if (auto c = contact.value<Sink::ApplicationDomain::Contact::Ptr>()) { |
42 | setName(c->getFn()); | 43 | setName(c->getFn()); |
43 | QStringList emails; | 44 | const auto &vcard = c->getVcard(); |
44 | for (const auto &e : c->getEmails()) { | 45 | KContacts::VCardConverter converter; |
45 | emails << e.email; | 46 | const auto addressee = converter.parseVCard(vcard); |
47 | setEmails(addressee.emails()); | ||
48 | QStringList numbers; | ||
49 | for (const auto &n : addressee.phoneNumbers()) { | ||
50 | numbers << n.number(); | ||
46 | } | 51 | } |
47 | setEmails(emails); | 52 | setPhoneNumbers(numbers); |
53 | |||
54 | for(const auto &a :addressee.addresses()) { | ||
55 | setStreet(a.street()); | ||
56 | setCity(a.locality()); | ||
57 | setCountry(a.country()); | ||
58 | break; | ||
59 | } | ||
60 | setCompany(addressee.organization()); | ||
61 | setJobTitle(addressee.role()); | ||
48 | } | 62 | } |
49 | } | 63 | } |
50 | 64 | ||