diff options
author | Rémi Nicole <nicole@kolabsystems.com> | 2018-04-13 11:51:18 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-04-13 11:51:24 +0200 |
commit | cd81aed814286887911d99648d62bbb3c63e404c (patch) | |
tree | c98b6e65d56e5fff82ed8f8a431de47e149c38a1 /examples | |
parent | edbb4c9c82e34e90ad15ad151901e65c2c2cfb66 (diff) | |
download | sink-cd81aed814286887911d99648d62bbb3c63e404c.tar.gz sink-cd81aed814286887911d99648d62bbb3c63e404c.zip |
Change most of Event's properties to extracted properties
Summary: Fix T8485
Reviewers: cmollekopf
Reviewed By: cmollekopf
Tags: #sink
Maniphest Tasks: T8485
Differential Revision: https://phabricator.kde.org/D12106
Diffstat (limited to 'examples')
-rw-r--r-- | examples/caldavresource/caldavresource.cpp | 8 | ||||
-rw-r--r-- | examples/dummyresource/resourcefactory.cpp | 7 |
2 files changed, 7 insertions, 8 deletions
diff --git a/examples/caldavresource/caldavresource.cpp b/examples/caldavresource/caldavresource.cpp index 57f030b..6bf1a27 100644 --- a/examples/caldavresource/caldavresource.cpp +++ b/examples/caldavresource/caldavresource.cpp | |||
@@ -24,6 +24,7 @@ | |||
24 | #include "adaptorfactoryregistry.h" | 24 | #include "adaptorfactoryregistry.h" |
25 | #include "applicationdomaintype.h" | 25 | #include "applicationdomaintype.h" |
26 | #include "domainadaptor.h" | 26 | #include "domainadaptor.h" |
27 | #include "eventpreprocessor.h" | ||
27 | #include "facade.h" | 28 | #include "facade.h" |
28 | #include "facadefactory.h" | 29 | #include "facadefactory.h" |
29 | 30 | ||
@@ -76,11 +77,6 @@ protected: | |||
76 | auto remoteEvent = dynamic_cast<const KCalCore::Event &>(*incidence); | 77 | auto remoteEvent = dynamic_cast<const KCalCore::Event &>(*incidence); |
77 | 78 | ||
78 | Event localEvent; | 79 | Event localEvent; |
79 | localEvent.setUid(remoteEvent.uid()); | ||
80 | localEvent.setSummary(remoteEvent.summary()); | ||
81 | localEvent.setDescription(remoteEvent.description()); | ||
82 | localEvent.setStartTime(remoteEvent.dtStart()); | ||
83 | localEvent.setEndTime(remoteEvent.dtEnd()); | ||
84 | localEvent.setIcal(ical); | 80 | localEvent.setIcal(ical); |
85 | localEvent.setCalendar(calendarLocalId); | 81 | localEvent.setCalendar(calendarLocalId); |
86 | 82 | ||
@@ -119,7 +115,7 @@ CalDavResource::CalDavResource(const Sink::ResourceContext &context) | |||
119 | auto synchronizer = QSharedPointer<EventSynchronizer>::create(context); | 115 | auto synchronizer = QSharedPointer<EventSynchronizer>::create(context); |
120 | setupSynchronizer(synchronizer); | 116 | setupSynchronizer(synchronizer); |
121 | 117 | ||
122 | // setupPreprocessors(ENTITY_TYPE_EVENT, QVector<Sink::Preprocessor*>() << new EventPropertyExtractor); | 118 | setupPreprocessors(ENTITY_TYPE_EVENT, QVector<Sink::Preprocessor*>() << new EventPropertyExtractor); |
123 | } | 119 | } |
124 | 120 | ||
125 | CalDavResourceFactory::CalDavResourceFactory(QObject *parent) | 121 | CalDavResourceFactory::CalDavResourceFactory(QObject *parent) |
diff --git a/examples/dummyresource/resourcefactory.cpp b/examples/dummyresource/resourcefactory.cpp index cfce6e4..597bd95 100644 --- a/examples/dummyresource/resourcefactory.cpp +++ b/examples/dummyresource/resourcefactory.cpp | |||
@@ -55,9 +55,12 @@ class DummySynchronizer : public Sink::Synchronizer { | |||
55 | Sink::ApplicationDomain::Event::Ptr createEvent(const QByteArray &ridBuffer, const QMap<QString, QVariant> &data) | 55 | Sink::ApplicationDomain::Event::Ptr createEvent(const QByteArray &ridBuffer, const QMap<QString, QVariant> &data) |
56 | { | 56 | { |
57 | auto event = Sink::ApplicationDomain::Event::Ptr::create(); | 57 | auto event = Sink::ApplicationDomain::Event::Ptr::create(); |
58 | event->setSummary(data.value("summary").toString()); | 58 | event->setExtractedUid(data.value("uid").toString()); |
59 | event->setExtractedSummary(data.value("summary").toString()); | ||
60 | event->setExtractedDescription(data.value("description").toString()); | ||
61 | event->setExtractedStartTime(data.value("starttime").toDateTime()); | ||
62 | event->setExtractedEndTime(data.value("endtime").toDateTime()); | ||
59 | event->setProperty("remoteId", ridBuffer); | 63 | event->setProperty("remoteId", ridBuffer); |
60 | event->setDescription(data.value("description").toString()); | ||
61 | return event; | 64 | return event; |
62 | } | 65 | } |
63 | 66 | ||