summaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
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)
{