From ee145f2a7474f329b2a856744de22a01fcb60283 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Mon, 7 Jul 2014 21:56:36 +0200 Subject: [PATCH] Backport temp file changes from bf782ee This is a tiny part of the commit which is needed for other thread-safety fixes. --- src/support/TempFile.cpp | 5 +++++ src/support/TempFile.h | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/src/support/TempFile.cpp b/src/support/TempFile.cpp index 5c4b389b84..21559e144f 100644 --- a/src/support/TempFile.cpp +++ b/src/support/TempFile.cpp @@ -74,5 +74,10 @@ FileName TempFile::name() const } +void TempFile::setAutoRemove(bool autoremove) +{ + d->f.setAutoRemove(autoremove); +} + } // namespace support } // namespace lyx diff --git a/src/support/TempFile.h b/src/support/TempFile.h index 2adbb9f8de..42c1103d12 100644 --- a/src/support/TempFile.h +++ b/src/support/TempFile.h @@ -46,6 +46,13 @@ public: * This is empty if the file could not be created. */ FileName name() const; + /** + * Set whether the file should be automatically deleted in the + * destructor. + * Automatic deletion is the default, but it can be switched off if + * the file should be kept, because it should be renamed afterwards. + */ + void setAutoRemove(bool autoremove); private: /// struct Private; -- 2.39.5