summaryrefslogtreecommitdiffstats
path: root/navigation/navigation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'navigation/navigation.cpp')
-rw-r--r--navigation/navigation.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/navigation/navigation.cpp b/navigation/navigation.cpp
index e0078c2..e24df1a 100644
--- a/navigation/navigation.cpp
+++ b/navigation/navigation.cpp
@@ -20,22 +20,21 @@
#include "eventmessage.h"
#include "messagefactory.h"
#include "messageengine.h"
+#include "messageenginefactory.h"
#include "navigation.h"
Navigation::Navigation (QUrl &url, QObject * parent) :
- QObject(parent),
- m_mloop(nullptr)
+ QObject(parent)
{
- m_mloop = new MessageEngine(url);
- QObject::connect(m_mloop, &MessageEngine::connected, this, &Navigation::onConnected);
- QObject::connect(m_mloop, &MessageEngine::disconnected, this, &Navigation::onDisconnected);
- QObject::connect(m_mloop, &MessageEngine::messageReceived, this, &Navigation::onMessageReceived);
+ m_mloop = MessageEngineFactory::getInstance().getMessageEngine(url);
+ QObject::connect(m_mloop.get(), &MessageEngine::connected, this, &Navigation::onConnected);
+ QObject::connect(m_mloop.get(), &MessageEngine::disconnected, this, &Navigation::onDisconnected);
+ QObject::connect(m_mloop.get(), &MessageEngine::messageReceived, this, &Navigation::onMessageReceived);
}
Navigation::~Navigation()
{
- delete m_mloop;
}
void Navigation::sendWaypoint(double lat, double lon)