Fix type coercion warnings

This commit is contained in:
Alex Spataru 2021-09-30 23:15:32 -05:00
parent b822dc3072
commit beac88efd9
5 changed files with 24 additions and 24 deletions

View File

@ -310,7 +310,7 @@ Item {
checked: Cpp_IO_Console.echo checked: Cpp_IO_Console.echo
enabled: Cpp_IO_Manager.readWrite enabled: Cpp_IO_Manager.readWrite
onCheckedChanged: { onCheckedChanged: {
if (Cpp_IO_Console.echo != checked) if (Cpp_IO_Console.echo !== checked)
Cpp_IO_Console.echo = checked Cpp_IO_Console.echo = checked
} }
} }
@ -328,7 +328,7 @@ Item {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
checked: Cpp_IO_Console.autoscroll checked: Cpp_IO_Console.autoscroll
onCheckedChanged: { onCheckedChanged: {
if (Cpp_IO_Console.autoscroll != checked) if (Cpp_IO_Console.autoscroll !== checked)
Cpp_IO_Console.autoscroll = checked Cpp_IO_Console.autoscroll = checked
} }
} }
@ -339,7 +339,7 @@ Item {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
checked: Cpp_IO_Console.showTimestamp checked: Cpp_IO_Console.showTimestamp
onCheckedChanged: { onCheckedChanged: {
if (Cpp_IO_Console.showTimestamp != checked) if (Cpp_IO_Console.showTimestamp !== checked)
Cpp_IO_Console.showTimestamp = checked Cpp_IO_Console.showTimestamp = checked
} }
} }
@ -354,7 +354,7 @@ Item {
model: Cpp_IO_Console.lineEndings() model: Cpp_IO_Console.lineEndings()
currentIndex: Cpp_IO_Console.lineEnding currentIndex: Cpp_IO_Console.lineEnding
onCurrentIndexChanged: { onCurrentIndexChanged: {
if (currentIndex != Cpp_IO_Console.lineEnding) if (currentIndex !== Cpp_IO_Console.lineEnding)
Cpp_IO_Console.lineEnding = currentIndex Cpp_IO_Console.lineEnding = currentIndex
} }
} }
@ -365,7 +365,7 @@ Item {
model: Cpp_IO_Console.displayModes() model: Cpp_IO_Console.displayModes()
currentIndex: Cpp_IO_Console.displayMode currentIndex: Cpp_IO_Console.displayMode
onCurrentIndexChanged: { onCurrentIndexChanged: {
if (currentIndex != Cpp_IO_Console.displayMode) if (currentIndex !== Cpp_IO_Console.displayMode)
Cpp_IO_Console.displayMode = currentIndex Cpp_IO_Console.displayMode = currentIndex
} }
} }

View File

@ -119,8 +119,8 @@ Item {
Connections { Connections {
target: Cpp_JSON_Generator target: Cpp_JSON_Generator
function onOperationModeChanged() { function onOperationModeChanged() {
commAuto.checked = (Cpp_JSON_Generator.operationMode == 1) commAuto.checked = (Cpp_JSON_Generator.operationMode === 1)
commManual.checked = (Cpp_JSON_Generator.operationMode == 0) commManual.checked = (Cpp_JSON_Generator.operationMode === 0)
} }
} }

View File

@ -85,7 +85,7 @@ MenuBar {
sequence: "ctrl+o" sequence: "ctrl+o"
text: qsTr("Replay CSV") + "..." text: qsTr("Replay CSV") + "..."
onTriggered: Cpp_CSV_Player.openFile() onTriggered: Cpp_CSV_Player.openFile()
enabled: Cpp_JSON_Generator.operationMode == 0 enabled: Cpp_JSON_Generator.operationMode === 0
} }
MenuSeparator {} MenuSeparator {}
@ -145,14 +145,14 @@ MenuBar {
DecentMenuItem { DecentMenuItem {
checkable: true checkable: true
text: qsTr("Device sends JSON") text: qsTr("Device sends JSON")
checked: Cpp_JSON_Generator.operationMode == 1 checked: Cpp_JSON_Generator.operationMode === 1
onTriggered: Cpp_JSON_Generator.operationMode = checked ? 1 : 0 onTriggered: Cpp_JSON_Generator.operationMode = checked ? 1 : 0
} }
DecentMenuItem { DecentMenuItem {
checkable: true checkable: true
text: qsTr("Load JSON from computer") text: qsTr("Load JSON from computer")
checked: Cpp_JSON_Generator.operationMode == 0 checked: Cpp_JSON_Generator.operationMode === 0
onTriggered: Cpp_JSON_Generator.operationMode = checked ? 0 : 1 onTriggered: Cpp_JSON_Generator.operationMode = checked ? 0 : 1
} }
} }
@ -260,14 +260,14 @@ MenuBar {
DecentMenuItem { DecentMenuItem {
checkable: true checkable: true
text: qsTr("Normal (plain text)") text: qsTr("Normal (plain text)")
checked: Cpp_IO_Console.displayMode == 0 checked: Cpp_IO_Console.displayMode === 0
onTriggered: Cpp_IO_Console.displayMode = checked ? 0 : 1 onTriggered: Cpp_IO_Console.displayMode = checked ? 0 : 1
} }
DecentMenuItem { DecentMenuItem {
checkable: true checkable: true
text: qsTr("Binary (hexadecimal)") text: qsTr("Binary (hexadecimal)")
checked: Cpp_IO_Console.displayMode == 1 checked: Cpp_IO_Console.displayMode === 1
onTriggered: Cpp_IO_Console.displayMode = checked ? 1 : 0 onTriggered: Cpp_IO_Console.displayMode = checked ? 1 : 0
} }
} }
@ -285,21 +285,21 @@ MenuBar {
DecentMenuItem { DecentMenuItem {
checkable: true checkable: true
text: Cpp_IO_Console.lineEndings()[1] text: Cpp_IO_Console.lineEndings()[1]
checked: Cpp_IO_Console.lineEnding == 1 checked: Cpp_IO_Console.lineEnding === 1
onTriggered: Cpp_IO_Console.lineEnding = 1 onTriggered: Cpp_IO_Console.lineEnding = 1
} }
DecentMenuItem { DecentMenuItem {
checkable: true checkable: true
text: Cpp_IO_Console.lineEndings()[2] text: Cpp_IO_Console.lineEndings()[2]
checked: Cpp_IO_Console.lineEnding == 2 checked: Cpp_IO_Console.lineEnding === 2
onTriggered: Cpp_IO_Console.lineEnding = 2 onTriggered: Cpp_IO_Console.lineEnding = 2
} }
DecentMenuItem { DecentMenuItem {
checkable: true checkable: true
text: Cpp_IO_Console.lineEndings()[3] text: Cpp_IO_Console.lineEndings()[3]
checked: Cpp_IO_Console.lineEnding == 3 checked: Cpp_IO_Console.lineEnding === 3
onTriggered: Cpp_IO_Console.lineEnding = 3 onTriggered: Cpp_IO_Console.lineEnding = 3
} }
} }

