git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25207 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-06-09 13:05:24 +00:00
parent 5e6a1a3da8
commit 430296f4af
3 changed files with 14 additions and 2 deletions

View File

@ -846,7 +846,7 @@ bool LyX::init()
if (document_path.exists() && document_path.isDirectory())
package().document_dir() = document_path;
package().temp_dir() = createLyXTmpDir(FileName(lyxrc.tempdir_path));
package().set_temp_dir(createLyXTmpDir(FileName(lyxrc.tempdir_path)));
if (package().temp_dir().empty()) {
Alert::error(_("Could not create temporary directory"),
bformat(_("Could not create a temporary directory in\n"

View File

@ -162,6 +162,15 @@ Package::Package(string const & command_line_arg0,
}
void Package::set_temp_dir(FileName const & temp_dir) const
{
if (temp_dir.empty())
temp_dir_ = system_temp_dir_;
else
temp_dir_ = temp_dir;
}
namespace {
// These next functions contain the stuff that is substituted at

View File

@ -116,7 +116,10 @@ public:
* (Eg /tmp/lyx_tmpdir800nBI1z9 on *nix.)
* Can be reset by LyXRC.
*/
FileName & temp_dir() const { return temp_dir_; }
//@{
FileName const & temp_dir() const { return temp_dir_; }
void set_temp_dir(FileName const & temp_dir) const;
//@}
/** Used when setting the user_support directory.
* Used also when expanding "~/" or contracting to "~/". (filetools.cpp)