From 322a616573dfe52ee412573bd93fbc646b4ca008 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 4 May 2017 16:03:26 +0200 Subject: Properly hook up the sink fabric --- framework/src/fabric.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'framework/src/fabric.cpp') 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 @@ */ #include "fabric.h" +#include "sinkfabric.h" #include @@ -35,9 +36,18 @@ public: return bus; } + void bringUpDeps() + { + if (!mDepsUp) { + mDepsUp = true; + SinkFabric::instance(); + } + } + void registerListener(Listener *listener) { mListener << listener; + bringUpDeps(); } void unregisterListener(Listener *listener) @@ -47,6 +57,7 @@ public: void postMessage(const QString &id, const QVariantMap &message) { + bringUpDeps(); for (const auto &l : mListener) { l->notify(id, message); } @@ -54,6 +65,7 @@ public: private: QVector mListener; + bool mDepsUp = false; }; void Fabric::postMessage(const QString &id, const QVariantMap &msg) -- cgit v1.2.3