diff options
author | Matt Ranostay <matt.ranostay@konsulko.com> | 2018-04-13 15:04:22 -0700 |
---|---|---|
committer | Matt Ranostay <matt.ranostay@konsulko.com> | 2018-05-08 18:18:57 -0700 |
commit | 550a9bca3658852521dc6647ed0d8bd4101cf9a6 (patch) | |
tree | 8230a23575af76ead1cba79d29e214183a37b025 /app/main.cpp | |
parent | f71e7005a3ea85fdffa0ac88c33e5e48e7461a02 (diff) |
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.cpp | 9 |
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); |