summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vrátil <[email protected]>2017-08-23 01:33:38 +0200
committerDaniel Vrátil <[email protected]>2017-08-23 01:33:38 +0200
commit92ccb687e7f5946e4b21e379a97750a458288298 (patch)
treee5114f91e7f02744bd3cb4939421d97c1f17f52d
parent6059b174cd27028f17680cb43829f98a8bb26468 (diff)
Synchronize Google calendar color into collection attribute
The attribute is not yet recognized by KOrganizer, but at least the resource will be ready once it does.
-rw-r--r--resources/google/calendar/calendarresource.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/resources/google/calendar/calendarresource.cpp b/resources/google/calendar/calendarresource.cpp
index 53e752c..49095b3 100644
--- a/resources/google/calendar/calendarresource.cpp
+++ b/resources/google/calendar/calendarresource.cpp
@@ -24,6 +24,7 @@
#include <AkonadiCore/AttributeFactory>
#include <AkonadiCore/CollectionModifyJob>
#include <AkonadiCore/EntityDisplayAttribute>
+#include <AkonadiCore/CollectionColorAttribute>
#include <AkonadiCore/ItemFetchJob>
#include <AkonadiCore/ItemFetchScope>
#include <AkonadiCore/ItemModifyJob>
@@ -449,6 +450,9 @@ void CalendarResource::slotCollectionsRetrieved(KGAPI2::Job *job)
attr->setDisplayName(calendar->title());
attr->setIconName(QStringLiteral("view-calendar"));
+ auto colorAttr = collection.attribute<CollectionColorAttribute>(Collection::AddIfMissing);
+ colorAttr->setColor(calendar->backgroundColor());
+
DefaultReminderAttribute *reminderAttr = collection.attribute<DefaultReminderAttribute>(Collection::AddIfMissing);
reminderAttr->setReminders(calendar->defaultReminders());