summaryrefslogtreecommitdiffstats
path: root/common/domain/typeimplementations.cpp
diff options
context:
space:
mode:
authorRémi Nicole <nicole@kolabsystems.com>2018-03-27 18:26:11 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-03-27 18:26:15 +0200
commit761328989492db9bd603c2d7f1134d20e485d2f6 (patch)
tree0e3b4517dd2000fb1cc2738bbb22a3e54dfffb6f /common/domain/typeimplementations.cpp
parent80afd7070f2d8e57cab2fe55fef611623fdb75f0 (diff)
downloadsink-761328989492db9bd603c2d7f1134d20e485d2f6.tar.gz
sink-761328989492db9bd603c2d7f1134d20e485d2f6.zip
Add CalDAV support
Summary: Notes: - Add a `webdavcommon` folder for WebDAV generic resource code - Move `davresource` to `carddaveresource` and make it use the WebDAV code - For now it tests the CalDAV resource directly on KolabNow (to be changed) - Only synchronization, not adding / changing / removing WebDAV collections or items (to be implemented) - Only events are currently supported (todo, freebusy, etc. are to be implemented but should be straightforward) Fixes T8224 Reviewers: cmollekopf Tags: #sink Maniphest Tasks: T8224 Differential Revision: https://phabricator.kde.org/D11741
Diffstat (limited to 'common/domain/typeimplementations.cpp')
-rw-r--r--common/domain/typeimplementations.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/common/domain/typeimplementations.cpp b/common/domain/typeimplementations.cpp
index 29da7ea..fe70d74 100644
--- a/common/domain/typeimplementations.cpp
+++ b/common/domain/typeimplementations.cpp
@@ -67,6 +67,11 @@ typedef IndexConfig<Event,
67 ValueIndex<Event::Uid> 67 ValueIndex<Event::Uid>
68 > EventIndexConfig; 68 > EventIndexConfig;
69 69
70typedef IndexConfig<Calendar,
71 ValueIndex<Calendar::Name>
72 > CalendarIndexConfig;
73
74
70 75
71void TypeImplementation<Mail>::configure(TypeIndex &index) 76void TypeImplementation<Mail>::configure(TypeIndex &index)
72{ 77{
@@ -201,7 +206,8 @@ void TypeImplementation<Event>::configure(PropertyMapper &propertyMapper)
201 SINK_REGISTER_SERIALIZER(propertyMapper, Event, Summary, summary); 206 SINK_REGISTER_SERIALIZER(propertyMapper, Event, Summary, summary);
202 SINK_REGISTER_SERIALIZER(propertyMapper, Event, Description, description); 207 SINK_REGISTER_SERIALIZER(propertyMapper, Event, Description, description);
203 SINK_REGISTER_SERIALIZER(propertyMapper, Event, Uid, uid); 208 SINK_REGISTER_SERIALIZER(propertyMapper, Event, Uid, uid);
204 SINK_REGISTER_SERIALIZER(propertyMapper, Event, Attachment, attachment); 209 SINK_REGISTER_SERIALIZER(propertyMapper, Event, StartTime, startTime);
210 SINK_REGISTER_SERIALIZER(propertyMapper, Event, Calendar, calendar);
205} 211}
206 212
207void TypeImplementation<Event>::configure(IndexPropertyMapper &) 213void TypeImplementation<Event>::configure(IndexPropertyMapper &)
@@ -209,3 +215,20 @@ void TypeImplementation<Event>::configure(IndexPropertyMapper &)
209 215
210} 216}
211 217
218
219void TypeImplementation<Calendar>::configure(TypeIndex &index)
220{
221 CalendarIndexConfig::configure(index);
222}
223
224QMap<QByteArray, int> TypeImplementation<Calendar>::typeDatabases()
225{
226 return merge(QMap<QByteArray, int>{{QByteArray{Calendar::name} + ".main", 0}}, CalendarIndexConfig::databases());
227}
228
229void TypeImplementation<Calendar>::configure(PropertyMapper &propertyMapper)
230{
231 SINK_REGISTER_SERIALIZER(propertyMapper, Calendar, Name, name);
232}
233
234void TypeImplementation<Calendar>::configure(IndexPropertyMapper &) {}