Refresh cover browser when a cover is changed via the edit meta information dialog

This commit is contained in:
Kovid Goyal 2010-02-26 15:22:25 -07:00
parent 8a930b53af
commit 9b28048159
3 changed files with 10 additions and 1 deletions

View File

@ -135,5 +135,6 @@ def check_ebook_format(stream, current_guess):
stream.seek(0) stream.seek(0)
if stream.read(3) == 'TPZ': if stream.read(3) == 'TPZ':
ans = 'tpz' ans = 'tpz'
stream.seek(0)
return ans return ans

View File

@ -211,6 +211,10 @@ class BooksModel(QAbstractTableModel):
if rows: if rows:
self.refresh_rows(rows, current_row=current_row) self.refresh_rows(rows, current_row=current_row)
def refresh_cover_cache(self, ids):
if self.cover_cache:
self.cover_cache.refresh(ids)
def refresh_rows(self, rows, current_row=-1): def refresh_rows(self, rows, current_row=-1):
for row in rows: for row in rows:
if self.cover_cache: if self.cover_cache:

View File

@ -1292,7 +1292,11 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
break break
if rows: if rows:
current = self.library_view.currentIndex() current = self.library_view.currentIndex()
self.library_view.model().current_changed(current, previous) m = self.library_view.model()
m.refresh_cover_cache(map(m.id, rows))
if self.cover_flow:
self.cover_flow.dataChanged()
m.current_changed(current, previous)
def edit_bulk_metadata(self, checked): def edit_bulk_metadata(self, checked):
''' '''