handle missing default sort column in notes view
Switching to notes mode was throwing: File "/Users/dae/Work/code/dtop/bazel-copy/runanki.runfiles/net_ankiweb_anki/qt/aqt/browser.py", line 449, in on_table_state_changed self.table.toggle_state(checked, self._lastSearchTxt) File "/Users/dae/Work/code/dtop/bazel-copy/runanki.runfiles/net_ankiweb_anki/qt/aqt/table.py", line 206, in toggle_state self._state = self._model.toggle_state( File "/Users/dae/Work/code/dtop/bazel-copy/runanki.runfiles/net_ankiweb_anki/qt/aqt/table.py", line 996, in toggle_state self.search(context) File "/Users/dae/Work/code/dtop/bazel-copy/runanki.runfiles/net_ankiweb_anki/qt/aqt/table.py", line 1005, in search context.order = self.columns[self._state.sort_column]
This commit is contained in:
parent
d4159fef19
commit
12ce632605
@ -1002,7 +1002,11 @@ class DataModel(QAbstractTableModel):
|
||||
self.begin_reset()
|
||||
try:
|
||||
if context.order is True:
|
||||
context.order = self.columns[self._state.sort_column]
|
||||
try:
|
||||
context.order = self.columns[self._state.sort_column]
|
||||
except KeyError:
|
||||
# invalid sort column in config
|
||||
context.order = self.columns["noteCrt"]
|
||||
context.reverse = self._state.sort_backwards
|
||||
gui_hooks.browser_will_search(context)
|
||||
if context.ids is None:
|
||||
|
Loading…
Reference in New Issue
Block a user