mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
Make sure a temporary file is always created in the global temporary dir.
This commit is contained in:
parent
d752334ec4
commit
cbad159ac2
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "support/debug.h"
|
#include "support/debug.h"
|
||||||
#include "support/FileName.h"
|
#include "support/FileName.h"
|
||||||
|
#include "support/filetools.h"
|
||||||
#include "support/Package.h"
|
#include "support/Package.h"
|
||||||
#include "support/qstring_helpers.h"
|
#include "support/qstring_helpers.h"
|
||||||
|
|
||||||
@ -47,14 +48,16 @@ struct TempFile::Private
|
|||||||
|
|
||||||
TempFile::TempFile(FileName const & temp_dir, string const & mask)
|
TempFile::TempFile(FileName const & temp_dir, string const & mask)
|
||||||
{
|
{
|
||||||
QFileInfo tmp_fi(QDir(toqstr(temp_dir.absoluteFilePath())), toqstr(mask));
|
QFileInfo tmp_fi(QDir(toqstr(temp_dir.absoluteFilePath())),
|
||||||
|
toqstr(onlyFileName(mask)));
|
||||||
d = new Private(tmp_fi.absoluteFilePath());
|
d = new Private(tmp_fi.absoluteFilePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TempFile::TempFile(string const & mask)
|
TempFile::TempFile(string const & mask)
|
||||||
{
|
{
|
||||||
QFileInfo tmp_fi(QDir(toqstr(package().temp_dir().absoluteFilePath())), toqstr(mask));
|
QFileInfo tmp_fi(QDir(toqstr(package().temp_dir().absoluteFilePath())),
|
||||||
|
toqstr(onlyFileName(mask)));
|
||||||
d = new Private(tmp_fi.absoluteFilePath());
|
d = new Private(tmp_fi.absoluteFilePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,9 +33,9 @@ class TempFile {
|
|||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
*Create a temporary file with the given mask.
|
*Create a temporary file with the given mask.
|
||||||
* \p mask must be in filesystem encoding, if it contains a
|
* \p mask must be in filesystem encoding, the template file
|
||||||
* relative path, the template file will be created in the global
|
* will be created in the global temporary directory as given
|
||||||
* temporary directory as given by 'package().temp_dir()'.
|
* by 'package().temp_dir()'.
|
||||||
* If the mask contains "XXXXXX" this portion will be replaced by
|
* If the mask contains "XXXXXX" this portion will be replaced by
|
||||||
* a uniquely generated string. If it does not contain this portion,
|
* a uniquely generated string. If it does not contain this portion,
|
||||||
* it will be automatically appended using a dot. Therefore, please
|
* it will be automatically appended using a dot. Therefore, please
|
||||||
|
Loading…
Reference in New Issue
Block a user