From 0f888b18bf7e6eecc0a2aa5aaa015cf3b9c755be Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 27 Jun 2017 15:46:54 +0200 Subject: Photo support --- common/contactpreprocessor.cpp | 3 +++ common/domain/applicationdomaintype.cpp | 1 + common/domain/applicationdomaintype.h | 1 + common/domain/contact.fbs | 1 + common/domain/typeimplementations.cpp | 1 + 5 files changed, 7 insertions(+) (limited to 'common') diff --git a/common/contactpreprocessor.cpp b/common/contactpreprocessor.cpp index ac2c3bc..68a8acb 100644 --- a/common/contactpreprocessor.cpp +++ b/common/contactpreprocessor.cpp @@ -35,6 +35,9 @@ void updatedProperties(Sink::ApplicationDomain::Contact &contact, const KContact emails << Sink::ApplicationDomain::Contact::Email{Sink::ApplicationDomain::Contact::Email::Undefined, email}; } contact.setEmails(emails); + + const auto photo = addressee.photo().rawData(); + contact.setPhoto(photo); } ContactPropertyExtractor::~ContactPropertyExtractor() diff --git a/common/domain/applicationdomaintype.cpp b/common/domain/applicationdomaintype.cpp index 7ce80ee..3718f77 100644 --- a/common/domain/applicationdomaintype.cpp +++ b/common/domain/applicationdomaintype.cpp @@ -112,6 +112,7 @@ SINK_REGISTER_PROPERTY(Contact, Lastname); SINK_REGISTER_PROPERTY(Contact, Emails); SINK_REGISTER_PROPERTY(Contact, Vcard); SINK_REGISTER_PROPERTY(Contact, Addressbook); +SINK_REGISTER_PROPERTY(Contact, Photo); SINK_REGISTER_ENTITY(Addressbook); SINK_REGISTER_PROPERTY(Addressbook, Name); diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h index e5aa46e..602d54c 100644 --- a/common/domain/applicationdomaintype.h +++ b/common/domain/applicationdomaintype.h @@ -377,6 +377,7 @@ struct SINK_EXPORT Contact : public Entity { SINK_PROPERTY(QString, Lastname, lastname); SINK_PROPERTY(QList, Emails, emails); SINK_PROPERTY(QByteArray, Vcard, vcard); + SINK_PROPERTY(QByteArray, Photo, photo); SINK_REFERENCE_PROPERTY(Addressbook, Addressbook, addressbook); }; diff --git a/common/domain/contact.fbs b/common/domain/contact.fbs index d941d5a..e689756 100644 --- a/common/domain/contact.fbs +++ b/common/domain/contact.fbs @@ -13,6 +13,7 @@ table Contact { addressbook:string; emails: [ContactEmail]; vcard: string; + photo: string; } root_type Contact; diff --git a/common/domain/typeimplementations.cpp b/common/domain/typeimplementations.cpp index 40b0cfd..47a9cf7 100644 --- a/common/domain/typeimplementations.cpp +++ b/common/domain/typeimplementations.cpp @@ -153,6 +153,7 @@ void TypeImplementation::configure(PropertyMapper &propertyMapper) SINK_REGISTER_SERIALIZER(propertyMapper, Contact, Addressbook, addressbook); SINK_REGISTER_SERIALIZER(propertyMapper, Contact, Firstname, firstname); SINK_REGISTER_SERIALIZER(propertyMapper, Contact, Lastname, lastname); + SINK_REGISTER_SERIALIZER(propertyMapper, Contact, Photo, photo); } void TypeImplementation::configure(IndexPropertyMapper &) -- cgit v1.2.3