From 3a612558e447d1ee4a342316f04759af244ea11d Mon Sep 17 00:00:00 2001 From: Keith Edmunds Date: Sun, 15 Oct 2023 22:17:46 +0100 Subject: [PATCH] Set playlist column widths before populating playlist Big speed improvment. Loading a 540 line playlist went from 0.445s to 0.264s. --- app/playlists.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/playlists.py b/app/playlists.py index cb76a53..9d902c1 100644 --- a/app/playlists.py +++ b/app/playlists.py @@ -787,6 +787,9 @@ class PlaylistTab(QTableWidget): # Clear playlist self.setRowCount(0) + # Set widths + self._set_column_widths(session) + # Get played tracks played_rows = self._get_played_rows(session) @@ -818,9 +821,6 @@ class PlaylistTab(QTableWidget): if row0_item: self.scrollToItem(row0_item, QAbstractItemView.ScrollHint.PositionAtTop) - # Set widths - self._set_column_widths(session) - # Queue up time calculations to take place after UI has # updated self._update_start_end_times(session)