Fix #1568091 [Execution of column/row coloring rules is delayed](https://bugs.launchpad.net/calibre/+bug/1568091)

This commit is contained in:
Kovid Goyal 2016-04-11 07:05:58 +05:30
parent 8b2ed777ad
commit 5272f9eade

View File

@ -482,12 +482,14 @@ class EditMetadataAction(InterfaceAction):
if row.row() < rows[0].row(): if row.row() < rows[0].row():
dest_row -= 1 dest_row -= 1
self.gui.library_view.set_current_row(dest_row) self.gui.library_view.set_current_row(dest_row)
cr = self.gui.library_view.currentIndex().row()
self.gui.library_view.model().refresh_ids((dest_id,), cr)
def add_formats(self, dest_id, src_books, replace=False): def add_formats(self, dest_id, src_books, replace=False):
for src_book in src_books: for src_book in src_books:
if src_book: if src_book:
fmt = os.path.splitext(src_book)[-1].replace('.', '').upper() fmt = os.path.splitext(src_book)[-1].replace('.', '').upper()
with open(src_book, 'rb') as f: with lopen(src_book, 'rb') as f:
self.gui.library_view.model().db.add_format(dest_id, fmt, f, index_is_id=True, self.gui.library_view.model().db.add_format(dest_id, fmt, f, index_is_id=True,
notify=False, replace=replace) notify=False, replace=replace)