aboutsummaryrefslogtreecommitdiffstats
path: root/app/main.cpp
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2021-12-16 16:26:47 -0500
committerScott Murray <scott.murray@konsulko.com>2021-12-16 16:28:51 -0500
commit227a373c6cdc30793b8890b001c6802cffaefc99 (patch)
treec9b24b212c54c23fb703c6db8993ede2454cb3cc /app/main.cpp
parentfa3bd315abd8a710d7493e6ffb7b54c521632202 (diff)
Update for app framework removal
Changes: - Remove the autobuild scripts and config.xml used by the app framework widget build. - Update the qmake files to just build a "navigation" binary and install it into /usr/bin by default. Also update the jtalk and flite script installation. - Remove the code in main.cpp that handled reading the WebSocket command-line arguments and passing them to binding related code. Bug-AGL: SPEC-4182 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: If3eca7b12c3ac2605c32f9832220dc58406f7b4b
Diffstat (limited to 'app/main.cpp')
-rw-r--r--app/main.cpp32
1 files changed, 2 insertions, 30 deletions
diff --git a/app/main.cpp b/app/main.cpp
index 8a11239..62fe415 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -17,7 +17,6 @@
#include <string>
#include <QtCore/QDebug>
-#include <QtCore/QCommandLineParser>
#include <QtCore/QUrlQuery>
#include <QtCore/QSettings>
#include <QtGui/QGuiApplication>
@@ -34,9 +33,6 @@ int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QString graphic_role = QString("navigation");
- int port = 1700;
-
- QString token = "hello";
QCoreApplication::setOrganizationDomain("LinuxFoundation");
QCoreApplication::setOrganizationName("AutomotiveGradeLinux");
@@ -45,13 +41,6 @@ int main(int argc, char *argv[])
app.setDesktopFileName(graphic_role);
- QCommandLineParser parser;
- parser.addPositionalArgument("port", app.translate("main", "port for binding"));
- parser.addPositionalArgument("secret", app.translate("main", "secret for binding"));
- parser.addHelpOption();
- parser.addVersionOption();
- parser.process(app);
-
// Load qml
QQmlApplicationEngine engine;
QQmlContext *context = engine.rootContext();
@@ -59,26 +48,9 @@ int main(int argc, char *argv[])
File_Operation file;
context->setContextProperty("fileOperation", &file);
- QStringList positionalArguments = parser.positionalArguments();
- if (positionalArguments.length() == 2) {
- port = positionalArguments.takeFirst().toInt();
- token = positionalArguments.takeFirst();
- QUrl bindingAddress;
- bindingAddress.setScheme(QStringLiteral("ws"));
- bindingAddress.setHost(QStringLiteral("localhost"));
- bindingAddress.setPort(port);
- bindingAddress.setPath(QStringLiteral("/api"));
- QUrlQuery query;
- query.addQueryItem(QStringLiteral("token"), token);
- bindingAddress.setQuery(query);
+ Navigation *navigation = new Navigation(context);
+ context->setContextProperty("navigation", navigation);
- Navigation *navigation = new Navigation(bindingAddress, context);
- context->setContextProperty("navigation", navigation);
- }
- fprintf(stderr, "[navigation] app_name: %s, port: %d, token: %s.\n",
- graphic_role.toStdString().c_str(),
- port,
- token.toStdString().c_str());
MarkerModel model;
context->setContextProperty("markerModel", &model);