diff options
author | 2022-07-29 12:12:07 +0200 | |
---|---|---|
committer | 2022-07-29 12:17:18 +0200 | |
commit | 2144b21544b8c871477574b896902f4159c74cae (patch) | |
tree | c2c57d112199507b3abddcc19354f7a8b35567d2 /app/main.cpp | |
parent | 54da9d4383a999d2dc2223e7e5215444e04c3f32 (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 "videoplayer" 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 setenv of QT_QUICK_CONTROLS_STYLE to "AGL" to get the AGL
styling used. This replaces a global environment variable
definition tied to the old app framework, and makes it more
obvious that the style is required for the app to properly
work.
- Remove MediaScaner based on QtWebSockets which was removed
from agl-demo-platform
Bug-AGL: SPEC-4182
Change-Id: I022217ffc42da41093a55120554237f95e3aa413
Signed-off-by: Vasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com>
Diffstat (limited to 'app/main.cpp')
-rw-r--r-- | app/main.cpp | 45 |
1 files changed, 3 insertions, 42 deletions
diff --git a/app/main.cpp b/app/main.cpp index 11b1230..db39a17 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -13,57 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include <QtQml/QQmlApplicationEngine> -#include <QtGui/QGuiApplication> +#include <QQmlApplicationEngine> +#include <QGuiApplication> #include <QDebug> -#include <QUrlQuery> -#include <QCommandLineParser> -#include <QtQml/QQmlContext> - int main(int argc, char *argv[]) { - - setenv("QT_QPA_PLATFORM", "wayland", 1); - int port; - QString token; - - QCommandLineParser parser; QGuiApplication app(argc, argv); - 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) { - port = positionalArguments.takeFirst().toInt(); - token = positionalArguments.takeFirst(); - qInfo() << "setting port:" << port << ", token:" << token; - } else { - qInfo() << "Need to specify port and token"; - exit(EXIT_FAILURE); - } - - 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); + setenv("QT_QUICK_CONTROLS_STYLE", "AGL", 1); QQmlApplicationEngine engine; - engine.rootContext()->setContextProperty(QStringLiteral("bindingAddress"), bindingAddress); engine.load(QUrl(QStringLiteral("qrc:/VideoPlayer.qml"))); return app.exec(); - } |