createLyXTmpDir(): Don't hardcode /tmp, use package().system_temp_dir() insetad.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25212 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-06-09 14:33:31 +00:00
parent d2969c7dc9
commit 7f4247e718

View File

@ -341,8 +341,8 @@ static FileName createTmpDir(FileName const & tempdir, string const & mask)
FileName const createLyXTmpDir(FileName const & deflt)
{
if (deflt.empty() || deflt.absFilename() == "/tmp")
return createTmpDir(FileName("/tmp"), "lyx_tmpdir");
if (deflt.empty() || deflt == package().system_temp_dir())
return createTmpDir(package().system_temp_dir(), "lyx_tmpdir");
if (deflt.createDirectory(0777))
return deflt;
@ -354,7 +354,7 @@ FileName const createLyXTmpDir(FileName const & deflt)
return createTmpDir(deflt, "lyx_tmpdir");
} else {
// some other error occured.
return createTmpDir(FileName("/tmp"), "lyx_tmpdir");
return createTmpDir(package().system_temp_dir(), "lyx_tmpdir");
}
}