diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-07-05 23:40:34 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-07-05 23:40:34 +0200 |
commit | 09fba6f07c87aec84c80ce65136f0b7333b0b0bd (patch) | |
tree | 4c55c16a69133659058953473ab8571da41b6aff /common/notifier.cpp | |
parent | 691a11e8865c43a3cadf8e64df0612a81b08bf15 (diff) | |
download | sink-09fba6f07c87aec84c80ce65136f0b7333b0b0bd.tar.gz sink-09fba6f07c87aec84c80ce65136f0b7333b0b0bd.zip |
Keep notifier alive for notifications of new resources.
Necessary to get notifications for newly created resources.
Diffstat (limited to 'common/notifier.cpp')
-rw-r--r-- | common/notifier.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/common/notifier.cpp b/common/notifier.cpp index 1af65e9..1b7cbdb 100644 --- a/common/notifier.cpp +++ b/common/notifier.cpp | |||
@@ -49,6 +49,7 @@ public: | |||
49 | 49 | ||
50 | QList<QSharedPointer<ResourceAccess>> resourceAccess; | 50 | QList<QSharedPointer<ResourceAccess>> resourceAccess; |
51 | QList<std::function<void(const Notification &)>> handler; | 51 | QList<std::function<void(const Notification &)>> handler; |
52 | QSharedPointer<Sink::ResultEmitter<QSharedPointer<Sink::ApplicationDomain::SinkResource> > > mResourceEmitter; | ||
52 | QObject context; | 53 | QObject context; |
53 | }; | 54 | }; |
54 | 55 | ||
@@ -91,6 +92,9 @@ Notifier::Notifier(const Sink::Query &resourceQuery) : d(new Sink::Notifier::Pri | |||
91 | SinkTraceCtx(resourceCtx) << "Resource query complete"; | 92 | SinkTraceCtx(resourceCtx) << "Resource query complete"; |
92 | }); | 93 | }); |
93 | emitter->fetch({}); | 94 | emitter->fetch({}); |
95 | if (resourceQuery.liveQuery()) { | ||
96 | d->mResourceEmitter = emitter; | ||
97 | } | ||
94 | result.first.exec(); | 98 | result.first.exec(); |
95 | } | 99 | } |
96 | 100 | ||