parent
a7932adfe4
commit
fc4129994b
@ -862,7 +862,7 @@ class PlaylistModel(QAbstractTableModel):
|
||||
# otherwise rows below the destination row will end up above the
|
||||
# moved rows.
|
||||
adjusted_to_row = to_row_number - len(
|
||||
[a for a in from_rows if a <= to_row_number]
|
||||
[a for a in from_rows if a < to_row_number]
|
||||
)
|
||||
|
||||
# Put the from_row row numbers into the row_map. Ultimately the
|
||||
|
||||
@ -244,6 +244,20 @@ class TestMMMiscRowMove(unittest.TestCase):
|
||||
new_order.append(int(self.model.playlist_rows[row].note))
|
||||
assert new_order == [0, 1, 2, 3, 4, 7, 8, 10, 5, 6, 9]
|
||||
|
||||
def test_move_rows_test9(self):
|
||||
# move rows [1, 2, 3] → 0
|
||||
# Replicate issue 244
|
||||
|
||||
self.model.move_rows([0, 1, 2, 3], 0)
|
||||
|
||||
# Check we have all rows and plr_rownums are correct
|
||||
new_order = []
|
||||
for row in range(self.model.rowCount()):
|
||||
assert row in self.model.playlist_rows
|
||||
assert self.model.playlist_rows[row].plr_rownum == row
|
||||
new_order.append(int(self.model.playlist_rows[row].note))
|
||||
assert new_order == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
|
||||
|
||||
def test_insert_header_row_end(self):
|
||||
# insert header row at end of playlist
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user