diff options
-rw-r--r-- | framework/qml/People.qml | 50 | ||||
-rw-r--r-- | framework/src/CMakeLists.txt | 3 | ||||
-rw-r--r-- | framework/src/domain/contactcontroller.cpp | 22 | ||||
-rw-r--r-- | framework/src/domain/contactcontroller.h | 6 |
4 files changed, 41 insertions, 40 deletions
diff --git a/framework/qml/People.qml b/framework/qml/People.qml index e60763d9..aa23a78d 100644 --- a/framework/qml/People.qml +++ b/framework/qml/People.qml | |||
@@ -272,11 +272,12 @@ Item { | |||
272 | leftMargin: Kube.Units.largeSpacing | 272 | leftMargin: Kube.Units.largeSpacing |
273 | } | 273 | } |
274 | 274 | ||
275 | text: "CIO" | 275 | text: contactController.jobTitle |
276 | } | 276 | } |
277 | 277 | ||
278 | Rectangle { | 278 | Rectangle { |
279 | id: company | 279 | id: company |
280 | visible: contactController.company != "" | ||
280 | 281 | ||
281 | anchors { | 282 | anchors { |
282 | bottom: avatar.bottom | 283 | bottom: avatar.bottom |
@@ -306,7 +307,7 @@ Item { | |||
306 | leftMargin: Kube.Units.smallSpacing | 307 | leftMargin: Kube.Units.smallSpacing |
307 | } | 308 | } |
308 | 309 | ||
309 | text: "Sauerkraut AG" | 310 | text: contactController.company |
310 | } | 311 | } |
311 | } | 312 | } |
312 | } | 313 | } |
@@ -328,19 +329,6 @@ Item { | |||
328 | } | 329 | } |
329 | } | 330 | } |
330 | 331 | ||
331 | Row { | ||
332 | spacing: Kube.Units.smallSpacing | ||
333 | Kube.Label { text: "(alias)"} | ||
334 | Kube.Label { text: "test.testerson@gmail.com"; color: Kube.Colors.highlightColor } | ||
335 | Item { width: Kube.Units.smallSpacing; height: 1 } | ||
336 | } | ||
337 | |||
338 | Row { | ||
339 | spacing: Kube.Units.smallSpacing | ||
340 | Kube.Label { text: "(private)"} | ||
341 | Kube.Label { text: "test@gmail.com"; color: Kube.Colors.highlightColor } | ||
342 | Item { width: Kube.Units.smallSpacing; height: 1 } | ||
343 | } | ||
344 | } | 332 | } |
345 | 333 | ||
346 | Flow { | 334 | Flow { |
@@ -349,23 +337,15 @@ Item { | |||
349 | width: personPageRoot.width - Kube.Units.largeSpacing | 337 | width: personPageRoot.width - Kube.Units.largeSpacing |
350 | spacing: Kube.Units.smallSpacing | 338 | spacing: Kube.Units.smallSpacing |
351 | 339 | ||
352 | Row { | 340 | Repeater { |
353 | spacing: Kube.Units.smallSpacing | 341 | model: contactController.phoneNumbers |
354 | Kube.Label { text: "(inhouse)"} | 342 | |
355 | Kube.Label { text: "+49812324932"; opacity: 0.6 } | 343 | Row { |
356 | Item { width: Kube.Units.smallSpacing; height: 1 } | 344 | spacing: Kube.Units.smallSpacing |
357 | } | 345 | Kube.Label { text: "(main)" } |
358 | Row { | 346 | Kube.Label { text: modelData ; opacity: 0.6 } |
359 | spacing: Kube.Units.smallSpacing | 347 | Item { width: Kube.Units.smallSpacing; height: 1 } |
360 | Kube.Label { text: "(mobile)"} | 348 | } |
361 | Kube.Label { text: "+49812324932"; opacity: 0.6 } | ||
362 | Item { width: Kube.Units.smallSpacing; height: 1 } | ||
363 | } | ||
364 | Row { | ||
365 | spacing: Kube.Units.smallSpacing | ||
366 | Kube.Label { text: "(private)"} | ||
367 | Kube.Label { text: "+49812324932"; opacity: 0.6 } | ||
368 | Item { width: Kube.Units.smallSpacing; height: 1 } | ||
369 | } | 349 | } |
370 | } | 350 | } |
371 | 351 | ||
@@ -374,9 +354,9 @@ Item { | |||
374 | 354 | ||
375 | width: personPageRoot.width - Kube.Units.largeSpacing | 355 | width: personPageRoot.width - Kube.Units.largeSpacing |
376 | 356 | ||
377 | Kube.Label { text: "Albertstrasse 35a"} | 357 | Kube.Label { text: contactController.street } |
378 | Kube.Label { text: "81767 Teststadt"} | 358 | Kube.Label { text: contactController.city } |
379 | Kube.Label { text: "GERMANY" } | 359 | Kube.Label { text: contactController.country } |
380 | } | 360 | } |
381 | 361 | ||
382 | // Column { | 362 | // Column { |
diff --git a/framework/src/CMakeLists.txt b/framework/src/CMakeLists.txt index 0e6af2ce..1b92e8c3 100644 --- a/framework/src/CMakeLists.txt +++ b/framework/src/CMakeLists.txt | |||
@@ -6,6 +6,7 @@ find_package(KAsync CONFIG REQUIRED) | |||
6 | find_package(QGpgme CONFIG REQUIRED) | 6 | find_package(QGpgme CONFIG REQUIRED) |
7 | find_package(KF5Codecs CONFIG REQUIRED) | 7 | find_package(KF5Codecs CONFIG REQUIRED) |
8 | find_package(KF5Package CONFIG REQUIRED) | 8 | find_package(KF5Package CONFIG REQUIRED) |
9 | find_package(KF5Contacts CONFIG REQUIRED) | ||
9 | 10 | ||
10 | add_definitions("-Wall -std=c++0x -g") | 11 | add_definitions("-Wall -std=c++0x -g") |
11 | 12 | ||
@@ -42,7 +43,7 @@ set(SRCS | |||
42 | 43 | ||
43 | add_library(frameworkplugin SHARED ${SRCS}) | 44 | add_library(frameworkplugin SHARED ${SRCS}) |
44 | qt5_use_modules(frameworkplugin Core Quick Qml WebEngineWidgets Test) | 45 | qt5_use_modules(frameworkplugin Core Quick Qml WebEngineWidgets Test) |
45 | target_link_libraries(frameworkplugin sink kube_otp KF5::Codecs KF5::Package KAsync) | 46 | target_link_libraries(frameworkplugin sink kube_otp KF5::Codecs KF5::Package KF5::Contacts KAsync) |
46 | install(TARGETS frameworkplugin DESTINATION ${FRAMEWORK_INSTALL_DIR}) | 47 | install(TARGETS frameworkplugin DESTINATION ${FRAMEWORK_INSTALL_DIR}) |
47 | 48 | ||
48 | add_subdirectory(domain/mime/mimetreeparser) | 49 | add_subdirectory(domain/mime/mimetreeparser) |
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 | ||
diff --git a/framework/src/domain/contactcontroller.h b/framework/src/domain/contactcontroller.h index d1973d9c..fea42430 100644 --- a/framework/src/domain/contactcontroller.h +++ b/framework/src/domain/contactcontroller.h | |||
@@ -35,6 +35,12 @@ class ContactController : public Kube::Controller | |||
35 | //Interface properties | 35 | //Interface properties |
36 | KUBE_CONTROLLER_PROPERTY(QString, Name, name) | 36 | KUBE_CONTROLLER_PROPERTY(QString, Name, name) |
37 | KUBE_CONTROLLER_PROPERTY(QStringList, Emails, emails) | 37 | KUBE_CONTROLLER_PROPERTY(QStringList, Emails, emails) |
38 | KUBE_CONTROLLER_PROPERTY(QStringList, PhoneNumbers, phoneNumbers) | ||
39 | KUBE_CONTROLLER_PROPERTY(QString, Street, street) | ||
40 | KUBE_CONTROLLER_PROPERTY(QString, City, city) | ||
41 | KUBE_CONTROLLER_PROPERTY(QString, Country, country) | ||
42 | KUBE_CONTROLLER_PROPERTY(QString, Company, company) | ||
43 | KUBE_CONTROLLER_PROPERTY(QString, JobTitle, jobTitle) | ||
38 | 44 | ||
39 | KUBE_CONTROLLER_ACTION(save) | 45 | KUBE_CONTROLLER_ACTION(save) |
40 | 46 | ||