Commit 3ccb6709 authored by Laurent Montel's avatar Laurent Montel 😁

Fix warning about "==" vs "==="

parent 01195420
......@@ -38,7 +38,7 @@ Item {
Connections {
target: courseModel
onLanguageChanged: {
if (courseModel.course(courseView.currentIndex) != null) {
if (courseModel.course(courseView.currentIndex) !== null) {
selectedCourse = courseModel.course(courseView.currentIndex)
courseSelected(selectedCourse)
}
......@@ -102,10 +102,10 @@ Item {
}
}
onCurrentIndexChanged: {
if (courseModel.language == null) {
if (courseModel.language === null) {
return;
}
if (courseModel.course(currentIndex) != null) {
if (courseModel.course(currentIndex) !== null) {
selectedCourse = courseModel.course(currentIndex)
courseSelected(selectedCourse)
}
......
......@@ -140,12 +140,12 @@ Item
if (buttonEditSkeleton.checked) {
return false
}
if (editorSession.skeletonMode && editorSession.course != null) {
if (editorSession.skeletonMode && editorSession.course !== null) {
return false
}
if (!editorSession.skeletonMode
&& editorSession.language != null
&& editorSession.course != null
&& editorSession.language !== null
&& editorSession.course !== null
) {
return false
}
......@@ -183,7 +183,7 @@ Item
}
RowLayout {
id: mainRow
visible: editorSession.course != null
visible: editorSession.course !== null
Layout.fillHeight: true
ColumnLayout {
ScrollView {
......@@ -227,7 +227,7 @@ Item
Connections {
target: editorSession
onPhraseChanged: {
if (editorSession.phrase == null) {
if (editorSession.phrase === null) {
return
}
phraseTree.expand(phraseModel.indexUnit(editorSession.phrase.unit))
......@@ -248,12 +248,12 @@ Item
}
ColumnLayout {
UnitEditor {
visible: editorSession.unit != null && editorSession.phrase == null
visible: editorSession.unit !== null && editorSession.phrase === null
unit: editorSession.unit
editPhrases: editorSession.skeletonMode && editorSession.editSkeleton
}
PhraseEditor {
visible: editorSession.phrase != null
visible: editorSession.phrase !== null
phrase: editorSession.phrase
isSkeletonPhrase: editorSession.editSkeleton
Layout.minimumWidth: Math.floor(main.width * 0.6)
......
......@@ -52,7 +52,7 @@ Item {
// react on changed goals
Component.onCompleted: {
for (var i = 0; i < languageView.count; ++i) {
if (g_trainingSession.language.id == languageModel.language(i).id) {
if (g_trainingSession.language.id === languageModel.language(i).id) {
languageView.currentIndex = i
}
}
......
......@@ -180,7 +180,7 @@ ApplicationWindow {
Loader {
Layout.fillHeight: true
sourceComponent: {
g_trainingSession.language == null
g_trainingSession.language === null
? welcomeScreen
: trainingScreen
}
......
......@@ -57,7 +57,7 @@ ToolBar{
ComboBox {
id: comboCourse
enabled: {
courseFilterModel.filteredCount == 0 ? false : true
courseFilterModel.filteredCount === 0 ? false : true
}
Layout.minimumWidth: 200
model: CourseFilterModel {
......
......@@ -42,7 +42,7 @@ FocusScope {
profileForm.profile = profileManager.activeProfile
list.currentIndex = -1 // clear highlighting as fallback
for (var i=0; i < profileManager.profileCount; ++i) {
if (profileManager.activeProfile == profileManager.profile(i)) {
if (profileManager.activeProfile === profileManager.profile(i)) {
list.currentIndex = i
return;
}
......@@ -74,7 +74,7 @@ FocusScope {
Connections {
target: profileManager
onActiveProfileChanged: {
if (profileManager.activeProfile == profileManager.profile(index)) {
if (profileManager.activeProfile === profileManager.profile(index)) {
list.currentIndex = index
}
}
......
......@@ -57,6 +57,6 @@ Item {
Loader {
anchors.fill: parent
sourceComponent: profile.imageUrl == "" ? dummyImage : profileImage
sourceComponent: profile.imageUrl === "" ? dummyImage : profileImage
}
}
......@@ -46,11 +46,11 @@ Item {
fontSize: 16
onClicked: {
if (playerBackend.state == Player.PlayingState) {
if (playerBackend.state === Player.PlayingState) {
playerBackend.stop();
return;
}
if (playerBackend.state == Player.StoppedState) {
if (playerBackend.state === Player.StoppedState) {
playerBackend.playback();
return;
}
......@@ -59,11 +59,11 @@ Item {
target: playerBackend
onStateChanged: {
// set next possible action icon
if (playerBackend.state == Player.PlayingState) {
if (playerBackend.state === Player.PlayingState) {
button.iconName = "media-playback-stop";
return
}
if (playerBackend.state == Player.StoppedState) {
if (playerBackend.state === Player.StoppedState) {
button.iconName = "media-playback-start";
return
}
......
......@@ -53,12 +53,12 @@ Item {
fontSize: 16
onClicked: {
if (recorderBackend.state == Recorder.RecordingState) {
if (recorderBackend.state === Recorder.RecordingState) {
console.log("try to stop recording");
recorderBackend.stop();
return;
}
if (recorderBackend.state == Recorder.StoppedState) {
if (recorderBackend.state === Recorder.StoppedState) {
console.log("SoundRecorder: start capture");
recorderBackend.startCapture();
return;
......@@ -68,10 +68,10 @@ Item {
target: recorderBackend
onStateChanged: {
// update icon
if (recorderBackend.state == Recorder.RecordingState) {
if (recorderBackend.state === Recorder.RecordingState) {
button.iconName = "media-playback-stop";
}
if (recorderBackend.state == Recorder.StoppedState) {
if (recorderBackend.state === Recorder.StoppedState) {
button.iconName = "media-record";
}
}
......
......@@ -38,7 +38,7 @@ Item {
Text {
font.pointSize: 24
text: {
if (g_trainingSession.unit == null) {
if (g_trainingSession.unit === null) {
return i18n("Category: no category selected");
}
return i18n("Category: ") + g_trainingSession.unit.title
......@@ -46,7 +46,7 @@ Item {
}
Text {
text: {
if (g_trainingSession.unit == null || g_trainingSession.course == null) {
if (g_trainingSession.unit === null || g_trainingSession.course === null) {
return "";
}
return g_trainingSession.course.i18nTitle
......@@ -76,7 +76,7 @@ Item {
bottomMargin: theme.spacing + buttonNativePlay.height
}
objectName: "phraseText"
text: (g_trainingSession.phrase != null) ? g_trainingSession.phrase.text : ""
text: (g_trainingSession.phrase !== null) ? g_trainingSession.phrase.text : ""
wrapMode: Text.WordWrap
readOnly: true
horizontalAlignment: Text.AlignHCenter
......@@ -93,7 +93,7 @@ Item {
}
text: i18n("Listen")
Layout.alignment: Qt.AlignBottom
fileUrl: g_trainingSession.phrase == null ? "" : g_trainingSession.phrase.soundFileUrl
fileUrl: g_trainingSession.phrase === null ? "" : g_trainingSession.phrase.soundFileUrl
}
}
Rectangle {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment