summaryrefslogtreecommitdiffstats
path: root/app/map/MapComponent.qml
diff options
context:
space:
mode:
authorLi Xiaoming <lixm.fnst@cn.fujitsu.com>2019-09-22 20:56:19 +0800
committerLi Xiaoming <lixm.fnst@cn.fujitsu.com>2019-09-22 20:56:19 +0800
commit57881a95bf730dec7dd010bc086a5c42003840d4 (patch)
tree46c93228a9c74366026ceb45b282767e5e9564a6 /app/map/MapComponent.qml
parentae47635e56c4af4d816a76e5186e945768543679 (diff)
Message: == and != may perform type coercion, use === or !== to avoid it. Description: The non-strict equality comparison is allowed to convert its arguments to a common type. That can lead to unexpected results such as ' \t\r\n' == 0 being true. Use the strict equality operators === and !== and be explicit about conversions you require. Bug-AGL: SPEC-2814 Change-Id: I4dd5848797f445d082242a5c5e2a0148ea790dc0 Signed-off-by: Li Xiaoming <lixm.fnst@cn.fujitsu.com>
Diffstat (limited to 'app/map/MapComponent.qml')
-rw-r--r--app/map/MapComponent.qml12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/map/MapComponent.qml b/app/map/MapComponent.qml
index 161038c..87ad74a 100644
--- a/app/map/MapComponent.qml
+++ b/app/map/MapComponent.qml
@@ -181,7 +181,7 @@ Map {
{
var count = map.mapItems.length
var co = Qt.createComponent(item+'.qml')
- if (co.status == Component.Ready) {
+ if (co.status === Component.Ready) {
var o = co.createObject(map)
o.setGeometry(map.markers, currentMarker)
map.addMapItem(o)
@@ -204,13 +204,13 @@ Map {
var myArray = new Array()
var count = map.markers.length
for (var i = 0; i<count; i++){
- if (index != i) myArray.push(map.markers[i])
+ if (index !== i) myArray.push(map.markers[i])
}
map.removeMapItem(map.markers[index])
map.markers[index].destroy()
map.markers = myArray
- if (markers.length == 0) markerCounter = 0
+ if (markers.length === 0) markerCounter = 0
}
function calculateMarkerRoute()
@@ -526,7 +526,7 @@ Map {
}
onPositionChanged: {
- if (mouse.button == Qt.LeftButton) {
+ if (mouse.button === Qt.LeftButton) {
map.lastX = mouse.x + parent.x
map.lastY = mouse.y + parent.y
}
@@ -596,7 +596,7 @@ Map {
if (pressed) parent.radius = parent.center.distanceTo(
map.toCoordinate(Qt.point(mouse.x, mouse.y)))
}
- if (mouse.button == Qt.LeftButton) {
+ if (mouse.button === Qt.LeftButton) {
map.lastX = mouse.x + parent.x
map.lastY = mouse.y + parent.y
}
@@ -656,7 +656,7 @@ Map {
}
onPositionChanged: {
- if (mouse.button == Qt.LeftButton) {
+ if (mouse.button === Qt.LeftButton) {
map.lastX = mouse.x
map.lastY = mouse.y
}