parent
c511bf053e
commit
5d95748640
@ -370,11 +370,15 @@ class PlaylistModel(QAbstractTableModel):
|
||||
with Session() as session:
|
||||
for row_number in row_numbers:
|
||||
super().beginRemoveRows(QModelIndex(), row_number, row_number)
|
||||
# We need to remove data from the underlying data store,
|
||||
# which is the database, but we cache in
|
||||
# self.playlist_rows, which is what calls to data()
|
||||
# reads, so fixup that too.
|
||||
PlaylistRows.delete_row(session, self.playlist_id, row_number)
|
||||
PlaylistRows.fixup_rownumbers(session, self.playlist_id)
|
||||
self.refresh_data(session)
|
||||
super().endRemoveRows()
|
||||
|
||||
PlaylistRows.fixup_rownumbers(session, self.playlist_id)
|
||||
self.refresh_data(session)
|
||||
self.reset_track_sequence_row_numbers()
|
||||
|
||||
def display_role(self, row: int, column: int, prd: PlaylistRowData) -> QVariant:
|
||||
@ -1422,7 +1426,7 @@ class PlaylistProxyModel(QSortFilterProxyModel):
|
||||
self.setFilterKeyColumn(-1)
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return (f"<PlaylistProxyModel: source_model={self.source_model}>")
|
||||
return f"<PlaylistProxyModel: source_model={self.source_model}>"
|
||||
|
||||
def filterAcceptsRow(self, source_row: int, source_parent: QModelIndex) -> bool:
|
||||
"""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user