]> git.lyx.org Git - features.git/commitdiff
Hopefully fix http://bugzilla.lyx.org/show_bug.cgi?id=4918
authorAbdelrazak Younes <younes@lyx.org>
Mon, 9 Jun 2008 13:05:24 +0000 (13:05 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Mon, 9 Jun 2008 13:05:24 +0000 (13:05 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25207 a592a061-630c-0410-9148-cb99ea01b6c8

src/LyX.cpp
src/support/Package.cpp
src/support/Package.h

index f2462aa44ef3caa80311366b98270549d00f99ba..794df0da687d2eb3788c0aaf99285319f0ef6de2 100644 (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"
index 3d6c2971d0839c709d16c86c5859ca365f4cd40b..80615ed5cd831be4fb300e82fe909efaaf270993 100644 (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
index bfd359faf186898153da81800bc961fe08a7dc9b..f5440b924a322b2ad3ca91539fd66bfe85c150ab 100644 (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)