diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-08-02 20:18:24 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-08-02 20:18:24 +0200 |
commit | 471ba4cfbb161bbae0641fe26360c8218fa31ef1 (patch) | |
tree | 91889a6fe067b737982f55c1e52117db63c283a9 | |
parent | e6ce84ce09f41eef8bede863140521ba954afa75 (diff) | |
download | sink-471ba4cfbb161bbae0641fe26360c8218fa31ef1.tar.gz sink-471ba4cfbb161bbae0641fe26360c8218fa31ef1.zip |
Calendar color
-rw-r--r-- | common/domain/applicationdomaintype.cpp | 1 | ||||
-rw-r--r-- | common/domain/applicationdomaintype.h | 1 | ||||
-rw-r--r-- | common/domain/calendar.fbs | 1 | ||||
-rw-r--r-- | common/domain/typeimplementations.cpp | 1 | ||||
-rw-r--r-- | examples/caldavresource/CMakeLists.txt | 2 | ||||
-rw-r--r-- | examples/caldavresource/caldavresource.cpp | 2 |
6 files changed, 7 insertions, 1 deletions
diff --git a/common/domain/applicationdomaintype.cpp b/common/domain/applicationdomaintype.cpp index 9bc3d08..97bf9f2 100644 --- a/common/domain/applicationdomaintype.cpp +++ b/common/domain/applicationdomaintype.cpp | |||
@@ -163,6 +163,7 @@ SINK_REGISTER_PROPERTY(Todo, Calendar); | |||
163 | 163 | ||
164 | SINK_REGISTER_ENTITY(Calendar); | 164 | SINK_REGISTER_ENTITY(Calendar); |
165 | SINK_REGISTER_PROPERTY(Calendar, Name); | 165 | SINK_REGISTER_PROPERTY(Calendar, Name); |
166 | SINK_REGISTER_PROPERTY(Calendar, Color); | ||
166 | 167 | ||
167 | static const int foo = [] { | 168 | static const int foo = [] { |
168 | QMetaType::registerEqualsComparator<Reference>(); | 169 | QMetaType::registerEqualsComparator<Reference>(); |
diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h index 802efd8..7f214ba 100644 --- a/common/domain/applicationdomaintype.h +++ b/common/domain/applicationdomaintype.h | |||
@@ -394,6 +394,7 @@ SINK_EXPORT QDebug operator<< (QDebug d, const Contact::Email &); | |||
394 | struct SINK_EXPORT Calendar : public Entity { | 394 | struct SINK_EXPORT Calendar : public Entity { |
395 | SINK_ENTITY(Calendar, calendar); | 395 | SINK_ENTITY(Calendar, calendar); |
396 | SINK_PROPERTY(QString, Name, name); | 396 | SINK_PROPERTY(QString, Name, name); |
397 | SINK_PROPERTY(QByteArray, Color, color); | ||
397 | }; | 398 | }; |
398 | 399 | ||
399 | struct SINK_EXPORT Event : public Entity { | 400 | struct SINK_EXPORT Event : public Entity { |
diff --git a/common/domain/calendar.fbs b/common/domain/calendar.fbs index 9788539..375b9fb 100644 --- a/common/domain/calendar.fbs +++ b/common/domain/calendar.fbs | |||
@@ -2,6 +2,7 @@ namespace Sink.ApplicationDomain.Buffer; | |||
2 | 2 | ||
3 | table Calendar { | 3 | table Calendar { |
4 | name:string; | 4 | name:string; |
5 | color:string; | ||
5 | } | 6 | } |
6 | 7 | ||
7 | root_type Calendar; | 8 | root_type Calendar; |
diff --git a/common/domain/typeimplementations.cpp b/common/domain/typeimplementations.cpp index 2b2d2ac..bb3f455 100644 --- a/common/domain/typeimplementations.cpp +++ b/common/domain/typeimplementations.cpp | |||
@@ -269,6 +269,7 @@ QMap<QByteArray, int> TypeImplementation<Calendar>::typeDatabases() | |||
269 | void TypeImplementation<Calendar>::configure(PropertyMapper &propertyMapper) | 269 | void TypeImplementation<Calendar>::configure(PropertyMapper &propertyMapper) |
270 | { | 270 | { |
271 | SINK_REGISTER_SERIALIZER(propertyMapper, Calendar, Name, name); | 271 | SINK_REGISTER_SERIALIZER(propertyMapper, Calendar, Name, name); |
272 | SINK_REGISTER_SERIALIZER(propertyMapper, Calendar, Color, color); | ||
272 | } | 273 | } |
273 | 274 | ||
274 | void TypeImplementation<Calendar>::configure(IndexPropertyMapper &) {} | 275 | void TypeImplementation<Calendar>::configure(IndexPropertyMapper &) {} |
diff --git a/examples/caldavresource/CMakeLists.txt b/examples/caldavresource/CMakeLists.txt index d2859aa..d6e8408 100644 --- a/examples/caldavresource/CMakeLists.txt +++ b/examples/caldavresource/CMakeLists.txt | |||
@@ -6,7 +6,7 @@ find_package(KPimKDAV2 REQUIRED) | |||
6 | find_package(KF5CalendarCore REQUIRED) | 6 | find_package(KF5CalendarCore REQUIRED) |
7 | 7 | ||
8 | add_library(${PROJECT_NAME} SHARED caldavresource.cpp) | 8 | add_library(${PROJECT_NAME} SHARED caldavresource.cpp) |
9 | target_link_libraries(${PROJECT_NAME} sink_webdav_common sink Qt5::Core Qt5::Network KPim::KDAV2 | 9 | target_link_libraries(${PROJECT_NAME} sink_webdav_common sink Qt5::Core Qt5::Gui Qt5::Network KPim::KDAV2 |
10 | KF5::CalendarCore) | 10 | KF5::CalendarCore) |
11 | 11 | ||
12 | install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${SINK_RESOURCE_PLUGINS_PATH} RUNTIME DESTINATION ${SINK_RESOURCE_PLUGINS_PATH}) | 12 | install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${SINK_RESOURCE_PLUGINS_PATH} RUNTIME DESTINATION ${SINK_RESOURCE_PLUGINS_PATH}) |
diff --git a/examples/caldavresource/caldavresource.cpp b/examples/caldavresource/caldavresource.cpp index 8574575..df9ab52 100644 --- a/examples/caldavresource/caldavresource.cpp +++ b/examples/caldavresource/caldavresource.cpp | |||
@@ -30,6 +30,7 @@ | |||
30 | #include "facadefactory.h" | 30 | #include "facadefactory.h" |
31 | 31 | ||
32 | #include <KCalCore/ICalFormat> | 32 | #include <KCalCore/ICalFormat> |
33 | #include <QColor> | ||
33 | 34 | ||
34 | #define ENTITY_TYPE_EVENT "event" | 35 | #define ENTITY_TYPE_EVENT "event" |
35 | #define ENTITY_TYPE_TODO "todo" | 36 | #define ENTITY_TYPE_TODO "todo" |
@@ -61,6 +62,7 @@ protected: | |||
61 | 62 | ||
62 | Calendar localCalendar; | 63 | Calendar localCalendar; |
63 | localCalendar.setName(remoteCalendar.displayName()); | 64 | localCalendar.setName(remoteCalendar.displayName()); |
65 | localCalendar.setColor(remoteCalendar.color().name().toLatin1()); | ||
64 | 66 | ||
65 | createOrModify(ENTITY_TYPE_CALENDAR, rid, localCalendar, | 67 | createOrModify(ENTITY_TYPE_CALENDAR, rid, localCalendar, |
66 | /* mergeCriteria = */ QHash<QByteArray, Sink::Query::Comparator>{}); | 68 | /* mergeCriteria = */ QHash<QByteArray, Sink::Query::Comparator>{}); |