Fix a crash with a specific library

I haven't tracked down the root cause but simply updating the book
details panel after an event loop tick fixes it, so good enough for now.

Simply calling db.get_metadata() in the handler for current row changed
causes the crash. Which means it is some custom column template that is
depending on something in Qt causing the issue. There are enough
templates in this library that I dont feel like tracking it down.
This commit is contained in:
Kovid Goyal 2022-12-11 15:05:13 +05:30
parent 56ea0e545c
commit c1a0dc0db7
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -401,7 +401,7 @@ class BooksView(QTableView): # {{{
for wv in self, self.pin_view:
wv.setSelectionBehavior(QAbstractItemView.SelectionBehavior.SelectRows)
wv.setSortingEnabled(True)
self.selectionModel().currentRowChanged.connect(self._model.current_changed)
self.selectionModel().currentRowChanged.connect(self._model.current_changed, type=Qt.ConnectionType.QueuedConnection)
self.selectionModel().selectionChanged.connect(self.selection_changed.emit)
self.preserve_state = partial(PreserveViewState, self)
self.marked_changed_listener = FunctionDispatcher(self.marked_changed)