View File

@ -60,7 +60,7 @@ MenuBar {
shortcut: "ctrl+o" shortcut: "ctrl+o"
text: qsTr("Replay CSV") + "..." text: qsTr("Replay CSV") + "..."
onTriggered: Cpp_CSV_Player.openFile() onTriggered: Cpp_CSV_Player.openFile()
enabled: Cpp_JSON_Generator.operationMode == 0 enabled: Cpp_JSON_Generator.operationMode === 0
} }
MenuSeparator {} MenuSeparator {}
@ -120,14 +120,14 @@ MenuBar {
MenuItem { MenuItem {
checkable: true checkable: true
text: qsTr("Device sends JSON") text: qsTr("Device sends JSON")
checked: Cpp_JSON_Generator.operationMode == 1 checked: Cpp_JSON_Generator.operationMode === 1
onTriggered: Cpp_JSON_Generator.operationMode = checked ? 1 : 0 onTriggered: Cpp_JSON_Generator.operationMode = checked ? 1 : 0
} }
MenuItem { MenuItem {
checkable: true checkable: true
text: qsTr("Load JSON from computer") text: qsTr("Load JSON from computer")
checked: Cpp_JSON_Generator.operationMode == 0 checked: Cpp_JSON_Generator.operationMode === 0
onTriggered: Cpp_JSON_Generator.operationMode = checked ? 0 : 1 onTriggered: Cpp_JSON_Generator.operationMode = checked ? 0 : 1
} }
} }
@ -225,14 +225,14 @@ MenuBar {
MenuItem { MenuItem {
checkable: true checkable: true
text: qsTr("Normal (plain text)") text: qsTr("Normal (plain text)")
checked: Cpp_IO_Console.displayMode == 0 checked: Cpp_IO_Console.displayMode === 0
onTriggered: Cpp_IO_Console.displayMode = checked ? 0 : 1 onTriggered: Cpp_IO_Console.displayMode = checked ? 0 : 1
} }
MenuItem { MenuItem {
checkable: true checkable: true
text: qsTr("Binary (hexadecimal)") text: qsTr("Binary (hexadecimal)")
checked: Cpp_IO_Console.displayMode == 1 checked: Cpp_IO_Console.displayMode === 1
onTriggered: Cpp_IO_Console.displayMode = checked ? 1 : 0 onTriggered: Cpp_IO_Console.displayMode = checked ? 1 : 0
} }
} }
@ -250,21 +250,21 @@ MenuBar {
MenuItem { MenuItem {
checkable: true checkable: true
text: Cpp_IO_Console.lineEndings()[1] text: Cpp_IO_Console.lineEndings()[1]
checked: Cpp_IO_Console.lineEnding == 1 checked: Cpp_IO_Console.lineEnding === 1
onTriggered: Cpp_IO_Console.lineEnding = 1 onTriggered: Cpp_IO_Console.lineEnding = 1
} }
MenuItem { MenuItem {
checkable: true checkable: true
text: Cpp_IO_Console.lineEndings()[2] text: Cpp_IO_Console.lineEndings()[2]
checked: Cpp_IO_Console.lineEnding == 2 checked: Cpp_IO_Console.lineEnding === 2
onTriggered: Cpp_IO_Console.lineEnding = 2 onTriggered: Cpp_IO_Console.lineEnding = 2
} }
MenuItem { MenuItem {
checkable: true checkable: true
text: Cpp_IO_Console.lineEndings()[3] text: Cpp_IO_Console.lineEndings()[3]
checked: Cpp_IO_Console.lineEnding == 3 checked: Cpp_IO_Console.lineEnding === 3
onTriggered: Cpp_IO_Console.lineEnding = 3 onTriggered: Cpp_IO_Console.lineEnding = 3
} }
} }

View File

@ -98,7 +98,7 @@ Window {
Layout.fillWidth: true Layout.fillWidth: true
value: Cpp_CSV_Player.progress value: Cpp_CSV_Player.progress
onValueChanged: { onValueChanged: {
if (value != Cpp_CSV_Player.progress) if (value !== Cpp_CSV_Player.progress)
Cpp_CSV_Player.setProgress(value) Cpp_CSV_Player.setProgress(value)
} }
} }