aboutsummaryrefslogtreecommitdiffstats
path: root/app/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'app/main.cpp')
-rw-r--r--app/main.cpp36
1 files changed, 5 insertions, 31 deletions
diff --git a/app/main.cpp b/app/main.cpp
index b2b9185..8a11239 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -15,8 +15,6 @@
* limitations under the License.
*/
-#include <qlibwindowmanager.h>
-#include <qlibhomescreen.h>
#include <string>
#include <QtCore/QDebug>
#include <QtCore/QCommandLineParser>
@@ -37,11 +35,16 @@ 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");
QCoreApplication::setApplicationName(graphic_role);
QCoreApplication::setApplicationVersion("0.1.0");
+
+ app.setDesktopFileName(graphic_role);
+
QCommandLineParser parser;
parser.addPositionalArgument("port", app.translate("main", "port for binding"));
parser.addPositionalArgument("secret", app.translate("main", "secret for binding"));
@@ -76,32 +79,6 @@ int main(int argc, char *argv[])
graphic_role.toStdString().c_str(),
port,
token.toStdString().c_str());
-
- // QLibWM
- QLibWindowmanager* qwmHandler = new QLibWindowmanager();
- int res;
- if((res = qwmHandler->init(port,token)) != 0){
- fprintf(stderr, "[navigation] init qlibwm err(%d)\n", res);
- return -1;
- }
- if((res = qwmHandler->requestSurface(graphic_role)) != 0) {
- fprintf(stderr, "[navigation] request surface err(%d)\n", res);
- return -1;
- }
- qwmHandler->set_event_handler(QLibWindowmanager::Event_SyncDraw,
- [qwmHandler, &graphic_role](json_object *object) {
- qwmHandler->endDraw(graphic_role);
- });
-
- // QLibHS
- QLibHomeScreen* qhsHandler = new QLibHomeScreen();
- qhsHandler->init(port, token.toStdString().c_str());
- qhsHandler->set_event_handler(QLibHomeScreen::Event_ShowWindow,
- [qwmHandler, &graphic_role](json_object *object){
- qDebug("Surface %s got showWindow\n", graphic_role.toStdString().c_str());
- qwmHandler->activateWindow(graphic_role);
- });
-
MarkerModel model;
context->setContextProperty("markerModel", &model);
@@ -109,9 +86,6 @@ int main(int argc, char *argv[])
context->setContextProperty("guidanceModule", &guidance);
engine.load(QUrl(QStringLiteral("qrc:/navigation.qml")));
- QObject *root = engine.rootObjects().first();
- QQuickWindow *window = qobject_cast<QQuickWindow *>(root);
- QObject::connect(window, SIGNAL(frameSwapped()), qwmHandler, SLOT(slotActivateSurface()));
return app.exec();
}