From aa8e593bf3d5138d007619048eeac0e4b9863b7a Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Mon, 27 Jan 2020 12:37:45 -0800 Subject: [PATCH] launcher: remove unused DBus code artifacts All accesses to control launching applications are now done via agl-service-homescreen/libhomescreen, and thus the unused DBus interface can be removed. Bug-AGL: SPEC-3137 Change-Id: I27f5afd89bd15eb50486e2546a730e40f016b05e Signed-off-by: Matt Ranostay --- interfaces/README.md | 10 -- interfaces/afm_user_daemon.xml | 52 ---------- interfaces/appframework.xml | 57 ----------- interfaces/include/afm_user_daemon.hpp | 21 ----- interfaces/include/appframework.hpp | 66 ------------- interfaces/interfaces.pri | 18 ---- interfaces/interfaces.pro | 60 ------------ interfaces/src/appframework.cpp | 167 --------------------------------- launcher.pro | 3 +- launcher/launcher.pro | 6 +- launcher/src/appinfo.cpp | 33 ------- launcher/src/appinfo.h | 5 +- launcher/src/applicationlauncher.cpp | 85 ----------------- launcher/src/applicationlauncher.h | 55 ----------- launcher/src/applicationmodel.cpp | 12 +-- launcher/src/main.cpp | 42 +-------- package/config.xml | 1 - 17 files changed, 9 insertions(+), 684 deletions(-) delete mode 100644 interfaces/README.md delete mode 100644 interfaces/afm_user_daemon.xml delete mode 100644 interfaces/appframework.xml delete mode 100644 interfaces/include/afm_user_daemon.hpp delete mode 100644 interfaces/include/appframework.hpp delete mode 100644 interfaces/interfaces.pri delete mode 100644 interfaces/interfaces.pro delete mode 100644 interfaces/src/appframework.cpp delete mode 100644 launcher/src/applicationlauncher.cpp delete mode 100644 launcher/src/applicationlauncher.h diff --git a/interfaces/README.md b/interfaces/README.md deleted file mode 100644 index 4a80a6c..0000000 --- a/interfaces/README.md +++ /dev/null @@ -1,10 +0,0 @@ -AGL launcher reference implementation - - -Build with QtCreator 3.5.1 - -AGL repo for source code: -https://gerrit.automotivelinux.org/gerrit/#/admin/projects/apps/launcher - -AGL repo for bitbake recipe: -https://gerrit.automotivelinux.org/gerrit/apps/launcher diff --git a/interfaces/afm_user_daemon.xml b/interfaces/afm_user_daemon.xml deleted file mode 100644 index 17b7d63..0000000 --- a/interfaces/afm_user_daemon.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/interfaces/appframework.xml b/interfaces/appframework.xml deleted file mode 100644 index ebc5088..0000000 --- a/interfaces/appframework.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/interfaces/include/afm_user_daemon.hpp b/interfaces/include/afm_user_daemon.hpp deleted file mode 100644 index b9a5321..0000000 --- a/interfaces/include/afm_user_daemon.hpp +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef AFM_USER_DAEMON_HPP -#define AFM_USER_DAEMON_HPP - - -#endif // AFM_USER_DAEMON_HPP diff --git a/interfaces/include/appframework.hpp b/interfaces/include/appframework.hpp deleted file mode 100644 index 98ec317..0000000 --- a/interfaces/include/appframework.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef APPFRAMEWORK_HPP -#define APPFRAMEWORK_HPP - -#include -#include - -class AppInfo -{ - Q_GADGET - Q_PROPERTY(QString id READ id) - Q_PROPERTY(QString version READ version) - Q_PROPERTY(int width READ width) - Q_PROPERTY(int height READ height) - Q_PROPERTY(QString name READ name) - Q_PROPERTY(QString description READ description) - Q_PROPERTY(QString shortname READ shortname) - Q_PROPERTY(QString author READ author) - Q_PROPERTY(QString iconPath READ iconPath) -public: - AppInfo(); - AppInfo(const AppInfo &other); - virtual ~AppInfo(); - AppInfo &operator =(const AppInfo &other); - void swap(AppInfo &other) { qSwap(d, other.d); } - - QString id() const; - QString version() const; - int width() const; - int height() const; - QString name() const; - QString description() const; - QString shortname() const; - QString author() const; - QString iconPath() const; - - void read(const QJsonObject &json); - - friend QDBusArgument &operator <<(QDBusArgument &argument, const AppInfo &appInfo); - friend const QDBusArgument &operator >>(const QDBusArgument &argument, AppInfo &appInfo); - -private: - class Private; - QSharedDataPointer d; -}; - -Q_DECLARE_SHARED(AppInfo) -Q_DECLARE_METATYPE(AppInfo) -Q_DECLARE_METATYPE(QList) - -#endif // APPFRAMEWORK_HPP diff --git a/interfaces/interfaces.pri b/interfaces/interfaces.pri deleted file mode 100644 index 07b9e6a..0000000 --- a/interfaces/interfaces.pri +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (C) 2016 The Qt Company Ltd. -# Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -INCLUDEPATH += $$PWD $$OUT_PWD/../interfaces/ - -LIBS += -L$$OUT_PWD/../interfaces/ -linterfaces diff --git a/interfaces/interfaces.pro b/interfaces/interfaces.pro deleted file mode 100644 index 281eeb8..0000000 --- a/interfaces/interfaces.pro +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -TEMPLATE = lib -TARGET = interfaces -QT = dbus -CONFIG += staticlib - -HEADERS += \ - include/appframework.hpp - -SOURCES += \ - src/appframework.cpp - -XMLSOURCES = \ - afm_user_daemon.xml \ - appframework.xml - -gen_adaptor_cpp.input = XMLSOURCES -gen_adaptor_cpp.commands = \ - qdbusxml2cpp -i include/${QMAKE_FILE_IN_BASE}.hpp -m -a ${QMAKE_FILE_IN_BASE}_adaptor ${QMAKE_FILE_IN}; \ - moc $$OUT_PWD/${QMAKE_FILE_IN_BASE}_adaptor.h -o $$OUT_PWD/${QMAKE_FILE_IN_BASE}_adaptor.moc -gen_adaptor_cpp.output = ${QMAKE_FILE_IN_BASE}_adaptor.cpp -gen_adaptor_cpp.variable_out = SOURCES -gen_adaptor_cpp.clean = ${QMAKE_FILE_IN_BASE}_adaptor.cpp - -gen_proxy_cpp.input = XMLSOURCES -gen_proxy_cpp.commands = \ - qdbusxml2cpp -i include/${QMAKE_FILE_IN_BASE}.hpp -m -p ${QMAKE_FILE_IN_BASE}_proxy ${QMAKE_FILE_IN}; \ - moc $$OUT_PWD/${QMAKE_FILE_IN_BASE}_proxy.h -o $$OUT_PWD/${QMAKE_FILE_IN_BASE}_proxy.moc -gen_proxy_cpp.output = ${QMAKE_FILE_IN_BASE}_proxy.cpp -gen_proxy_cpp.variable_out = SOURCES -gen_proxy_cpp.clean = ${QMAKE_FILE_IN_BASE}_proxy.cpp - -gen_adaptor_h.input = XMLSOURCES -gen_adaptor_h.commands = @echo Fake making the header for ${QMAKE_FILE_IN} -gen_adaptor_h.depends = ${QMAKE_FILE_IN_BASE}_adaptor.cpp -gen_adaptor_h.output = ${QMAKE_FILE_IN_BASE}_adaptor.h -gen_adaptor_h.clean = ${QMAKE_FILE_IN_BASE}_adaptor.h - -gen_proxy_h.input = XMLSOURCES -gen_proxy_h.commands = @echo Fake making the header for ${QMAKE_FILE_IN} -gen_proxy_h.depends = ${QMAKE_FILE_IN_BASE}_proxy.cpp -gen_proxy_h.output = ${QMAKE_FILE_IN_BASE}_proxy.h -gen_proxy_h.clean = ${QMAKE_FILE_IN_BASE}_proxy.h - -QMAKE_EXTRA_COMPILERS += gen_adaptor_cpp gen_proxy_cpp gen_adaptor_h gen_proxy_h - -DISTFILES += diff --git a/interfaces/src/appframework.cpp b/interfaces/src/appframework.cpp deleted file mode 100644 index 7420642..0000000 --- a/interfaces/src/appframework.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "include/appframework.hpp" - -#include - -class AppInfo::Private : public QSharedData -{ -public: - Private(); - Private(const Private &other); - - QString id; - QString version; - int width; - int height; - QString name; - QString description; - QString shortname; - QString author; - QString iconPath; -}; - -AppInfo::Private::Private() - : width(-1) - , height(-1) -{ -} - -AppInfo::Private::Private(const Private &other) - : QSharedData(other) - , id(other.id) - , version(other.version) - , width(other.width) - , height(other.height) - , name(other.name) - , description(other.description) - , shortname(other.shortname) - , author(other.author) - , iconPath(other.iconPath) -{ -} - -AppInfo::AppInfo() - : d(new Private) -{ -} - -AppInfo::AppInfo(const AppInfo &other) - : d(other.d) -{ -} - -AppInfo::~AppInfo() -{ -} - -AppInfo &AppInfo::operator =(const AppInfo &other) -{ - d = other.d; - return *this; -} - -QString AppInfo::id() const -{ - return d->id; -} - -QString AppInfo::version() const -{ - return d->version; -} - -int AppInfo::width() const -{ - return d->width; -} - -int AppInfo::height() const -{ - return d->height; -} - -QString AppInfo::name() const -{ - return d->name; -} - -QString AppInfo::description() const -{ - return d->description; -} - -QString AppInfo::shortname() const -{ - return d->shortname; -} - -QString AppInfo::author() const -{ - return d->author; -} - -QString AppInfo::iconPath() const -{ - return d->iconPath; -} - -void AppInfo::read(const QJsonObject &json) -{ - d->id = json["id"].toString(); - d->version = json["version"].toString(); - d->width = json["width"].toInt(); - d->height = json["height"].toInt(); - d->name = json["name"].toString(); - d->description = json["description"].toString(); - d->shortname = json["shortname"].toString(); - d->author = json["author"].toString(); - d->iconPath = json["iconPath"].toString(); -} - -QDBusArgument &operator <<(QDBusArgument &argument, const AppInfo &appInfo) -{ - argument.beginStructure(); - argument << appInfo.d->id; - argument << appInfo.d->version; - argument << appInfo.d->width; - argument << appInfo.d->height; - argument << appInfo.d->name; - argument << appInfo.d->description; - argument << appInfo.d->shortname; - argument << appInfo.d->author; - argument << appInfo.d->iconPath; - argument.endStructure(); - - return argument; -} - -const QDBusArgument &operator >>(const QDBusArgument &argument, AppInfo &appInfo) -{ - argument.beginStructure(); - argument >> appInfo.d->id; - argument >> appInfo.d->version; - argument >> appInfo.d->width; - argument >> appInfo.d->height; - argument >> appInfo.d->name; - argument >> appInfo.d->description; - argument >> appInfo.d->shortname; - argument >> appInfo.d->author; - argument >> appInfo.d->iconPath; - argument.endStructure(); - return argument; -} diff --git a/launcher.pro b/launcher.pro index e142b63..b68702e 100644 --- a/launcher.pro +++ b/launcher.pro @@ -16,9 +16,8 @@ TEMPLATE = subdirs load(configure) -SUBDIRS = interfaces \ +SUBDIRS = \ launcher \ package -launcher.depends = interfaces package.depends += launcher diff --git a/launcher/launcher.pro b/launcher/launcher.pro index e16e9ce..63c6704 100644 --- a/launcher/launcher.pro +++ b/launcher/launcher.pro @@ -15,22 +15,18 @@ TEMPLATE = app TARGET = launcher -QT = qml quick dbus websockets +QT = qml quick websockets CONFIG += c++11 link_pkgconfig DESTDIR = $${OUT_PWD}/../package/root/bin PKGCONFIG += qlibwindowmanager libhomescreen -include(../interfaces/interfaces.pri) - SOURCES += \ src/main.cpp \ src/applicationmodel.cpp \ src/appinfo.cpp \ - src/applicationlauncher.cpp \ src/homescreenhandler.cpp HEADERS += \ - src/applicationlauncher.h \ src/applicationmodel.h \ src/appinfo.h \ src/homescreenhandler.h diff --git a/launcher/src/appinfo.cpp b/launcher/src/appinfo.cpp index c55d94c..78c48ed 100644 --- a/launcher/src/appinfo.cpp +++ b/launcher/src/appinfo.cpp @@ -142,36 +142,3 @@ void AppInfo::read(const QJsonObject &json) d->author = json["author"].toString(); d->iconPath = json["iconPath"].toString(); } - -QDBusArgument &operator <<(QDBusArgument &argument, const AppInfo &appInfo) -{ - argument.beginStructure(); - argument << appInfo.d->id; - argument << appInfo.d->version; - argument << appInfo.d->width; - argument << appInfo.d->height; - argument << appInfo.d->name; - argument << appInfo.d->description; - argument << appInfo.d->shortname; - argument << appInfo.d->author; - argument << appInfo.d->iconPath; - argument.endStructure(); - - return argument; -} - -const QDBusArgument &operator >>(const QDBusArgument &argument, AppInfo &appInfo) -{ - argument.beginStructure(); - argument >> appInfo.d->id; - argument >> appInfo.d->version; - argument >> appInfo.d->width; - argument >> appInfo.d->height; - argument >> appInfo.d->name; - argument >> appInfo.d->description; - argument >> appInfo.d->shortname; - argument >> appInfo.d->author; - argument >> appInfo.d->iconPath; - argument.endStructure(); - return argument; -} diff --git a/launcher/src/appinfo.h b/launcher/src/appinfo.h index 052c5df..e1b97e6 100644 --- a/launcher/src/appinfo.h +++ b/launcher/src/appinfo.h @@ -19,8 +19,8 @@ #ifndef APPINFO_H #define APPINFO_H +#include #include -#include class AppInfo { @@ -54,9 +54,6 @@ public: void read(const QJsonObject &json); - friend QDBusArgument &operator <<(QDBusArgument &argument, const AppInfo &appInfo); - friend const QDBusArgument &operator >>(const QDBusArgument &argument, AppInfo &appInfo); - private: class Private; QSharedDataPointer d; diff --git a/launcher/src/applicationlauncher.cpp b/launcher/src/applicationlauncher.cpp deleted file mode 100644 index 19ea2e3..0000000 --- a/launcher/src/applicationlauncher.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2016 The Qt Company Ltd. - * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH - * Copyright (c) 2018 TOYOTA MOTOR CORPORATION - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "applicationlauncher.h" - -#include "afm_user_daemon_proxy.h" - -#include "hmi-debug.h" - -extern org::AGL::afm::user *afm_user_daemon_proxy; - -ApplicationLauncher::ApplicationLauncher(QObject *parent) - : QObject(parent) - , m_launching(false) - , m_timeout(new QTimer(this)) -{ - m_timeout->setInterval(3000); - m_timeout->setSingleShot(true); - connect(m_timeout, &QTimer::timeout, [&]() { - setLaunching(false); - }); - connect(this, &ApplicationLauncher::launchingChanged, [&](bool launching) { - if (launching) - m_timeout->start(); - else - m_timeout->stop(); - }); - connect(this, &ApplicationLauncher::currentChanged, [&]() { - setLaunching(false); - }); -} - -int ApplicationLauncher::launch(const QString &application) -{ - int result = -1; - HMI_DEBUG("launch","ApplicationLauncher launch %s.", application.toStdString().c_str()); - - result = afm_user_daemon_proxy->start(application).value().toInt(); - HMI_DEBUG("launch","ApplicationLauncher pid: %d.", result); - - if (result > 1) { - setLaunching(true); - } - - return result; -} - -bool ApplicationLauncher::isLaunching() const -{ - return m_launching; -} - -void ApplicationLauncher::setLaunching(bool launching) -{ - if (m_launching == launching) return; - m_launching = launching; - launchingChanged(launching); -} - -QString ApplicationLauncher::current() const -{ - return m_current; -} - -void ApplicationLauncher::setCurrent(const QString ¤t) -{ - if (m_current == current) return; - m_current = current; - emit currentChanged(current); -} diff --git a/launcher/src/applicationlauncher.h b/launcher/src/applicationlauncher.h deleted file mode 100644 index d205994..0000000 --- a/launcher/src/applicationlauncher.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2016 The Qt Company Ltd. - * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH - * Copyright (c) 2018 TOYOTA MOTOR CORPORATION - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef APPLICATIONLAUNCHER_H -#define APPLICATIONLAUNCHER_H - -#include - -class QTimer; - -class ApplicationLauncher : public QObject -{ - Q_OBJECT - Q_PROPERTY(bool launching READ isLaunching NOTIFY launchingChanged) - Q_PROPERTY(QString current READ current WRITE setCurrent NOTIFY currentChanged) -public: - explicit ApplicationLauncher(QObject *parent = NULL); - - bool isLaunching() const; - QString current() const; - -signals: - void newAppRequestsToBeVisible(int pid); - void launchingChanged(bool launching); - void currentChanged(const QString ¤t); - -public slots: - int launch(const QString &application); - void setCurrent(const QString ¤t); - -private: - void setLaunching(bool launching); - -private: - bool m_launching; - QString m_current; - QTimer *m_timeout; -}; - -#endif // APPLICATIONLAUNCHER_H diff --git a/launcher/src/applicationmodel.cpp b/launcher/src/applicationmodel.cpp index 261e43e..42982d5 100644 --- a/launcher/src/applicationmodel.cpp +++ b/launcher/src/applicationmodel.cpp @@ -19,14 +19,12 @@ #include "applicationmodel.h" #include "appinfo.h" -#include "hmi-debug.h" - -#include -#include +#include +#include +#include +#include -#include "afm_user_daemon_proxy.h" - -extern org::AGL::afm::user *afm_user_daemon_proxy; +#include "hmi-debug.h" class ApplicationModel::Private { diff --git a/launcher/src/main.cpp b/launcher/src/main.cpp index e550948..5a44cc7 100644 --- a/launcher/src/main.cpp +++ b/launcher/src/main.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -25,40 +26,16 @@ #include #include -#include "applicationlauncher.h" #include "applicationmodel.h" #include "appinfo.h" -#include "afm_user_daemon_proxy.h" #include "homescreenhandler.h" #include "hmi-debug.h" -// XXX: We want this DBus connection to be shared across the different -// QML objects, is there another way to do this, a nice way, perhaps? -org::AGL::afm::user *afm_user_daemon_proxy; - -namespace { - -struct Cleanup { - static inline void cleanup(org::AGL::afm::user *p) { - delete p; - afm_user_daemon_proxy = Q_NULLPTR; - } -}; - -} - int main(int argc, char *argv[]) { QString myname = QString("launcher"); QGuiApplication a(argc, argv); - // use launch process - QScopedPointer afm_user_daemon_proxy(new org::AGL::afm::user("org.AGL.afm.user", - "/org/AGL/afm/user", - QDBusConnection::sessionBus(), - 0)); - ::afm_user_daemon_proxy = afm_user_daemon_proxy.data(); - QCoreApplication::setOrganizationDomain("LinuxFoundation"); QCoreApplication::setOrganizationName("AutomotiveGradeLinux"); QCoreApplication::setApplicationName(myname); @@ -85,11 +62,6 @@ int main(int argc, char *argv[]) // import C++ class to QML qmlRegisterType("AppModel", 1, 0, "ApplicationModel"); - // DBus - qDBusRegisterMetaType(); - qDBusRegisterMetaType >(); - - ApplicationLauncher *launcher = new ApplicationLauncher(); QLibWindowmanager* layoutHandler = new QLibWindowmanager(); if(layoutHandler->init(port,token) != 0){ exit(EXIT_FAILURE); @@ -105,17 +77,6 @@ int main(int argc, char *argv[]) layoutHandler->endDraw(myname); }); - layoutHandler->set_event_handler(QLibWindowmanager::Event_Visible, [layoutHandler, launcher](json_object *object) { - QString label = QString(json_object_get_string( json_object_object_get(object, "drawing_name") )); - qDebug() << label; - QMetaObject::invokeMethod(launcher, "setCurrent", Qt::QueuedConnection, Q_ARG(QString, label == "HomeScreen" ? "Home" : label)); - }); - - layoutHandler->set_event_handler(QLibWindowmanager::Event_Invisible, [layoutHandler, launcher](json_object *object) { - const char* label = json_object_get_string( json_object_object_get(object, "drawing_name") ); - HMI_DEBUG("launch", "surface %s Event_Invisible", label); - }); - HomescreenHandler* homescreenHandler = new HomescreenHandler(); homescreenHandler->init(port, token.toStdString().c_str(), layoutHandler, myname); @@ -143,7 +104,6 @@ int main(int argc, char *argv[]) QQmlApplicationEngine engine; engine.rootContext()->setContextProperty(QStringLiteral("layoutHandler"), layoutHandler); engine.rootContext()->setContextProperty(QStringLiteral("homescreenHandler"), homescreenHandler); - engine.rootContext()->setContextProperty(QStringLiteral("launcher"), launcher); engine.rootContext()->setContextProperty(QStringLiteral("screenInfo"), &screenInfo); engine.load(QUrl(QStringLiteral("qrc:/Launcher.qml"))); homescreenHandler->getRunnables(); diff --git a/package/config.xml b/package/config.xml index 36de348..0bd4e51 100644 --- a/package/config.xml +++ b/package/config.xml @@ -13,7 +13,6 @@ - -- 2.16.6