mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
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)
This commit is contained in:
parent
8e85a16e4c
commit
a3a7b20f07
@ -360,6 +360,7 @@ class Boss(QObject):
|
|||||||
@in_thread_job
|
@in_thread_job
|
||||||
def delete_requested(self, spine_items, other_items):
|
def delete_requested(self, spine_items, other_items):
|
||||||
self.add_savepoint(_('Before: Delete files'))
|
self.add_savepoint(_('Before: Delete files'))
|
||||||
|
self.commit_dirty_opf()
|
||||||
c = current_container()
|
c = current_container()
|
||||||
c.remove_from_spine(spine_items)
|
c.remove_from_spine(spine_items)
|
||||||
for name in other_items:
|
for name in other_items:
|
||||||
@ -379,6 +380,8 @@ class Boss(QObject):
|
|||||||
toc = find_existing_toc(current_container())
|
toc = find_existing_toc(current_container())
|
||||||
if toc and toc in editors:
|
if toc and toc in editors:
|
||||||
editors[toc].replace_data(c.raw_data(toc))
|
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):
|
def commit_dirty_opf(self):
|
||||||
c = current_container()
|
c = current_container()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user