mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 13:22:45 +02:00
Implement #6392 (Save to disk to be forbidden into library)
This commit is contained in:
parent
47e56e8cbe
commit
62c4b2860d
1 changed files with 8 additions and 0 deletions
|
|
@ -927,6 +927,14 @@ def save_to_disk(self, checked, single_dir=False, single_format=None):
|
|||
_('Choose destination directory'))
|
||||
if not path:
|
||||
return
|
||||
dpath = os.path.abspath(path).replace('/', os.sep)
|
||||
lpath = self.library_view.model().db.library_path.replace('/', os.sep)
|
||||
if dpath.startswith(lpath):
|
||||
return error_dialog(self, _('Not allowed'),
|
||||
_('You are tying to save files into the calibre '
|
||||
'library. This can cause corruption of your '
|
||||
'library. Save to disk is meant to export '
|
||||
'files from your calibre library elsewhere.'), show=True)
|
||||
|
||||
if self.current_view() is self.library_view:
|
||||
from calibre.gui2.add import Saver
|
||||
|
|
|
|||
Loading…
Reference in a new issue