summaryrefslogtreecommitdiffstats
path: root/app/main.cpp
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2020-01-13 22:33:31 -0800
committerMatt Ranostay <matt.ranostay@konsulko.com>2020-01-17 11:00:22 -0800
commitbba7642118e223492bf5a82eb3fed04a59e34c2c (patch)
tree14a25a73fa3d2ffbffe9a7d9d384d105088ea16c /app/main.cpp
parentb3c59ba3cb5dd7ae849ff5666a948a4cc5c543cb (diff)
hvac: switch to libqtappfw access for websocket dataicefish_8.99.5icefish/8.99.58.99.5
Remove QML processing of websocket data from appfw, and replace with new libqtappfw support. Bug-AGL: SPEC-2984 Change-Id: I0a0a422f25359da48798d3ec5e9948247a83d98e Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'app/main.cpp')
-rw-r--r--app/main.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/main.cpp b/app/main.cpp
index 2fac9ae..38ccfe1 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -16,6 +16,7 @@
#include <QtAGLExtras/AGLApplication>
#include <QtQml/QQmlApplicationEngine>
+#include <hvac.h>
#include "translator.h"
@@ -24,6 +25,17 @@ int main(int argc, char *argv[])
AGLApplication app(argc, argv);
app.setApplicationName("HVAC");
app.setupApplicationRole("hvac");
+
+ QQmlApplicationEngine *engine = app.getQmlApplicationEngine();
+ QQmlContext *context = engine->rootContext();
+ QVariant v = context->contextProperty(QStringLiteral("bindingAddress"));
+ if(v.canConvert(QMetaType::QUrl)) {
+ QUrl bindingAddress = v.toUrl();
+ context->setContextProperty("hvac", new HVAC(bindingAddress));
+ } else {
+ qCritical("Cannot find bindingAddress property in context, SignalComposer unavailable");
+ }
+
qmlRegisterType<Translator>("Translator", 1, 0, "Translator");
app.load(QUrl(QStringLiteral("qrc:/HVAC.qml")));
return app.exec();