diff options
author | Scott Murray <scott.murray@konsulko.com> | 2022-02-14 18:33:06 -0500 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2022-02-14 23:34:48 +0000 |
commit | e58b0382de8e665d64b8e3486022a6bcb0572823 (patch) | |
tree | dd171390bc873b9e6d41c5a7f8a7144b66bc7287 /app | |
parent | 9993095f758efb58ff9f311edfc1e160e24e8514 (diff) |
Update for app framework removalneedlefish_13.93.0needlefish/13.93.0marlin_12.93.0marlin/12.93.013.93.012.93.0
Changes:
- Remove the autobuild scripts and config.xml used by the app
framework widget build.
- Update the qmake files to just build a "settings" binary and
install it into /usr/bin by default.
- Remove the code in main.cpp that handled reading the WebSocket
command-line arguments and passing them to binding related
code.
- Add initial .desktop file, and updated .pro files to install
it. An icon will be added in a future update, as the launcher
did not previously provide one.
Bug-AGL: SPEC-4182
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: Icd7126b7ddd41dbf0793d28d31fa962f3a36acb1
Diffstat (limited to 'app')
-rw-r--r-- | app/app.pri | 4 | ||||
-rw-r--r-- | app/app.pro | 17 | ||||
-rw-r--r-- | app/main.cpp | 44 |
3 files changed, 19 insertions, 46 deletions
diff --git a/app/app.pri b/app/app.pri deleted file mode 100644 index 399d71f..0000000 --- a/app/app.pri +++ /dev/null @@ -1,4 +0,0 @@ -TEMPLATE = app -QMAKE_LFLAGS += "-Wl,--hash-style=gnu -Wl,--as-needed" - -DESTDIR = $${OUT_PWD}/../package/root/bin diff --git a/app/app.pro b/app/app.pro index 54be9ee..4d2bc87 100644 --- a/app/app.pro +++ b/app/app.pro @@ -1,17 +1,18 @@ +TEMPLATE = app TARGET = messaging -QT = quickcontrols2 +QT = qml quickcontrols2 +CONFIG += c++11 link_pkgconfig SOURCES = main.cpp -CONFIG += link_pkgconfig -PKGCONFIG += qtappfw-bt-map libafbwsc - -CONFIG(release, debug|release) { - QMAKE_POST_LINK = $(STRIP) --strip-unneeded $(TARGET) -} +PKGCONFIG += qtappfw-bt-map RESOURCES += \ Messaging.qrc \ images/images.qrc -include(app.pri) +target.path = /usr/bin +target.files += $${OUT_PWD}/$${TARGET} +target.CONFIG = no_check_exist executable + +INSTALLS += target diff --git a/app/main.cpp b/app/main.cpp index f76917b..e5b87ce 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -1,6 +1,6 @@ /* * Copyright (C) 2016 The Qt Company Ltd. - * Copyright (C) 2019,2020 Konsulko Group + * Copyright (C) 2019,2020,2022 Konsulko Group * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,8 +16,6 @@ */ #include <QtCore/QDebug> -#include <QtCore/QCommandLineParser> -#include <QtCore/QUrlQuery> #include <QtGui/QGuiApplication> #include <QtQml/QQmlApplicationEngine> #include <QtQml/QQmlContext> @@ -28,41 +26,19 @@ int main(int argc, char *argv[]) { - QString graphic_role = QString("messaging"); + QString graphic_role = QString("messaging"); - QGuiApplication app(argc, argv); - app.setDesktopFileName(graphic_role); + QGuiApplication app(argc, argv); + app.setDesktopFileName(graphic_role); - QQuickStyle::setStyle("AGL"); + QQuickStyle::setStyle("AGL"); - QQmlApplicationEngine engine; - - 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); - QStringList positionalArguments = parser.positionalArguments(); - - if (positionalArguments.length() == 2) { - int port = positionalArguments.takeFirst().toInt(); - QString secret = positionalArguments.takeFirst(); - 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); - QQmlContext *context = engine.rootContext(); - context->setContextProperty(QStringLiteral("bindingAddress"), bindingAddress); - Map *map = new Map(bindingAddress, context); + QQmlApplicationEngine engine; + QQmlContext *context = engine.rootContext(); + Map *map = new Map(context); context->setContextProperty("messaging", map); engine.load(QUrl(QStringLiteral("qrc:/Messaging.qml"))); - } - return app.exec(); + + return app.exec(); } |