Edit Book: Auto-add file extension when using the Save a Copy dialog if it is missing. Fixes #1627482 [save a copy as EPUB does not add automatically .epub extension to file](https://bugs.launchpad.net/calibre/+bug/1627482)

This commit is contained in:
Kovid Goyal 2016-09-26 11:28:25 +05:30
parent 1d6f518799
commit 237e4a9455

View File

@ -1065,6 +1065,8 @@ class Boss(QObject):
filters=[(_('Book (%s)') % ext.upper(), [ext.lower()])], all_files=False) filters=[(_('Book (%s)') % ext.upper(), [ext.lower()])], all_files=False)
if not path: if not path:
return return
if '.' not in os.path.basename(path):
path += '.' + ext.lower()
tdir = self.mkdtemp(prefix='save-copy-') tdir = self.mkdtemp(prefix='save-copy-')
container = clone_container(c, tdir) container = clone_container(c, tdir)
for name, ed in editors.iteritems(): for name, ed in editors.iteritems():