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"
}
+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
* (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)