summaryrefslogtreecommitdiffstats
path: root/common/changereplay.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/changereplay.cpp')
-rw-r--r--common/changereplay.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/changereplay.cpp b/common/changereplay.cpp
index 6e58564..a0796eb 100644
--- a/common/changereplay.cpp
+++ b/common/changereplay.cpp
@@ -71,8 +71,10 @@ void ChangeReplay::recordReplayedRevision(qint64 revision)
71 71
72KAsync::Job<void> ChangeReplay::replayNextRevision() 72KAsync::Job<void> ChangeReplay::replayNextRevision()
73{ 73{
74 Q_ASSERT(!mReplayInProgress);
74 auto lastReplayedRevision = QSharedPointer<qint64>::create(0); 75 auto lastReplayedRevision = QSharedPointer<qint64>::create(0);
75 auto topRevision = QSharedPointer<qint64>::create(0); 76 auto topRevision = QSharedPointer<qint64>::create(0);
77 emit replayingChanges();
76 return KAsync::syncStart<void>([this, lastReplayedRevision, topRevision]() { 78 return KAsync::syncStart<void>([this, lastReplayedRevision, topRevision]() {
77 mReplayInProgress = true; 79 mReplayInProgress = true;
78 mMainStoreTransaction = mStorage.createTransaction(DataStore::ReadOnly, [](const Sink::Storage::DataStore::Error &error) { 80 mMainStoreTransaction = mStorage.createTransaction(DataStore::ReadOnly, [](const Sink::Storage::DataStore::Error &error) {
@@ -157,6 +159,7 @@ KAsync::Job<void> ChangeReplay::replayNextRevision()
157 emit changesReplayed(); 159 emit changesReplayed();
158 } else { 160 } else {
159 QTimer::singleShot(0, [this]() { 161 QTimer::singleShot(0, [this]() {
162 mReplayInProgress = false;
160 replayNextRevision().exec(); 163 replayNextRevision().exec();
161 }); 164 });
162 } 165 }
@@ -166,7 +169,6 @@ KAsync::Job<void> ChangeReplay::replayNextRevision()
166void ChangeReplay::revisionChanged() 169void ChangeReplay::revisionChanged()
167{ 170{
168 if (!mReplayInProgress) { 171 if (!mReplayInProgress) {
169 emit replayingChanges();
170 replayNextRevision().exec(); 172 replayNextRevision().exec();
171 } 173 }
172} 174}