summaryrefslogtreecommitdiffstats
path: root/framework/src/fabric.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/fabric.cpp')
-rw-r--r--framework/src/fabric.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/framework/src/fabric.cpp b/framework/src/fabric.cpp
index b14ed55d..30d1ac51 100644
--- a/framework/src/fabric.cpp
+++ b/framework/src/fabric.cpp
@@ -18,6 +18,7 @@
18*/ 18*/
19 19
20#include "fabric.h" 20#include "fabric.h"
21#include "sinkfabric.h"
21 22
22#include <QDebug> 23#include <QDebug>
23 24
@@ -35,9 +36,18 @@ public:
35 return bus; 36 return bus;
36 } 37 }
37 38
39 void bringUpDeps()
40 {
41 if (!mDepsUp) {
42 mDepsUp = true;
43 SinkFabric::instance();
44 }
45 }
46
38 void registerListener(Listener *listener) 47 void registerListener(Listener *listener)
39 { 48 {
40 mListener << listener; 49 mListener << listener;
50 bringUpDeps();
41 } 51 }
42 52
43 void unregisterListener(Listener *listener) 53 void unregisterListener(Listener *listener)
@@ -47,6 +57,7 @@ public:
47 57
48 void postMessage(const QString &id, const QVariantMap &message) 58 void postMessage(const QString &id, const QVariantMap &message)
49 { 59 {
60 bringUpDeps();
50 for (const auto &l : mListener) { 61 for (const auto &l : mListener) {
51 l->notify(id, message); 62 l->notify(id, message);
52 } 63 }
@@ -54,6 +65,7 @@ public:
54 65
55private: 66private:
56 QVector<Listener*> mListener; 67 QVector<Listener*> mListener;
68 bool mDepsUp = false;
57}; 69};
58 70
59void Fabric::postMessage(const QString &id, const QVariantMap &msg) 71void Fabric::postMessage(const QString &id, const QVariantMap &msg)