diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-11-21 23:13:38 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-11-21 23:51:24 +0100 |
commit | 1d713d9e2dbaf27de9da087f9270d260dfc40c31 (patch) | |
tree | 666d8edd42e44df3eaa674a35b6e938b99c2f4b4 /examples/dummyresource | |
parent | 0adba61a00491b96dadaa6d4719cb46831356222 (diff) | |
download | sink-1d713d9e2dbaf27de9da087f9270d260dfc40c31.tar.gz sink-1d713d9e2dbaf27de9da087f9270d260dfc40c31.zip |
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?)
Diffstat (limited to 'examples/dummyresource')
-rw-r--r-- | examples/dummyresource/resourcefactory.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/dummyresource/resourcefactory.cpp b/examples/dummyresource/resourcefactory.cpp index 46e67f3..f5ab2d9 100644 --- a/examples/dummyresource/resourcefactory.cpp +++ b/examples/dummyresource/resourcefactory.cpp | |||
@@ -126,13 +126,14 @@ class DummySynchronizer : public Sink::Synchronizer { | |||
126 | }); | 126 | }); |
127 | } | 127 | } |
128 | 128 | ||
129 | bool canReplay(const QByteArray &type, const QByteArray &key, const QByteArray &value) Q_DECL_OVERRIDE { return false; } | ||
130 | |||
129 | }; | 131 | }; |
130 | 132 | ||
131 | DummyResource::DummyResource(const Sink::ResourceContext &resourceContext, const QSharedPointer<Sink::Pipeline> &pipeline) | 133 | DummyResource::DummyResource(const Sink::ResourceContext &resourceContext, const QSharedPointer<Sink::Pipeline> &pipeline) |
132 | : Sink::GenericResource(resourceContext, pipeline) | 134 | : Sink::GenericResource(resourceContext, pipeline) |
133 | { | 135 | { |
134 | setupSynchronizer(QSharedPointer<DummySynchronizer>::create(resourceContext)); | 136 | setupSynchronizer(QSharedPointer<DummySynchronizer>::create(resourceContext)); |
135 | setupChangereplay(QSharedPointer<Sink::NullChangeReplay>::create(resourceContext)); | ||
136 | setupPreprocessors(ENTITY_TYPE_MAIL, | 137 | setupPreprocessors(ENTITY_TYPE_MAIL, |
137 | QVector<Sink::Preprocessor*>() << new MailPropertyExtractor); | 138 | QVector<Sink::Preprocessor*>() << new MailPropertyExtractor); |
138 | setupPreprocessors(ENTITY_TYPE_FOLDER, | 139 | setupPreprocessors(ENTITY_TYPE_FOLDER, |