diff --git a/app/playlists.py b/app/playlists.py index f87d974..064dde6 100644 --- a/app/playlists.py +++ b/app/playlists.py @@ -34,6 +34,7 @@ from PyQt6.QtWidgets import ( ) # Third party imports +import line_profiler # App imports from audacity_controller import AudacityController @@ -830,14 +831,12 @@ class PlaylistTab(QTableView): # Use a set to deduplicate result (a selected row will have all # items in that row selected) - result = sorted( - list( - set([self.model().mapToSource(a).row() for a in self.selectedIndexes()]) - ) - ) + selected_indexes = self.selectedIndexes() - log.debug(f"get_selected_rows() returned: {result=}") - return result + if not selected_indexes: + return [] + + return sorted(list(set([self.model().mapToSource(a).row() for a in selected_indexes]))) def get_top_visible_row(self) -> int: """ @@ -1119,6 +1118,7 @@ class PlaylistTab(QTableView): self.setSpan(row, column, rowSpan, columnSpan) + @line_profiler.profile def tab_live(self) -> None: """ Called when tab gets focus