diff options
author | zheng_wenlong <wenlong_zheng@nexty-ele.com> | 2018-08-06 12:05:59 +0900 |
---|---|---|
committer | zheng_wenlong <wenlong_zheng@nexty-ele.com> | 2018-08-06 12:06:32 +0900 |
commit | 5fbb59e80e4f870a1badd694d2efcd8cd941cdfb (patch) | |
tree | 5e0edd6c22ce8f2d49aa2e571a06b6961a2b7f24 | |
parent | e1877c0c7c2add1dba21e64394ba06365c796edd (diff) |
Use appid between homescreen-service and appsflounder_5.99.3flounder/5.99.35.99.3
Use appid between hss and apps, and check event destination in libhomescreen.
So these is no need compare code when recived Event_TapShortcut Event.
BUG-AGL: SPEC-1645
Change-Id: I02a87f289c6da0a86012fd304fb1f2d2452ee990
Signed-off-by: zheng_wenlong <wenlong_zheng@nexty-ele.com>
-rw-r--r-- | launcher/qml/Launcher.qml | 2 | ||||
-rw-r--r-- | launcher/src/applicationmodel.cpp | 6 | ||||
-rw-r--r-- | launcher/src/applicationmodel.h | 1 | ||||
-rw-r--r-- | launcher/src/main.cpp | 12 |
4 files changed, 10 insertions, 11 deletions
diff --git a/launcher/qml/Launcher.qml b/launcher/qml/Launcher.qml index 6caad1e..26e42fc 100644 --- a/launcher/qml/Launcher.qml +++ b/launcher/qml/Launcher.qml @@ -82,7 +82,7 @@ Window { } else { currentId = '' } - homescreenHandler.tapShortcut(applicationModel.name(loc.index)) + homescreenHandler.tapShortcut(applicationModel.appid(loc.index)) } onPositionChanged: { if (loc.currentId === '') return diff --git a/launcher/src/applicationmodel.cpp b/launcher/src/applicationmodel.cpp index 17e38fb..14e2ea1 100644 --- a/launcher/src/applicationmodel.cpp +++ b/launcher/src/applicationmodel.cpp @@ -127,6 +127,12 @@ QString ApplicationModel::id(int i) const return data(index(i), Qt::UserRole).toString(); } +QString ApplicationModel::appid(int i) const +{ + QString id = data(index(i), Qt::UserRole).toString(); + return id.split("@")[0]; +} + QString ApplicationModel::name(int i) const { return data(index(i), Qt::DisplayRole).toString(); diff --git a/launcher/src/applicationmodel.h b/launcher/src/applicationmodel.h index 8398b62..71c79fc 100644 --- a/launcher/src/applicationmodel.h +++ b/launcher/src/applicationmodel.h @@ -31,6 +31,7 @@ public: QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; QHash<int, QByteArray> roleNames() const override; + Q_INVOKABLE QString appid(int index) const; Q_INVOKABLE QString id(int index) const; Q_INVOKABLE QString name(int index) const; Q_INVOKABLE void move(int from, int to); diff --git a/launcher/src/main.cpp b/launcher/src/main.cpp index 91a1d80..5720203 100644 --- a/launcher/src/main.cpp +++ b/launcher/src/main.cpp @@ -124,16 +124,8 @@ int main(int argc, char *argv[]) homescreenHandler->init(port, token.toStdString().c_str()); homescreenHandler->set_event_handler(QLibHomeScreen::Event_TapShortcut, [layoutHandler, myname](json_object *object){ - json_object *appnameJ = nullptr; - if(json_object_object_get_ex(object, "application_name", &appnameJ)) - { - const char *appname = json_object_get_string(appnameJ); - if(myname == appname) - { - qDebug("Surface %s got tapShortcut\n", appname); - layoutHandler->activateSurface(myname); - } - } + qDebug("Surface %s got tapShortcut\n", myname.toStdString().c_str()); + layoutHandler->activateSurface(myname); }); QUrl bindingAddress; |