diff options
Diffstat (limited to 'common/changereplay.h')
-rw-r--r-- | common/changereplay.h | 11 |
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 | ||
28 | namespace Sink { | 29 | namespace Sink { |
29 | 30 | ||
@@ -38,7 +39,7 @@ class SINK_EXPORT ChangeReplay : public QObject | |||
38 | { | 39 | { |
39 | Q_OBJECT | 40 | Q_OBJECT |
40 | public: | 41 | public: |
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: | |||
53 | protected: | 54 | protected: |
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 | ||
58 | private: | 59 | private: |
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 | ||
66 | class NullChangeReplay : public ChangeReplay | 67 | class NullChangeReplay : public ChangeReplay |
67 | { | 68 | { |
68 | public: | 69 | public: |
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 | }; |