fix issue,call tap_shortcut carelessly 03/17203/1
authorwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
Sat, 13 Oct 2018 08:56:30 +0000 (16:56 +0800)
committerwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
Sat, 13 Oct 2018 09:00:12 +0000 (17:00 +0800)
  the scenes as below not call tap_shortcut
  1)when touch blank
  2)long press or move icon

Change-Id: I13f2d1833af323da19ce2521cd2be6188fe1bb7a
Signed-off-by: wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
launcher/qml/Launcher.qml

index 31b1f3d..6d55271 100644 (file)
@@ -69,9 +69,13 @@ ApplicationWindow {
             y: 264
             onPressAndHold: currentId = applicationModel.id(newIndex = index)
             onReleased: {
+                if(loc.index < 0) {
+                    return
+                }
                 if (currentId === '') {
                     pid = launcher.launch(applicationModel.id(loc.index))
                     if (1 < pid) {
+                        homescreenHandler.tapShortcut(applicationModel.name(loc.index))
                     }
                     else {
                         console.warn("app cannot be launched!")
@@ -79,7 +83,6 @@ ApplicationWindow {
                 } else {
                     currentId = ''
                 }
-                homescreenHandler.tapShortcut(applicationModel.name(loc.index))
             }
             onPositionChanged: {
                 if (loc.currentId === '') return