Fix get_item_from_card_id()
This commit is contained in:
parent
a1277b0919
commit
4903a325d4
@ -149,11 +149,8 @@ class Table:
|
|||||||
def select_single_card(self, card_id: CardId) -> None:
|
def select_single_card(self, card_id: CardId) -> None:
|
||||||
"""Try to set the selection to the item corresponding to the given card."""
|
"""Try to set the selection to the item corresponding to the given card."""
|
||||||
self.clear_selection()
|
self.clear_selection()
|
||||||
if self.is_notes_mode():
|
if (row := self._model.get_card_row(card_id)) is not None:
|
||||||
self._view.selectRow(0)
|
self._view.selectRow(row)
|
||||||
else:
|
|
||||||
if (row := self._model.get_card_row(card_id)) is not None:
|
|
||||||
self._view.selectRow(row)
|
|
||||||
|
|
||||||
# Reset
|
# Reset
|
||||||
|
|
||||||
@ -772,7 +769,7 @@ class NoteState(ItemState):
|
|||||||
return self.col.find_notes(search, order)
|
return self.col.find_notes(search, order)
|
||||||
|
|
||||||
def get_item_from_card_id(self, card: CardId) -> ItemId:
|
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]:
|
def get_card_ids(self, items: Sequence[ItemId]) -> Sequence[CardId]:
|
||||||
return super().card_ids_from_note_ids(items)
|
return super().card_ids_from_note_ids(items)
|
||||||
|
Loading…
Reference in New Issue
Block a user