diff options
Diffstat (limited to 'common/domain')
-rw-r--r-- | common/domain/event.cpp | 5 | ||||
-rw-r--r-- | common/domain/event.h | 2 | ||||
-rw-r--r-- | common/domain/folder.cpp | 5 | ||||
-rw-r--r-- | common/domain/folder.h | 2 | ||||
-rw-r--r-- | common/domain/mail.cpp | 10 | ||||
-rw-r--r-- | common/domain/mail.h | 2 |
6 files changed, 26 insertions, 0 deletions
diff --git a/common/domain/event.cpp b/common/domain/event.cpp index a8098b7..10c92bb 100644 --- a/common/domain/event.cpp +++ b/common/domain/event.cpp | |||
@@ -50,3 +50,8 @@ void TypeImplementation<Event>::configure(WritePropertyMapper<BufferBuilder> &pr | |||
50 | propertyMapper.addMapping<Event::Uid>(&BufferBuilder::add_uid); | 50 | propertyMapper.addMapping<Event::Uid>(&BufferBuilder::add_uid); |
51 | propertyMapper.addMapping<Event::Attachment>(&BufferBuilder::add_attachment); | 51 | propertyMapper.addMapping<Event::Attachment>(&BufferBuilder::add_attachment); |
52 | } | 52 | } |
53 | |||
54 | void TypeImplementation<Event>::configure(IndexPropertyMapper &) | ||
55 | { | ||
56 | |||
57 | } | ||
diff --git a/common/domain/event.h b/common/domain/event.h index d85b9b3..b683f5f 100644 --- a/common/domain/event.h +++ b/common/domain/event.h | |||
@@ -26,6 +26,7 @@ template<typename T> | |||
26 | class ReadPropertyMapper; | 26 | class ReadPropertyMapper; |
27 | template<typename T> | 27 | template<typename T> |
28 | class WritePropertyMapper; | 28 | class WritePropertyMapper; |
29 | class IndexPropertyMapper; | ||
29 | 30 | ||
30 | class TypeIndex; | 31 | class TypeIndex; |
31 | 32 | ||
@@ -49,6 +50,7 @@ public: | |||
49 | static void configure(TypeIndex &); | 50 | static void configure(TypeIndex &); |
50 | static void configure(ReadPropertyMapper<Buffer> &); | 51 | static void configure(ReadPropertyMapper<Buffer> &); |
51 | static void configure(WritePropertyMapper<BufferBuilder> &); | 52 | static void configure(WritePropertyMapper<BufferBuilder> &); |
53 | static void configure(IndexPropertyMapper &indexPropertyMapper); | ||
52 | }; | 54 | }; |
53 | 55 | ||
54 | } | 56 | } |
diff --git a/common/domain/folder.cpp b/common/domain/folder.cpp index e6701ac..4bc2efb 100644 --- a/common/domain/folder.cpp +++ b/common/domain/folder.cpp | |||
@@ -51,3 +51,8 @@ void TypeImplementation<Folder>::configure(WritePropertyMapper<BufferBuilder> &p | |||
51 | propertyMapper.addMapping<Folder::Icon>(&BufferBuilder::add_icon); | 51 | propertyMapper.addMapping<Folder::Icon>(&BufferBuilder::add_icon); |
52 | propertyMapper.addMapping<Folder::SpecialPurpose>(&BufferBuilder::add_specialpurpose); | 52 | propertyMapper.addMapping<Folder::SpecialPurpose>(&BufferBuilder::add_specialpurpose); |
53 | } | 53 | } |
54 | |||
55 | void TypeImplementation<Folder>::configure(IndexPropertyMapper &) | ||
56 | { | ||
57 | |||
58 | } | ||
diff --git a/common/domain/folder.h b/common/domain/folder.h index 3c83794..f232ab5 100644 --- a/common/domain/folder.h +++ b/common/domain/folder.h | |||
@@ -24,6 +24,7 @@ template<typename T> | |||
24 | class ReadPropertyMapper; | 24 | class ReadPropertyMapper; |
25 | template<typename T> | 25 | template<typename T> |
26 | class WritePropertyMapper; | 26 | class WritePropertyMapper; |
27 | class IndexPropertyMapper; | ||
27 | 28 | ||
28 | class TypeIndex; | 29 | class TypeIndex; |
29 | 30 | ||
@@ -43,6 +44,7 @@ public: | |||
43 | static void configure(TypeIndex &); | 44 | static void configure(TypeIndex &); |
44 | static void configure(ReadPropertyMapper<Buffer> &); | 45 | static void configure(ReadPropertyMapper<Buffer> &); |
45 | static void configure(WritePropertyMapper<BufferBuilder> &); | 46 | static void configure(WritePropertyMapper<BufferBuilder> &); |
47 | static void configure(IndexPropertyMapper &indexPropertyMapper); | ||
46 | }; | 48 | }; |
47 | 49 | ||
48 | } | 50 | } |
diff --git a/common/domain/mail.cpp b/common/domain/mail.cpp index 8abe259..c1b0b34 100644 --- a/common/domain/mail.cpp +++ b/common/domain/mail.cpp | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "entitybuffer.h" | 27 | #include "entitybuffer.h" |
28 | #include "entity_generated.h" | 28 | #include "entity_generated.h" |
29 | #include "mail/threadindexer.h" | 29 | #include "mail/threadindexer.h" |
30 | #include "domainadaptor.h" | ||
30 | 31 | ||
31 | #include "mail_generated.h" | 32 | #include "mail_generated.h" |
32 | 33 | ||
@@ -53,6 +54,15 @@ void TypeImplementation<Mail>::configure(TypeIndex &index) | |||
53 | index.addSecondaryProperty<Mail::ThreadId, Mail::MessageId>(); | 54 | index.addSecondaryProperty<Mail::ThreadId, Mail::MessageId>(); |
54 | } | 55 | } |
55 | 56 | ||
57 | void TypeImplementation<Mail>::configure(IndexPropertyMapper &indexPropertyMapper) | ||
58 | { | ||
59 | indexPropertyMapper.addIndexLookupProperty<Mail::ThreadId>([](TypeIndex &index, const ApplicationDomain::BufferAdaptor &entity) { | ||
60 | auto messageId = entity.getProperty(Mail::MessageId::name); | ||
61 | auto thread = index.secondaryLookup<Mail::MessageId, Mail::ThreadId>(messageId); | ||
62 | Q_ASSERT(!thread.isEmpty()); | ||
63 | return thread.first(); | ||
64 | }); | ||
65 | } | ||
56 | 66 | ||
57 | void TypeImplementation<Mail>::configure(ReadPropertyMapper<Buffer> &propertyMapper) | 67 | void TypeImplementation<Mail>::configure(ReadPropertyMapper<Buffer> &propertyMapper) |
58 | { | 68 | { |
diff --git a/common/domain/mail.h b/common/domain/mail.h index c12976a..e052448 100644 --- a/common/domain/mail.h +++ b/common/domain/mail.h | |||
@@ -26,6 +26,7 @@ template<typename T> | |||
26 | class ReadPropertyMapper; | 26 | class ReadPropertyMapper; |
27 | template<typename T> | 27 | template<typename T> |
28 | class WritePropertyMapper; | 28 | class WritePropertyMapper; |
29 | class IndexPropertyMapper; | ||
29 | 30 | ||
30 | class TypeIndex; | 31 | class TypeIndex; |
31 | 32 | ||
@@ -44,6 +45,7 @@ public: | |||
44 | static void configure(TypeIndex &index); | 45 | static void configure(TypeIndex &index); |
45 | static void configure(ReadPropertyMapper<Buffer> &propertyMapper); | 46 | static void configure(ReadPropertyMapper<Buffer> &propertyMapper); |
46 | static void configure(WritePropertyMapper<BufferBuilder> &propertyMapper); | 47 | static void configure(WritePropertyMapper<BufferBuilder> &propertyMapper); |
48 | static void configure(IndexPropertyMapper &indexPropertyMapper); | ||
47 | }; | 49 | }; |
48 | 50 | ||
49 | } | 51 | } |