summaryrefslogtreecommitdiffstats
path: root/app/main.cpp
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2018-04-13 15:04:22 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2018-04-19 19:46:57 -0700
commit64ebadd869c77f90eaed25925f850d424cdbe666 (patch)
treee3e4345e3fe070a2ab94658d0bbc3d563d08559c /app/main.cpp
parent328590c4f42851e148ec670ebc137a6609b9f23c (diff)
settings: bluetooth: switch from qml websockets to libqtappfw
Initial support changeover to libqtappfw from qml websocket calls for agl-service-bluetooth service Bug-AGL: SPEC-1385 Change-Id: Iff434c386d19f737b76d6a92969ae131a3de8ebf Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'app/main.cpp')
-rw-r--r--app/main.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/app/main.cpp b/app/main.cpp
index 3b0d1e9..7ad569f 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -27,6 +27,7 @@
#include <QtQuickControls2/QQuickStyle>
#include <QQuickWindow>
#include <libhomescreen.hpp>
+#include <bluetooth.h>
#include <qlibwindowmanager.h>
class DBus : public QObject
@@ -72,14 +73,8 @@ int main(int argc, char *argv[])
}
int port = positionalArguments.takeFirst().toInt();
QString secret = positionalArguments.takeFirst();
- QUrl bindingAddress;
- bindingAddress.setScheme(QStringLiteral("http"));
- bindingAddress.setHost(QStringLiteral("localhost"));
- bindingAddress.setPort(port);
- bindingAddress.setPath(QStringLiteral("/api"));
QUrlQuery query;
query.addQueryItem(QStringLiteral("token"), secret);
- //bindingAddress.setQuery(query);
QUrl bindingAddressWS;
bindingAddressWS.setScheme(QStringLiteral("ws"));
@@ -88,7 +83,6 @@ int main(int argc, char *argv[])
bindingAddressWS.setPath(QStringLiteral("/api"));
bindingAddressWS.setQuery(query);
QQmlContext *context = engine.rootContext();
- context->setContextProperty(QStringLiteral("bindingAddress"), bindingAddress);
context->setContextProperty(QStringLiteral("bindingAddressWS"), bindingAddressWS);
std::string token = secret.toStdString();
@@ -146,6 +140,7 @@ int main(int argc, char *argv[])
DBus dbus;
engine.rootContext()->setContextProperty("dbus", &dbus);
+ engine.rootContext()->setContextProperty("bluetooth", new Bluetooth(bindingAddressWS));
engine.load(QUrl(QStringLiteral("qrc:/Settings.qml")));
QObject *root = engine.rootObjects().first();
QQuickWindow *window = qobject_cast<QQuickWindow *>(root);