summaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2019-11-11 00:48:02 -0800
committerMatt Ranostay <matt.ranostay@konsulko.com>2019-11-11 00:48:02 -0800
commit15a79164e5bb3dd51185371a17d9ae8b48b40a85 (patch)
tree480c168c333917dd2688971601670cd1831f4661 /main.cpp
parent147fc413436c62abbf8f5f054ca49b3d390eefa2 (diff)
Switch from DBus interface to rewritten agl-service-nagivation binding via the libqtappfw wrapper interface. Bug-AGL: SPEC-2880 Change-Id: I4244de4db250af438dda6b6173940f6a49fe34f2 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/main.cpp b/main.cpp
index 77e910f..2f360f3 100644
--- a/main.cpp
+++ b/main.cpp
@@ -6,6 +6,7 @@
#include <libhomescreen.hpp>
#include <qlibwindowmanager.h>
+#include <navigation.h>
#define DEFAULT_CREDENTIALS_FILE "/etc/poikey"
@@ -40,6 +41,15 @@ int main(int argc, char *argv[], char *env[])
QString secret = QString(argv[2]);
std::string token = secret.toStdString();
+ QUrl bindingAddress;
+ bindingAddress.setScheme(QStringLiteral("ws"));
+ bindingAddress.setHost(QStringLiteral("localhost"));
+ bindingAddress.setPort(port);
+ bindingAddress.setPath(QStringLiteral("/api"));
+ QUrlQuery query;
+ query.addQueryItem(QStringLiteral("token"), secret);
+ bindingAddress.setQuery(query);
+
if (qwm->init(port, secret) != 0) {
exit(EXIT_FAILURE);
}
@@ -51,7 +61,7 @@ int main(int argc, char *argv[], char *env[])
qwm->set_event_handler(QLibWindowmanager::Event_SyncDraw, SyncDrawHandler);
- mainapp = new MainApp();
+ mainapp = new MainApp(new Navigation(bindingAddress));
hs->init(port, token.c_str());
@@ -61,13 +71,6 @@ int main(int argc, char *argv[], char *env[])
mainapp->setInfoScreen(true);
mainapp->setKeyboard(true);
- /* check naviapi */
- if (mainapp->CheckNaviApi(argc, argv) == false)
- {
- cerr << "Error: naviapi check failed" << endl;
- return -1;
- }
-
/* then, authenticate connexion to POI service: */
if (mainapp->AuthenticatePOI(credentialsFile) < 0)
{