#include "support/debug.h"
#include "support/FileName.h"
+#include "support/filetools.h"
#include "support/Package.h"
#include "support/qstring_helpers.h"
struct TempFile::Private
{
///
- Private(QString const & mask) : f(mask)
+ explicit Private(QString const & mask) : f(mask)
{
LYXERR(Debug::FILES, "Temporary file in " << fromqstr(mask));
if (f.open())
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());
}
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());
}