From: wang_zhiqiang Date: Tue, 6 Nov 2018 02:12:27 +0000 (+0800) Subject: use appid instead of appname in "tap_shortcut" X-Git-Tag: 6.99.1~2 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=6a712584e9b66fe48494c5d20690a072320baf14;hp=33d31b5bac3c8c9105d43d6566174f39ef7a4ea4;p=apps%2Fhomescreen.git use appid instead of appname in "tap_shortcut" Now In homescreen-service used application_id to identify different application, so use appid instead of appname in "tap_shortcut" parameter. Bug-AGL: SPEC-1764 Change-Id: I2fdda76167c7af9af65b1135b838da1742515b8b Signed-off-by: wang_zhiqiang --- diff --git a/homescreen/qml/ShortcutArea.qml b/homescreen/qml/ShortcutArea.qml index e0c9182..d7e97f0 100644 --- a/homescreen/qml/ShortcutArea.qml +++ b/homescreen/qml/ShortcutArea.qml @@ -28,18 +28,22 @@ Item { ListModel { id: applicationModel ListElement { + appid: 'launcher' name: 'launcher' application: 'launcher@0.1' } ListElement { + appid: 'mediaplayer' name: 'MediaPlayer' application: 'mediaplayer@0.1' } ListElement { + appid: 'hvac' name: 'HVAC' application: 'hvac@0.1' } ListElement { + appid: 'navigation' name: 'Navigation' application: 'navigation@0.1' } @@ -66,7 +70,7 @@ Item { console.warn(model.application) console.warn("app cannot be launched!") } - homescreenHandler.tapShortcut(model.name) + homescreenHandler.tapShortcut(model.appid) } } } diff --git a/homescreen/src/homescreenhandler.cpp b/homescreen/src/homescreenhandler.cpp index 5da8b9e..daf1b90 100644 --- a/homescreen/src/homescreenhandler.cpp +++ b/homescreen/src/homescreenhandler.cpp @@ -51,10 +51,10 @@ void HomescreenHandler::init(int port, const char *token) } -void HomescreenHandler::tapShortcut(QString application_name) +void HomescreenHandler::tapShortcut(QString application_id) { - HMI_DEBUG("HomeScreen","tapShortcut %s", application_name.toStdString().c_str()); - mp_hs->tapShortcut(application_name.toStdString().c_str()); + HMI_DEBUG("HomeScreen","tapShortcut %s", application_id.toStdString().c_str()); + mp_hs->tapShortcut(application_id.toStdString().c_str()); } void HomescreenHandler::onRep_static(struct json_object* reply_contents) diff --git a/homescreen/src/homescreenhandler.h b/homescreen/src/homescreenhandler.h index c18d7a0..1a9a2b5 100644 --- a/homescreen/src/homescreenhandler.h +++ b/homescreen/src/homescreenhandler.h @@ -32,7 +32,7 @@ public: void init(int port, const char* token); - Q_INVOKABLE void tapShortcut(QString application_name); + Q_INVOKABLE void tapShortcut(QString application_id); void onRep(struct json_object* reply_contents); void onEv(const string& event, struct json_object* event_contents);