From: Li Xiaoming Date: Fri, 27 Sep 2019 12:40:58 +0000 (+0800) Subject: fix(MediaScanner.qml): Remove qml M126 warning X-Git-Tag: 8.99.1^0 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=9d56d84d976e6cc88b0ebedbcc3ba55f61cbb1f7;p=apps%2Fvideoplayer.git fix(MediaScanner.qml): Remove qml M126 warning 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: If0648d063b64ac2b4265006942b9c69991459836 Signed-off-by: Li Xiaoming --- diff --git a/app/api/MediaScanner.qml b/app/api/MediaScanner.qml index add261b..8842a18 100644 --- a/app/api/MediaScanner.qml +++ b/app/api/MediaScanner.qml @@ -83,10 +83,10 @@ WebSocket { case msgid.event: var payload = JSON.parse(JSON.stringify(json[2])) var event = payload.event - if (event == "mediascanner/media_added") { + if (event === "mediascanner/media_added") { console.debug("Media playlist is updated") root.add(json[2].data.Media) - } else if (event == "mediascanner/media_removed") { + } else if (event === "mediascanner/media_removed") { root.remove(json[2].data.Path) } break