summaryrefslogtreecommitdiffstats
path: root/common/queryrunner.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-03-26 13:34:43 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-03-26 13:34:43 +0200
commitb334872e612433aee1284561fa247127bcdeeaf8 (patch)
treedb0c7761b50db385b68458d610d79d0e72207e8b /common/queryrunner.cpp
parent29f80e6e4d698217933b7bd2df90c08162416d3f (diff)
downloadsink-b334872e612433aee1284561fa247127bcdeeaf8.tar.gz
sink-b334872e612433aee1284561fa247127bcdeeaf8.zip
Avoid triggering a fetch when a resource disconnects
Diffstat (limited to 'common/queryrunner.cpp')
-rw-r--r--common/queryrunner.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/common/queryrunner.cpp b/common/queryrunner.cpp
index 73ccf6d..2c50fca 100644
--- a/common/queryrunner.cpp
+++ b/common/queryrunner.cpp
@@ -80,7 +80,11 @@ QueryRunner<DomainType>::QueryRunner(const Sink::Query &query, const Sink::Resou
80 mResourceAccess->open(); 80 mResourceAccess->open();
81 QObject::connect(mResourceAccess.data(), &Sink::ResourceAccess::revisionChanged, this, &QueryRunner::revisionChanged); 81 QObject::connect(mResourceAccess.data(), &Sink::ResourceAccess::revisionChanged, this, &QueryRunner::revisionChanged);
82 // open is not synchronous, so from the time when the initial query is started until we have started and connected to the resource, it's possible to miss updates. We therefore unconditionally try to fetch new entities once we are connected. 82 // open is not synchronous, so from the time when the initial query is started until we have started and connected to the resource, it's possible to miss updates. We therefore unconditionally try to fetch new entities once we are connected.
83 QObject::connect(mResourceAccess.data(), &Sink::ResourceAccess::ready, this, &QueryRunner::revisionChanged); 83 QObject::connect(mResourceAccess.data(), &Sink::ResourceAccess::ready, this, [this] (bool ready) {
84 if (ready) {
85 revisionChanged();
86 }
87 });
84 } 88 }
85 mResultProvider->onDone([this]() { 89 mResultProvider->onDone([this]() {
86 delete this; 90 delete this;