From d6a8e92dcdcd7c9405ccb382984190b0c35c5d0f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 4 May 2013 14:24:10 +0530 Subject: [PATCH] When changing to a virtual library, refresh the Book Details panel. Fixes #1176296 (Virtual Library - Wrong Book Highlighted When Switching Libraries) --- src/calibre/gui2/search_restriction_mixin.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/calibre/gui2/search_restriction_mixin.py b/src/calibre/gui2/search_restriction_mixin.py index f3055341bb..1a9ea621a9 100644 --- a/src/calibre/gui2/search_restriction_mixin.py +++ b/src/calibre/gui2/search_restriction_mixin.py @@ -561,6 +561,10 @@ class SearchRestrictionMixin(object): self.set_number_of_books_shown() self.current_view().setFocus(Qt.OtherFocusReason) self.set_window_title() + v = self.current_view() + if not v.currentIndex().isValid(): + v.set_current_row() + v.refresh_book_details() def set_number_of_books_shown(self): db = self.library_view.model().db