summaryrefslogtreecommitdiffstats
path: root/voice-capabilities/guimetadata.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'voice-capabilities/guimetadata.cpp')
-rw-r--r--voice-capabilities/guimetadata.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/voice-capabilities/guimetadata.cpp b/voice-capabilities/guimetadata.cpp
index 63d99fc..cc65ba0 100644
--- a/voice-capabilities/guimetadata.cpp
+++ b/voice-capabilities/guimetadata.cpp
@@ -21,22 +21,21 @@
#include "eventmessage.h"
#include "messagefactory.h"
#include "messageengine.h"
+#include "messageenginefactory.h"
#include "guimetadata.h"
GuiMetadata::GuiMetadata(QUrl &url, QQmlContext *context, QObject * parent) :
- QObject(parent),
- m_mloop(nullptr)
+ QObject(parent)
{
- m_mloop = new MessageEngine(url);
+ m_mloop = MessageEngineFactory::getInstance().getMessageEngine(url);
m_context = context;
- QObject::connect(m_mloop, &MessageEngine::connected, this, &GuiMetadata::onConnected);
- QObject::connect(m_mloop, &MessageEngine::disconnected, this, &GuiMetadata::onDisconnected);
- QObject::connect(m_mloop, &MessageEngine::messageReceived, this, &GuiMetadata::onMessageReceived);
+ QObject::connect(m_mloop.get(), &MessageEngine::connected, this, &GuiMetadata::onConnected);
+ QObject::connect(m_mloop.get(), &MessageEngine::disconnected, this, &GuiMetadata::onDisconnected);
+ QObject::connect(m_mloop.get(), &MessageEngine::messageReceived, this, &GuiMetadata::onMessageReceived);
}
GuiMetadata::~GuiMetadata()
{
- delete m_mloop;
}
// Qt UI Context