]> git.lyx.org Git - lyx.git/blobdiff - src/support/TempFile.cpp
Provide option to prevent unnecessary font loading.
[lyx.git] / src / support / TempFile.cpp
index 21559e144fe5418d245701dc6520468098ccdd49..e8ee5586b481cd71ffe567d06561aa7cb34d3917 100644 (file)
@@ -14,6 +14,7 @@
 
 #include "support/debug.h"
 #include "support/FileName.h"
+#include "support/filetools.h"
 #include "support/Package.h"
 #include "support/qstring_helpers.h"
 
@@ -29,7 +30,7 @@ namespace support {
 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())
@@ -47,14 +48,16 @@ struct TempFile::Private
 
 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());
 }