mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Edit Book: Use the cache directory rather than the temp directory to store working files. Hopefully prevents temp file cleaners from destroying books. See #1740460 (Edit Book feature results in error after previously editing successfully)
This commit is contained in:
parent
2ea7fd0c52
commit
0c01357f8b
@ -296,7 +296,9 @@ class Boss(QObject):
|
|||||||
self.container_count = -1
|
self.container_count = -1
|
||||||
if self.tdir:
|
if self.tdir:
|
||||||
shutil.rmtree(self.tdir, ignore_errors=True)
|
shutil.rmtree(self.tdir, ignore_errors=True)
|
||||||
self.tdir = PersistentTemporaryDirectory()
|
# We use the cache dir rather than the temporary dir to try and prevent
|
||||||
|
# temp file cleaners from nuking ebooks. See https://bugs.launchpad.net/bugs/1740460
|
||||||
|
self.tdir = PersistentTemporaryDirectory(prefix='calibre-ew-', dir=cache_dir())
|
||||||
self._edit_file_on_open = edit_file
|
self._edit_file_on_open = edit_file
|
||||||
self._clear_notify_data = clear_notify_data
|
self._clear_notify_data = clear_notify_data
|
||||||
self.gui.blocking_job('open_book', _('Opening book, please wait...'), self.book_opened, get_container, path, tdir=self.mkdtemp())
|
self.gui.blocking_job('open_book', _('Opening book, please wait...'), self.book_opened, get_container, path, tdir=self.mkdtemp())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user