Skip to content

Commit

Permalink
Rename state variable
Browse files Browse the repository at this point in the history
  • Loading branch information
trin94 committed Feb 1, 2024
1 parent 7ae149b commit 281d8ad
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
13 changes: 6 additions & 7 deletions qml/table/MpvqcTable.qml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ ListView {
readonly property var mpvqcKeyCommandGenerator: mpvqcApplication.mpvqcKeyCommandGenerator

property bool haveComments: root.mpvqcApplication.mpvqcCommentTable.count > 0
property bool currentlyEditing: root.mpvqcApplication.mpvqcCommentTable.editMode
property bool currentlyFullscreen: root.mpvqcApplication.fullscreen

property bool editMode: false
property bool currentlyEditing: false
property bool currentlyFullscreen: root.mpvqcApplication.fullscreen

property var deleteCommentMessageBox: null
property var deleteCommentMessageBoxFactory: Component {
Expand All @@ -57,7 +56,7 @@ ListView {
clip: true
focus: true
reuseItems: true
interactive: !editMode
interactive: !currentlyEditing
boundsBehavior: Flickable.StopAtBounds
highlightMoveDuration: 0
highlightMoveVelocity: -1
Expand All @@ -76,7 +75,7 @@ ListView {
delegate: MpvqcRow {
mpvqcApplication: root.mpvqcApplication
rowSelected: root.currentIndex === index
tableInEditMode: root.editMode
tableInEditMode: root.currentlyEditing
width: parent ? parent.width : 0
widthScrollBar: _scrollBar.visibleWidth

Expand All @@ -86,9 +85,9 @@ ListView {

onDeleteCommentClicked: root._requestDeleteRow(index)

onEditingStarted: { root.editMode = true }
onEditingStarted: { root.currentlyEditing = true }

onEditingStopped: { root.editMode = false }
onEditingStopped: { root.currentlyEditing = false }

onPlayClicked: root.mpv.jump_to(time)

Expand Down
18 changes: 9 additions & 9 deletions qml/table/tst_MpvqcTable.qml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ TestCase {

mouseClick(control, data.column, row2)
wait(longTime)
verify(!control.editMode)
verify(!control.currentlyEditing)
compare(control.currentIndex, 1)
}

Expand Down Expand Up @@ -177,11 +177,11 @@ TestCase {
wait(shortTime)
keyPress(Qt.Key_Return)
wait(shortTime)
verify(control.editMode)
verify(control.currentlyEditing)

mouseClick(control, data.columnClicked, data.rowClicked)
wait(longTime)
verify(!control.editMode)
verify(!control.currentlyEditing)
compare(control.currentIndex, data.rowIndexExpected)
}

Expand All @@ -191,11 +191,11 @@ TestCase {
wait(shortTime)
keyPress(Qt.Key_Return)
wait(shortTime)
verify(control.editMode)
verify(control.currentlyEditing)

keyPress(Qt.Key_Down)
wait(longTime)
verify(!control.editMode)
verify(!control.currentlyEditing)
compare(control.currentIndex, 1)
}

Expand All @@ -205,11 +205,11 @@ TestCase {
wait(shortTime)
mouseClick(control, columnTime, row1)
wait(shortTime)
verify(control.editMode)
verify(control.currentlyEditing)

mouseClick(control, columnComment, row2)
wait(longTime)
verify(!control.editMode)
verify(!control.currentlyEditing)
compare(control.currentIndex, 0)
}

Expand All @@ -219,11 +219,11 @@ TestCase {
wait(shortTime)
mouseClick(control, columnCommentType, row1)
wait(shortTime)
verify(control.editMode)
verify(control.currentlyEditing)

mouseClick(control, columnComment, row2)
wait(longTime)
verify(!control.editMode)
verify(!control.currentlyEditing)
compare(control.currentIndex, 0)
}

Expand Down

0 comments on commit 281d8ad

Please sign in to comment.