From 1d713d9e2dbaf27de9da087f9270d260dfc40c31 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 21 Nov 2016 23:13:38 +0100 Subject: Folded the SourceWriteback into the Synchronizer. By concentrating all communication to the source in one place we get rid of several oddities. * Quite a bit of duplication since both need access to the synchronizationStore and the source. * We currently have an akward locking in place because both classes access the ync store. This is not easier to resolve cleanly. * The live of resource implementers becomes easier. * An implementation could elect to not use changereplay and always do a full sync... (maybe?) --- examples/maildirresource/maildirresource.cpp | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'examples/maildirresource') diff --git a/examples/maildirresource/maildirresource.cpp b/examples/maildirresource/maildirresource.cpp index fc77315..fed18c4 100644 --- a/examples/maildirresource/maildirresource.cpp +++ b/examples/maildirresource/maildirresource.cpp @@ -28,7 +28,6 @@ #include "libmaildir/maildir.h" #include "inspection.h" #include "synchronizer.h" -#include "sourcewriteback.h" #include "facadefactory.h" #include "adaptorfactoryregistry.h" @@ -383,18 +382,6 @@ public: return job; } -public: - QString mMaildirPath; -}; - -class MaildirWriteback : public Sink::SourceWriteBack -{ -public: - MaildirWriteback(const Sink::ResourceContext &resourceContext) : Sink::SourceWriteBack(resourceContext) - { - - } - KAsync::Job replay(const ApplicationDomain::Mail &mail, Sink::Operation operation, const QByteArray &oldRemoteId, const QList &changedProperties) Q_DECL_OVERRIDE { if (operation == Sink::Operation_Creation) { @@ -453,9 +440,6 @@ MaildirResource::MaildirResource(const Sink::ResourceContext &resourceContext, c auto synchronizer = QSharedPointer::create(resourceContext); synchronizer->mMaildirPath = mMaildirPath; setupSynchronizer(synchronizer); - auto changereplay = QSharedPointer::create(resourceContext); - changereplay->mMaildirPath = mMaildirPath; - setupChangereplay(changereplay); setupPreprocessors(ENTITY_TYPE_MAIL, QVector() << new SpecialPurposeProcessor(resourceContext.resourceType, resourceContext.instanceId()) << new MaildirMimeMessageMover(resourceContext.instanceId(), mMaildirPath) << new MaildirMailPropertyExtractor); setupPreprocessors(ENTITY_TYPE_FOLDER, QVector() << new FolderPreprocessor(mMaildirPath)); -- cgit v1.2.3