From 4903a325d4a5d2ef5000223d7de71720cb87f5cf Mon Sep 17 00:00:00 2001 From: RumovZ Date: Tue, 6 Apr 2021 12:06:08 +0200 Subject: [PATCH] Fix get_item_from_card_id() --- qt/aqt/table.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/qt/aqt/table.py b/qt/aqt/table.py index aec9d7b71..9df2c65ce 100644 --- a/qt/aqt/table.py +++ b/qt/aqt/table.py @@ -149,11 +149,8 @@ class Table: def select_single_card(self, card_id: CardId) -> None: """Try to set the selection to the item corresponding to the given card.""" self.clear_selection() - if self.is_notes_mode(): - self._view.selectRow(0) - else: - if (row := self._model.get_card_row(card_id)) is not None: - self._view.selectRow(row) + if (row := self._model.get_card_row(card_id)) is not None: + self._view.selectRow(row) # Reset @@ -772,7 +769,7 @@ class NoteState(ItemState): return self.col.find_notes(search, order) def get_item_from_card_id(self, card: CardId) -> ItemId: - return self.get_card(card).note().id + return self.col.get_card(card).note().id def get_card_ids(self, items: Sequence[ItemId]) -> Sequence[CardId]: return super().card_ids_from_note_ids(items)