From f59d90e68eec8af183face23c404b473ac70f819 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 18 Sep 2013 21:36:10 +0530 Subject: [PATCH] Fix switching to an empty virtual library not blanking the book details panel --- src/calibre/gui2/library/views.py | 2 ++ src/calibre/gui2/search_restriction_mixin.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/library/views.py b/src/calibre/gui2/library/views.py index 034f543429..b59cb49a11 100644 --- a/src/calibre/gui2/library/views.py +++ b/src/calibre/gui2/library/views.py @@ -763,6 +763,8 @@ class BooksView(QTableView): # {{{ idx = self.currentIndex() if idx.isValid(): self._model.current_changed(idx, idx) + return True + return False def scrollContentsBy(self, dx, dy): # Needed as Qt bug causes headerview to not always update when scrolling diff --git a/src/calibre/gui2/search_restriction_mixin.py b/src/calibre/gui2/search_restriction_mixin.py index 2ab5959800..05cc266cef 100644 --- a/src/calibre/gui2/search_restriction_mixin.py +++ b/src/calibre/gui2/search_restriction_mixin.py @@ -587,7 +587,8 @@ class SearchRestrictionMixin(object): v = self.current_view() if not v.currentIndex().isValid(): v.set_current_row() - v.refresh_book_details() + if not v.refresh_book_details(): + self.book_details.reset_info() def set_number_of_books_shown(self): db = self.library_view.model().db