From 75a0f165c6a8e97d033d11fd32e96b1632dcebfc Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 17 Mar 2021 10:13:26 +1000 Subject: [PATCH] fix opening the browser in an empty collection case _onRowChanged() no longer exists, and super-frustratingly mypy doesn't seem to notice references to missing properties on mw or mw.browser --- qt/aqt/browser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qt/aqt/browser.py b/qt/aqt/browser.py index 0b0d7cd3a..8ded9eaf3 100644 --- a/qt/aqt/browser.py +++ b/qt/aqt/browser.py @@ -735,7 +735,7 @@ class Browser(QMainWindow): show_invalid_search_error(err) if not self.model.cards: # no row change will fire - self._onRowChanged(None, None) + self.onRowChanged(None, None) def update_history(self) -> None: sh = self.mw.pm.profile["searchHistory"] @@ -832,7 +832,7 @@ QTableView {{ gridline-color: {grid} }} gui_hooks.editor_did_init_left_buttons.remove(add_preview_button) @ensure_editor_saved - def onRowChanged(self, current: QItemSelection, previous: QItemSelection) -> None: + def onRowChanged(self, current: Optional[QItemSelection], previous: Optional[QItemSelection]) -> None: """Update current note and hide/show editor.""" if self._closeEventHasCleanedUp: return