summaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2019-11-11 00:48:02 -0800
committerScott Murray <scott.murray@konsulko.com>2019-11-27 23:39:00 +0000
commit477da952f98dda785c3a729dd297decc0503bb7f (patch)
treee5a195ad89ffd66faf4f85a94037c271836fb441 /main.cpp
parent3b1d243f8e46523890ca4bf4188b197734235f31 (diff)
poi-yelp: change to libqtappfw navigation interfacehalibut_8.0.4halibut/8.0.48.0.4
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)
{