From 7e8b1b67e7cd61040dc2713cb9d8d08af1c0c001 Mon Sep 17 00:00:00 2001 From: James Turner Date: Sun, 3 Jun 2018 09:14:32 +0100 Subject: [PATCH] JS comparison type safety warning fixes --- src/GUI/qml/Section.qml | 4 ++-- src/GUI/qml/SettingControl.qml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/GUI/qml/Section.qml b/src/GUI/qml/Section.qml index 1c6800148..1a89cf327 100644 --- a/src/GUI/qml/Section.qml +++ b/src/GUI/qml/Section.qml @@ -27,7 +27,7 @@ Item { function anyAdvancedSettings(items) { for (var i = 0; i < items.length; i++) { - if (items[i].advanced == true) return true; + if (items[i].advanced === true) return true; } return false; @@ -39,7 +39,7 @@ Item { { for (var i = 0; i < items.length; i++) { var control = items[i]; - if (control.advanced == true) { + if (control.advanced === true) { if (!control.__isDefault && !control.hidden) { //console.info("Non-default advanced setting:" + control.label + "," // + control.defaultValue + " != " + control.value) ; diff --git a/src/GUI/qml/SettingControl.qml b/src/GUI/qml/SettingControl.qml index c8ba96d0b..8a0a95d81 100644 --- a/src/GUI/qml/SettingControl.qml +++ b/src/GUI/qml/SettingControl.qml @@ -26,7 +26,7 @@ Item { return !hidden && (!advanced || parent.showAdvanced) } - readonly property bool __isDefault: (this.value == this.defaultValue); + readonly property bool __isDefault: (this.value === this.defaultValue); Component.onCompleted: { restoreState(); @@ -84,7 +84,7 @@ Item { var defaultValue = ("defaultValue" in root) ? root.defaultValue : undefined; var rawValue = _config.getValueForKey("", root.setting, defaultValue); // console.warn("restoring state for " + root.setting + ", got raw value " + rawValue + " with type " + typeof(rawValue)) - if (rawValue != undefined) { + if (rawValue !== undefined) { // root["value"] = rawValue this.value = rawValue }