summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-06-27 15:46:54 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-06-27 15:46:54 +0200
commit0f888b18bf7e6eecc0a2aa5aaa015cf3b9c755be (patch)
treeb432fa73ca2ff072d67e964b56933e9f275b8a28 /common
parent3357b1473efa0ccfa06cb4c2f3ab387c33038274 (diff)
downloadsink-0f888b18bf7e6eecc0a2aa5aaa015cf3b9c755be.tar.gz
sink-0f888b18bf7e6eecc0a2aa5aaa015cf3b9c755be.zip
Photo support
Diffstat (limited to 'common')
-rw-r--r--common/contactpreprocessor.cpp3
-rw-r--r--common/domain/applicationdomaintype.cpp1
-rw-r--r--common/domain/applicationdomaintype.h1
-rw-r--r--common/domain/contact.fbs1
-rw-r--r--common/domain/typeimplementations.cpp1
5 files changed, 7 insertions, 0 deletions
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
35 emails << Sink::ApplicationDomain::Contact::Email{Sink::ApplicationDomain::Contact::Email::Undefined, email}; 35 emails << Sink::ApplicationDomain::Contact::Email{Sink::ApplicationDomain::Contact::Email::Undefined, email};
36 } 36 }
37 contact.setEmails(emails); 37 contact.setEmails(emails);
38
39 const auto photo = addressee.photo().rawData();
40 contact.setPhoto(photo);
38} 41}
39 42
40ContactPropertyExtractor::~ContactPropertyExtractor() 43ContactPropertyExtractor::~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);
112SINK_REGISTER_PROPERTY(Contact, Emails); 112SINK_REGISTER_PROPERTY(Contact, Emails);
113SINK_REGISTER_PROPERTY(Contact, Vcard); 113SINK_REGISTER_PROPERTY(Contact, Vcard);
114SINK_REGISTER_PROPERTY(Contact, Addressbook); 114SINK_REGISTER_PROPERTY(Contact, Addressbook);
115SINK_REGISTER_PROPERTY(Contact, Photo);
115 116
116SINK_REGISTER_ENTITY(Addressbook); 117SINK_REGISTER_ENTITY(Addressbook);
117SINK_REGISTER_PROPERTY(Addressbook, Name); 118SINK_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 {
377 SINK_PROPERTY(QString, Lastname, lastname); 377 SINK_PROPERTY(QString, Lastname, lastname);
378 SINK_PROPERTY(QList<Email>, Emails, emails); 378 SINK_PROPERTY(QList<Email>, Emails, emails);
379 SINK_PROPERTY(QByteArray, Vcard, vcard); 379 SINK_PROPERTY(QByteArray, Vcard, vcard);
380 SINK_PROPERTY(QByteArray, Photo, photo);
380 SINK_REFERENCE_PROPERTY(Addressbook, Addressbook, addressbook); 381 SINK_REFERENCE_PROPERTY(Addressbook, Addressbook, addressbook);
381}; 382};
382 383
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 {
13 addressbook:string; 13 addressbook:string;
14 emails: [ContactEmail]; 14 emails: [ContactEmail];
15 vcard: string; 15 vcard: string;
16 photo: string;
16} 17}
17 18
18root_type Contact; 19root_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<Contact>::configure(PropertyMapper &propertyMapper)
153 SINK_REGISTER_SERIALIZER(propertyMapper, Contact, Addressbook, addressbook); 153 SINK_REGISTER_SERIALIZER(propertyMapper, Contact, Addressbook, addressbook);
154 SINK_REGISTER_SERIALIZER(propertyMapper, Contact, Firstname, firstname); 154 SINK_REGISTER_SERIALIZER(propertyMapper, Contact, Firstname, firstname);
155 SINK_REGISTER_SERIALIZER(propertyMapper, Contact, Lastname, lastname); 155 SINK_REGISTER_SERIALIZER(propertyMapper, Contact, Lastname, lastname);
156 SINK_REGISTER_SERIALIZER(propertyMapper, Contact, Photo, photo);
156} 157}
157 158
158void TypeImplementation<Contact>::configure(IndexPropertyMapper &) 159void TypeImplementation<Contact>::configure(IndexPropertyMapper &)