}
+FileName const tempFileName(FileName tempdir, string const & mask, bool const dir)
+{
+ return tempFileName(TempFile(tempdir, mask).name(), dir);
+}
+
+
FileName const tempFileName(string const & mask, bool const dir)
{
- FileName tempfile = TempFile(mask).name();
+ return tempFileName(TempFile(mask).name(), dir);
+}
+
+
+FileName const tempFileName(FileName tempfile, bool const dir)
+{
// Since the QTemporaryFile object is destroyed at function return
// (which is what is intended here), the next call to this function
// may return the same file name again.
QFileInfo tmp_fi(QDir(toqstr(tempdir.absFileName())), toqstr(mask));
FileName const tmpfl =
- tempFileName(fromqstr(tmp_fi.absoluteFilePath()) + ".XXXXXXXXXXXX", true);
+ tempFileName(FileName(fromqstr(tmp_fi.absolutePath())),
+ fromqstr(tmp_fi.fileName()) + ".XXXXXXXXXXXX", true);
if (tmpfl.empty() || !tmpfl.createDirectory(0700)) {
LYXERR0("LyX could not create temporary directory in " << tempdir
* all used temp file names.
* If you don't have to remove the temp file manually, use TempFile instead!
*/
+FileName const tempFileName(FileName, bool const dir = false);
+/// Get temporary file name with custom path
+FileName const tempFileName(FileName, std::string const &, bool const dir = false);
+/// Get temporary file name with default path
FileName const tempFileName(std::string const &, bool const dir = false);
/// Remove and unregister a temporary file.