From c1a0dc0db77eb708c40273a24ebe8fbe4df35b69 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 11 Dec 2022 15:05:13 +0530 Subject: [PATCH] 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. --- src/calibre/gui2/library/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/library/views.py b/src/calibre/gui2/library/views.py index 3f629967ce..297cfbb760 100644 --- a/src/calibre/gui2/library/views.py +++ b/src/calibre/gui2/library/views.py @@ -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)