aboutsummaryrefslogtreecommitdiffstats
path: root/launcher/src
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2020-01-27 12:37:45 -0800
committerMatt Ranostay <matt.ranostay@konsulko.com>2020-01-27 15:10:03 -0800
commitaa8e593bf3d5138d007619048eeac0e4b9863b7a (patch)
treeceb504458987465fc29894f1320bc6abf68978e1 /launcher/src
parentac2557137950463ba3feec2a19ca26c81ee91cbe (diff)
launcher: remove unused DBus code artifactsicefish_8.99.5icefish/8.99.58.99.5
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 <matt.ranostay@konsulko.com>
Diffstat (limited to 'launcher/src')
-rw-r--r--launcher/src/appinfo.cpp33
-rw-r--r--launcher/src/appinfo.h5
-rw-r--r--launcher/src/applicationlauncher.cpp85
-rw-r--r--launcher/src/applicationlauncher.h55
-rw-r--r--launcher/src/applicationmodel.cpp12
-rw-r--r--launcher/src/main.cpp42
6 files changed, 7 insertions, 225 deletions
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 <QObject>
#include <QtCore/QSharedDataPointer>
-#include <QtDBus/QDBusArgument>
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<Private> 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 &current)
-{
- 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 <QtCore/QObject>
-
-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 &current);
-
-public slots:
- int launch(const QString &application);
- void setCurrent(const QString &current);
-
-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 <QtDBus/QDBusInterface>
-#include <QtDBus/QDBusReply>
+#include <QtCore/QFile>
+#include <QtCore/QJsonObject>
+#include <QtCore/QJsonDocument>
+#include <QtCore/QJsonArray>
-#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 <QGuiApplication>
#include <QCommandLineParser>
+#include <QtCore/QUrlQuery>
#include <QtGui/QGuiApplication>
#include <QtQml/QQmlApplicationEngine>
#include <QtQml/QQmlContext>
@@ -25,40 +26,16 @@
#include <QThread>
#include <qlibwindowmanager.h>
-#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<org::AGL::afm::user, Cleanup> 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<ApplicationModel>("AppModel", 1, 0, "ApplicationModel");
- // DBus
- qDBusRegisterMetaType<AppInfo>();
- qDBusRegisterMetaType<QList<AppInfo> >();
-
- 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();