From a3a7b20f07960049d754b1507eef69fc62af0a3a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 18 Apr 2015 08:35:55 +0530 Subject: [PATCH] Edit Book: Fix open OPF file not being refreshed when deleting items from the file browser. Fixes #1445634 [Wrong .opf syncing when deleting xptg template (and others?)](https://bugs.launchpad.net/calibre/+bug/1445634) --- src/calibre/gui2/tweak_book/boss.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/gui2/tweak_book/boss.py b/src/calibre/gui2/tweak_book/boss.py index e9933ca5ca..a5d35e8b51 100644 --- a/src/calibre/gui2/tweak_book/boss.py +++ b/src/calibre/gui2/tweak_book/boss.py @@ -360,6 +360,7 @@ class Boss(QObject): @in_thread_job def delete_requested(self, spine_items, other_items): self.add_savepoint(_('Before: Delete files')) + self.commit_dirty_opf() c = current_container() c.remove_from_spine(spine_items) for name in other_items: @@ -379,6 +380,8 @@ class Boss(QObject): toc = find_existing_toc(current_container()) if toc and toc in editors: editors[toc].replace_data(c.raw_data(toc)) + if c.opf_name in editors: + editors[c.opf_name].replace_data(c.raw_data(c.opf_name)) def commit_dirty_opf(self): c = current_container()