Edit book: Fix pasting files from another editor instance failing if a file with the same name already exists. Fixes #1959782 [Problems with drag and drop or adding files in the editor](https://bugs.launchpad.net/calibre/+bug/1959782)

This commit is contained in:
Kovid Goyal 2022-02-03 20:05:43 +05:30
parent ed209b9374
commit fce128a10e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1549,7 +1549,7 @@ class Boss(QObject):
container = current_container()
for name, (path, mt) in iteritems(name_map):
with lopen(path, 'rb') as f:
container.add_file(name, f.read(), media_type=mt)
container.add_file(name, f.read(), media_type=mt, modify_name_if_needed=True)
self.apply_container_update_to_gui()
def export_file(self, name, path):