From cbcb2e305fb02853234e5394c4202b1150026d81 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Fri, 2 Mar 2018 11:39:29 +0100 Subject: add listcontrollers for phoneNumbers and emails to the contact controller --- framework/src/domain/contactcontroller.cpp | 24 ++++++++++++++++++++++++ framework/src/domain/contactcontroller.h | 4 ++++ 2 files changed, 28 insertions(+) diff --git a/framework/src/domain/contactcontroller.cpp b/framework/src/domain/contactcontroller.cpp index bc536bf6..b9bb90c2 100644 --- a/framework/src/domain/contactcontroller.cpp +++ b/framework/src/domain/contactcontroller.cpp @@ -21,8 +21,32 @@ #include #include +class MailsController : public Kube::ListPropertyController +{ +public: + + MailsController() + : Kube::ListPropertyController{{"email"}} + { + } + +}; + +class PhonesController : public Kube::ListPropertyController +{ +public: + + PhonesController() + : Kube::ListPropertyController{{"number"}} + { + } + +}; + ContactController::ContactController() : Kube::Controller(), + controller_mails{new MailsController}, + controller_phones(new PhonesController), action_save{new Kube::ControllerAction{this, &ContactController::save}} { updateSaveAction(); diff --git a/framework/src/domain/contactcontroller.h b/framework/src/domain/contactcontroller.h index 72d8eee1..102f6bef 100644 --- a/framework/src/domain/contactcontroller.h +++ b/framework/src/domain/contactcontroller.h @@ -22,6 +22,7 @@ #include #include #include +#include #include "controller.h" @@ -43,6 +44,9 @@ class ContactController : public Kube::Controller KUBE_CONTROLLER_PROPERTY(QString, JobTitle, jobTitle) KUBE_CONTROLLER_PROPERTY(QByteArray, ImageData, imageData) + KUBE_CONTROLLER_LISTCONTROLLER(mails) + KUBE_CONTROLLER_LISTCONTROLLER(phones) + KUBE_CONTROLLER_ACTION(save) public: -- cgit v1.2.3