Skip to content

Commit

Permalink
Fix viewing books via the Cover browser not working when in device vi…
Browse files Browse the repository at this point in the history
…ew. Fixes #2092630 [Clicking on book cover images in Device view always throws an exception error](https://bugs.launchpad.net/calibre/+bug/2092630)
  • Loading branch information
kovidgoyal committed Dec 29, 2024
1 parent d2ca137 commit d26a381
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/calibre/gui2/actions/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,10 @@ def view_triggered(self, index):
def view_specific_book(self, index):
self._view_books([index])

def view_specific_calibre_book(self, index):
ids = [self.gui.library_view.model().id(index)]
self._view_calibre_books(ids)

def view_random(self, *args):
self.gui.iactions['Pick Random Book'].pick_random()
self._view_books([self.gui.library_view.currentIndex()])
Expand Down
2 changes: 1 addition & 1 deletion src/calibre/gui2/cover_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ def __init__(self, *a, **kw):
self.library_view.selectionModel().currentRowChanged.connect(self.sync_cf_to_listview)
self.db_images = DatabaseImages(self.library_view.model(), self.is_cover_browser_visible)
self.cover_flow.setImages(self.db_images)
self.cover_flow.itemActivated.connect(self.iactions['View'].view_specific_book)
self.cover_flow.itemActivated.connect(self.iactions['View'].view_specific_calibre_book)
self.update_cover_flow_subtitle_font()
button = self.cb_button
if self.separate_cover_browser:
Expand Down

0 comments on commit d26a381

Please sign in to comment.