summaryrefslogtreecommitdiffstats
path: root/common/synchronizer.cpp
diff options
context:
space:
mode:
authorRémi Nicole <nicole@kolabsystems.com>2018-05-03 09:45:45 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-05-03 09:47:35 +0200
commit41ba42150d4232807299214a6fcfa44c669489b0 (patch)
tree117ff2c2afbc5fa2170c7d56a55f80b7811be235 /common/synchronizer.cpp
parent7a166895a54c4037749229b9ec9d0c90d60987b5 (diff)
downloadsink-41ba42150d4232807299214a6fcfa44c669489b0.tar.gz
sink-41ba42150d4232807299214a6fcfa44c669489b0.zip
Implement replaying CalDAV events and calendars
Summary: Notes: - For calendars, only removal is implemented because: - There is no DavCollectionCreateJob, possibly because there can't be an empty DAV collection - DavCollectionModifyJob only allows modifying "properties", which we don't use (except for the name, if the name is considered a property) - Currently, modifying an item with Sink overrides the one on the server, even if the store is not up-to-date Reviewers: cmollekopf Tags: #sink Differential Revision: https://phabricator.kde.org/D12611
Diffstat (limited to 'common/synchronizer.cpp')
-rw-r--r--common/synchronizer.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/common/synchronizer.cpp b/common/synchronizer.cpp
index aa4f030..fa16002 100644
--- a/common/synchronizer.cpp
+++ b/common/synchronizer.cpp
@@ -632,6 +632,10 @@ KAsync::Job<void> Synchronizer::replay(const QByteArray &type, const QByteArray
632 job = replay(store().readEntity<ApplicationDomain::Contact>(key), operation, oldRemoteId, modifiedProperties); 632 job = replay(store().readEntity<ApplicationDomain::Contact>(key), operation, oldRemoteId, modifiedProperties);
633 } else if (type == ApplicationDomain::getTypeName<ApplicationDomain::Addressbook>()) { 633 } else if (type == ApplicationDomain::getTypeName<ApplicationDomain::Addressbook>()) {
634 job = replay(store().readEntity<ApplicationDomain::Addressbook>(key), operation, oldRemoteId, modifiedProperties); 634 job = replay(store().readEntity<ApplicationDomain::Addressbook>(key), operation, oldRemoteId, modifiedProperties);
635 } else if (type == ApplicationDomain::getTypeName<ApplicationDomain::Event>()) {
636 job = replay(store().readEntity<ApplicationDomain::Event>(key), operation, oldRemoteId, modifiedProperties);
637 } else if (type == ApplicationDomain::getTypeName<ApplicationDomain::Calendar>()) {
638 job = replay(store().readEntity<ApplicationDomain::Calendar>(key), operation, oldRemoteId, modifiedProperties);
635 } else { 639 } else {
636 SinkErrorCtx(mLogCtx) << "Replayed unknown type: " << type; 640 SinkErrorCtx(mLogCtx) << "Replayed unknown type: " << type;
637 } 641 }
@@ -688,6 +692,16 @@ KAsync::Job<QByteArray> Synchronizer::replay(const ApplicationDomain::Folder &,
688 return KAsync::null<QByteArray>(); 692 return KAsync::null<QByteArray>();
689} 693}
690 694
695KAsync::Job<QByteArray> Synchronizer::replay(const ApplicationDomain::Event &, Sink::Operation, const QByteArray &, const QList<QByteArray> &)
696{
697 return KAsync::null<QByteArray>();
698}
699
700KAsync::Job<QByteArray> Synchronizer::replay(const ApplicationDomain::Calendar &, Sink::Operation, const QByteArray &, const QList<QByteArray> &)
701{
702 return KAsync::null<QByteArray>();
703}
704
691bool Synchronizer::allChangesReplayed() 705bool Synchronizer::allChangesReplayed()
692{ 706{
693 if (!mSyncRequestQueue.isEmpty()) { 707 if (!mSyncRequestQueue.isEmpty()) {