summaryrefslogtreecommitdiffstats
path: root/common/queryrunner.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/queryrunner.h')
-rw-r--r--common/queryrunner.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/common/queryrunner.h b/common/queryrunner.h
index e449570..52b5e2d 100644
--- a/common/queryrunner.h
+++ b/common/queryrunner.h
@@ -35,6 +35,16 @@ class QueryRunnerBase : public QObject
35public: 35public:
36 typedef std::function<void(Sink::ApplicationDomain::ApplicationDomainType &domainObject)> ResultTransformation; 36 typedef std::function<void(Sink::ApplicationDomain::ApplicationDomainType &domainObject)> ResultTransformation;
37 37
38 /// Disable query updates on revision change. Used for testing only.
39 void ignoreRevisionChanges(bool ignore) {
40 mIgnoreRevisionChanges = ignore;
41 }
42
43 /// Manually triger a revision change. Used for testing only.
44 void triggerRevisionChange() {
45 revisionChanged();
46 }
47
38protected: 48protected:
39 typedef std::function<KAsync::Job<void>()> QueryFunction; 49 typedef std::function<KAsync::Job<void>()> QueryFunction;
40 50
@@ -52,7 +62,9 @@ protected slots:
52 */ 62 */
53 void revisionChanged() 63 void revisionChanged()
54 { 64 {
55 run().exec(); 65 if (!mIgnoreRevisionChanges) {
66 run().exec();
67 }
56 } 68 }
57 69
58private: 70private:
@@ -65,6 +77,7 @@ private:
65 } 77 }
66 78
67 QueryFunction queryFunction; 79 QueryFunction queryFunction;
80 bool mIgnoreRevisionChanges{false};
68}; 81};
69 82
70/** 83/**