diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-07-19 13:14:31 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-09-15 16:14:19 +0200 |
commit | ae46ff86990c786060c6ebfe69cc3e7a6bb051a5 (patch) | |
tree | e5760578383ee4b347ed1afe260e6d6852d378d6 | |
parent | 19f3b3c0b38cb8a92da77e60491027b7c9b48a16 (diff) | |
download | sink-ae46ff86990c786060c6ebfe69cc3e7a6bb051a5.tar.gz sink-ae46ff86990c786060c6ebfe69cc3e7a6bb051a5.zip |
Don't nest calls too deep.
The old implementation would result in endlessly nested calls.
-rw-r--r-- | common/changereplay.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/common/changereplay.cpp b/common/changereplay.cpp index 4b7d593..638a30d 100644 --- a/common/changereplay.cpp +++ b/common/changereplay.cpp | |||
@@ -24,6 +24,8 @@ | |||
24 | #include "definitions.h" | 24 | #include "definitions.h" |
25 | #include "bufferutils.h" | 25 | #include "bufferutils.h" |
26 | 26 | ||
27 | #include <QTimer> | ||
28 | |||
27 | using namespace Sink; | 29 | using namespace Sink; |
28 | 30 | ||
29 | SINK_DEBUG_AREA("changereplay"); | 31 | SINK_DEBUG_AREA("changereplay"); |
@@ -102,7 +104,9 @@ KAsync::Job<void> ChangeReplay::replayNextRevision() | |||
102 | SinkTrace() << "Replayed until " << revision; | 104 | SinkTrace() << "Replayed until " << revision; |
103 | recordReplayedRevision(revision); | 105 | recordReplayedRevision(revision); |
104 | //replay until we're done | 106 | //replay until we're done |
105 | replayNextRevision().exec(); | 107 | QTimer::singleShot(0, this, [this]() { |
108 | replayNextRevision().exec(); | ||
109 | }); | ||
106 | }, | 110 | }, |
107 | [this, revision, recordReplayedRevision](int, QString) { | 111 | [this, revision, recordReplayedRevision](int, QString) { |
108 | SinkTrace() << "Change replay failed" << revision; | 112 | SinkTrace() << "Change replay failed" << revision; |