summaryrefslogtreecommitdiffstats
path: root/common/changereplay.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/changereplay.h')
-rw-r--r--common/changereplay.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/common/changereplay.h b/common/changereplay.h
index 88d6ce3..e86c4f2 100644
--- a/common/changereplay.h
+++ b/common/changereplay.h
@@ -24,6 +24,7 @@
24#include <Async/Async> 24#include <Async/Async>
25 25
26#include "storage.h" 26#include "storage.h"
27#include "resourcecontext.h"
27 28
28namespace Sink { 29namespace Sink {
29 30
@@ -38,7 +39,7 @@ class SINK_EXPORT ChangeReplay : public QObject
38{ 39{
39 Q_OBJECT 40 Q_OBJECT
40public: 41public:
41 ChangeReplay(const QByteArray &resourceName); 42 ChangeReplay(const ResourceContext &resourceContext);
42 43
43 qint64 getLastReplayedRevision(); 44 qint64 getLastReplayedRevision();
44 bool allChangesReplayed(); 45 bool allChangesReplayed();
@@ -53,20 +54,20 @@ public slots:
53protected: 54protected:
54 virtual KAsync::Job<void> replay(const QByteArray &type, const QByteArray &key, const QByteArray &value) = 0; 55 virtual KAsync::Job<void> replay(const QByteArray &type, const QByteArray &key, const QByteArray &value) = 0;
55 virtual bool canReplay(const QByteArray &type, const QByteArray &key, const QByteArray &value) = 0; 56 virtual bool canReplay(const QByteArray &type, const QByteArray &key, const QByteArray &value) = 0;
56 Sink::Storage mStorage; 57 Sink::Storage::DataStore mStorage;
57 58
58private: 59private:
59 void recordReplayedRevision(qint64 revision); 60 void recordReplayedRevision(qint64 revision);
60 KAsync::Job<void> replayNextRevision(); 61 KAsync::Job<void> replayNextRevision();
61 Sink::Storage mChangeReplayStore; 62 Sink::Storage::DataStore mChangeReplayStore;
62 bool mReplayInProgress; 63 bool mReplayInProgress;
63 Sink::Storage::Transaction mMainStoreTransaction; 64 Sink::Storage::DataStore::Transaction mMainStoreTransaction;
64}; 65};
65 66
66class NullChangeReplay : public ChangeReplay 67class NullChangeReplay : public ChangeReplay
67{ 68{
68public: 69public:
69 NullChangeReplay(const QByteArray &resourceName) : ChangeReplay(resourceName) {} 70 NullChangeReplay(const ResourceContext &resourceContext) : ChangeReplay(resourceContext) {}
70 KAsync::Job<void> replay(const QByteArray &type, const QByteArray &key, const QByteArray &value) Q_DECL_OVERRIDE { return KAsync::null<void>(); } 71 KAsync::Job<void> replay(const QByteArray &type, const QByteArray &key, const QByteArray &value) Q_DECL_OVERRIDE { return KAsync::null<void>(); }
71 bool canReplay(const QByteArray &type, const QByteArray &key, const QByteArray &value) Q_DECL_OVERRIDE { return false; } 72 bool canReplay(const QByteArray &type, const QByteArray &key, const QByteArray &value) Q_DECL_OVERRIDE { return false; }
72}; 73};