aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTadao Tanikawa <tanikawa.tadao@jp.panasonic.com>2018-08-24 04:44:33 +0000
committerTadao Tanikawa <tanikawa.tadao@jp.panasonic.com>2018-08-24 10:58:38 +0000
commit9430d170c235ff75268db06d1ba32692dea0a65f (patch)
tree8524d3531c1388776a85f2953e0043018eb29259
parentadfc55e6dd4b10b83aa35bab40698cbf7b496ec7 (diff)
This reverts commit 5fbb59e80e4f870a1badd694d2efcd8cd941cdfb. Bug-AGL: SPEC-1685 Change-Id: Idd71625415b79cff6ab76b6179236d946a5aab41 Signed-off-by: Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com>
-rw-r--r--launcher/qml/Launcher.qml2
-rw-r--r--launcher/src/applicationmodel.cpp6
-rw-r--r--launcher/src/applicationmodel.h1
-rw-r--r--launcher/src/main.cpp12
4 files changed, 11 insertions, 10 deletions
diff --git a/launcher/qml/Launcher.qml b/launcher/qml/Launcher.qml
index f6f2702..31b1f3d 100644
--- a/launcher/qml/Launcher.qml
+++ b/launcher/qml/Launcher.qml
@@ -79,7 +79,7 @@ ApplicationWindow {
} else {
currentId = ''
}
- homescreenHandler.tapShortcut(applicationModel.appid(loc.index))
+ homescreenHandler.tapShortcut(applicationModel.name(loc.index))
}
onPositionChanged: {
if (loc.currentId === '') return
diff --git a/launcher/src/applicationmodel.cpp b/launcher/src/applicationmodel.cpp
index 14e2ea1..17e38fb 100644
--- a/launcher/src/applicationmodel.cpp
+++ b/launcher/src/applicationmodel.cpp
@@ -127,12 +127,6 @@ 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 71c79fc..8398b62 100644
--- a/launcher/src/applicationmodel.h
+++ b/launcher/src/applicationmodel.h
@@ -31,7 +31,6 @@ 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 5720203..91a1d80 100644
--- a/launcher/src/main.cpp
+++ b/launcher/src/main.cpp
@@ -124,8 +124,16 @@ 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){
- qDebug("Surface %s got tapShortcut\n", myname.toStdString().c_str());
- layoutHandler->activateSurface(myname);
+ 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);
+ }
+ }
});
QUrl bindingAddress;