mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #7890 (Drag/drop of new cover to book detail panel does not update cover browser)
This commit is contained in:
parent
5f91edf752
commit
b3e77bac61
@ -120,6 +120,7 @@ class AddAction(InterfaceAction):
|
|||||||
if self.gui.current_view() is not self.gui.library_view:
|
if self.gui.current_view() is not self.gui.library_view:
|
||||||
return
|
return
|
||||||
db = self.gui.library_view.model().db
|
db = self.gui.library_view.model().db
|
||||||
|
cover_changed = False
|
||||||
current_idx = self.gui.library_view.currentIndex()
|
current_idx = self.gui.library_view.currentIndex()
|
||||||
if not current_idx.isValid(): return
|
if not current_idx.isValid(): return
|
||||||
cid = db.id(current_idx.row())
|
cid = db.id(current_idx.row())
|
||||||
@ -133,12 +134,16 @@ class AddAction(InterfaceAction):
|
|||||||
if not pmap.isNull():
|
if not pmap.isNull():
|
||||||
accept = True
|
accept = True
|
||||||
db.set_cover(cid, pmap)
|
db.set_cover(cid, pmap)
|
||||||
|
cover_changed = True
|
||||||
elif ext in BOOK_EXTENSIONS:
|
elif ext in BOOK_EXTENSIONS:
|
||||||
db.add_format_with_hooks(cid, ext, path, index_is_id=True)
|
db.add_format_with_hooks(cid, ext, path, index_is_id=True)
|
||||||
accept = True
|
accept = True
|
||||||
if accept:
|
if accept:
|
||||||
event.accept()
|
event.accept()
|
||||||
self.gui.library_view.model().current_changed(current_idx, current_idx)
|
self.gui.library_view.model().current_changed(current_idx, current_idx)
|
||||||
|
if cover_changed:
|
||||||
|
if self.gui.cover_flow:
|
||||||
|
self.gui.cover_flow.dataChanged()
|
||||||
|
|
||||||
def __add_filesystem_book(self, paths, allow_device=True):
|
def __add_filesystem_book(self, paths, allow_device=True):
|
||||||
if isinstance(paths, basestring):
|
if isinstance(paths, basestring):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user