summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2022-02-14 18:29:54 -0500
committerScott Murray <scott.murray@konsulko.com>2022-02-14 18:29:54 -0500
commitf932d6da561278df631d0f77ae496a46efe4750f (patch)
tree7afb38f4fb74244006ad7bb74394a97c095cfdc5 /app
parent3c8425ae606ea142f227fd7dc9c2bc01def384ad (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 "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 icon copied from the launcher source tree, and updated .pro files to install them. Bug-AGL: SPEC-4182 Change-Id: I7e519aa963f6f22a37d083b2743ad5d42ead9684 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Diffstat (limited to 'app')
-rw-r--r--app/app.pri4
-rw-r--r--app/app.pro17
-rw-r--r--app/main.cpp33
3 files changed, 12 insertions, 42 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 f497fee..d14bdb6 100644
--- a/app/app.pro
+++ b/app/app.pro
@@ -1,17 +1,18 @@
+TEMPLATE = app
TARGET = mediaplayer
-QT = quickcontrols2 websockets
+QT = qml quickcontrols2
+CONFIG += c++11 link_pkgconfig
-SOURCES = main.cpp
-
-CONFIG += link_pkgconfig
PKGCONFIG += qtappfw-mediaplayer
-CONFIG(release, debug|release) {
- QMAKE_POST_LINK = $(STRIP) --strip-unneeded $(TARGET)
-}
+SOURCES = main.cpp
RESOURCES += \
mediaplayer.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 d72c492..771ce3a 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -15,11 +15,7 @@
* limitations under the License.
*/
-#include <QtCore/QCommandLineParser>
#include <QtCore/QDebug>
-#include <QtCore/QDir>
-#include <QtCore/QStandardPaths>
-#include <QtCore/QUrlQuery>
#include <QtGui/QGuiApplication>
#include <QtQml/QQmlApplicationEngine>
#include <QtQml/QQmlContext>
@@ -34,39 +30,16 @@
int main(int argc, char *argv[])
{
QString graphic_role = QString("music");
-
QGuiApplication app(argc, argv);
QQuickStyle::setStyle("AGL");
QQmlApplicationEngine engine;
QQmlContext *context = engine.rootContext();
+ context->setContextProperty("AlbumArt", "");
+ context->setContextProperty("mediaplayer", new Mediaplayer(context));
- 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();
- 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);
- context->setContextProperty(QStringLiteral("bindingAddress"), bindingAddress);
-
- context->setContextProperty("AlbumArt", "");
- context->setContextProperty("mediaplayer", new Mediaplayer(bindingAddress, context));
+ engine.load(QUrl(QStringLiteral("qrc:/MediaPlayer.qml")));
- engine.load(QUrl(QStringLiteral("qrc:/MediaPlayer.qml")));
- }
return app.exec();
}