Make refresh of book details panel after preferences work when there is no current index as well

This commit is contained in:
Kovid Goyal 2019-09-13 14:04:46 +05:30
parent 77141acd8b
commit 4d937e2d5d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 2 deletions

View File

@ -971,8 +971,10 @@ class BooksView(QTableView): # {{{
rmap = {i:x for i, x in enumerate(self.column_map)}
return (rmap[h.visualIndex(x)] for x in logical_indices if h.visualIndex(x) > -1)
def refresh_book_details(self):
def refresh_book_details(self, force=False):
idx = self.currentIndex()
if not idx.isValid() and force:
idx = self.model().index(0, 0)
if idx.isValid():
self._model.current_changed(idx, idx)
return True

View File

@ -788,7 +788,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
self.update_font_display()
gui.tags_view.set_look_and_feel()
gui.tags_view.reread_collapse_parameters()
gui.library_view.refresh_book_details()
gui.library_view.refresh_book_details(force=True)
gui.library_view.refresh_grid()
gui.library_view.set_row_header_visibility()
gui.cover_flow.setShowReflections(gprefs['cover_browser_reflections'])