]> git.lyx.org Git - features.git/commit
Re-add method to get a temporary file name without persistent QTemporaryFile object
authorJuergen Spitzmueller <spitz@lyx.org>
Thu, 8 Feb 2018 10:31:23 +0000 (11:31 +0100)
committerRichard Heck <rgheck@lyx.org>
Sat, 17 Mar 2018 19:44:05 +0000 (15:44 -0400)
commitcd51b9cca1b6aaebaefa733e517c6b3e65c4f76c
treef19ef3d233a4bb0b0daf6ea673bd8487671e13e9
parent7d98aebfd931894613f61bbac7f1f82b6e8561e8
Re-add method to get a temporary file name without persistent QTemporaryFile object

This is needed for cases where the temp file has to be manually removed
at some point (e.g., if temp files are used as conversion target, and
the initial file only serves as a placeholder), since QTemporaryFile
objects cannot be manually removed at least on Windows (they are always
kept open internally even after close()). See
​http://lists.qt-project.org/pipermail/interest/2013-August/008352.html

In order to avoid race conditions due to duplicate names (the issue why
the old method was removed), we record all used temp file names.

Fixes: #9139
(cherry picked from commit 9e2928be68992161a54287d153e1e9431e30bb4c)
src/Buffer.cpp
src/support/filetools.cpp
src/support/filetools.h