From 90a8d33f7c17c802730fd9b978db0e32d28a7dff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Nicole?= Date: Sun, 6 May 2018 17:42:37 +0200 Subject: Implement Todo entity type Summary: Some notes: - Needed to specialize some flatbuffers related functions for serializing QStringList and int - Removed useless qWarnings in caldav test - Rename EventSynchronizer -> CalDAVSynchronizer since it also synchronizes Calendars and Todos (and more to come!) Reviewers: cmollekopf Tags: #sink Differential Revision: https://phabricator.kde.org/D12695 --- common/domain/typeimplementations.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'common/domain/typeimplementations.cpp') diff --git a/common/domain/typeimplementations.cpp b/common/domain/typeimplementations.cpp index 615c8e8..b584138 100644 --- a/common/domain/typeimplementations.cpp +++ b/common/domain/typeimplementations.cpp @@ -67,6 +67,10 @@ typedef IndexConfig > EventIndexConfig; +typedef IndexConfig + > TodoIndexConfig; + typedef IndexConfig > CalendarIndexConfig; @@ -218,6 +222,37 @@ void TypeImplementation::configure(IndexPropertyMapper &) } +void TypeImplementation::configure(TypeIndex &index) +{ + TodoIndexConfig::configure(index); +} + +QMap TypeImplementation::typeDatabases() +{ + return merge(QMap{{QByteArray{Todo::name} + ".main", 0}}, TodoIndexConfig::databases()); +} + +void TypeImplementation::configure(PropertyMapper &propertyMapper) +{ + SINK_REGISTER_SERIALIZER(propertyMapper, Todo, Uid, uid); + SINK_REGISTER_SERIALIZER(propertyMapper, Todo, Summary, summary); + SINK_REGISTER_SERIALIZER(propertyMapper, Todo, Description, description); + SINK_REGISTER_SERIALIZER(propertyMapper, Todo, CompletedDate, completedDate); + SINK_REGISTER_SERIALIZER(propertyMapper, Todo, DueDate, dueDate); + SINK_REGISTER_SERIALIZER(propertyMapper, Todo, StartDate, startDate); + SINK_REGISTER_SERIALIZER(propertyMapper, Todo, Status, status); + SINK_REGISTER_SERIALIZER(propertyMapper, Todo, Priority, priority); + SINK_REGISTER_SERIALIZER(propertyMapper, Todo, Categories, categories); + SINK_REGISTER_SERIALIZER(propertyMapper, Todo, Ical, ical); + SINK_REGISTER_SERIALIZER(propertyMapper, Todo, Calendar, calendar); +} + +void TypeImplementation::configure(IndexPropertyMapper &) +{ + +} + + void TypeImplementation::configure(TypeIndex &index) { CalendarIndexConfig::configure(index); -- cgit v1.2.3