// do any other cleanup procedures now
if (package().temp_dir() != package().system_temp_dir()) {
- LYXERR(Debug::INFO, "Deleting tmp dir "
- << package().temp_dir().absFilename());
-
- if (!package().temp_dir().destroyDirectory()) {
+ string const abs_tmpdir = package().temp_dir().absFilename();
+ if (!contains(package().temp_dir().absFilename(), "lyx_tmpdir")) {
docstring const msg =
- bformat(_("Unable to remove the temporary directory %1$s"),
- from_utf8(package().temp_dir().absFilename()));
- Alert::warning(_("Unable to remove temporary directory"), msg);
+ bformat(_("%1$s does not appear like a LyX created temporary directory."),
+ from_utf8(abs_tmpdir));
+ Alert::warning(_("Cannot remove temporary directory"), msg);
+ } else {
+ LYXERR(Debug::INFO, "Deleting tmp dir "
+ << package().temp_dir().absFilename());
+ if (!package().temp_dir().destroyDirectory()) {
+ docstring const msg =
+ bformat(_("Unable to remove the temporary directory %1$s"),
+ from_utf8(package().temp_dir().absFilename()));
+ Alert::warning(_("Unable to remove temporary directory"), msg);
+ }
}
}
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"
- "%1$s. Make sure that this\n"
- "path exists and is writable and try again."),
+ "\"%1$s\"\n"
+ "Make sure that this path exists and is writable and try again."),
from_utf8(lyxrc.tempdir_path)));
// createLyXTmpDir() tries sufficiently hard to create a
// usable temp dir, so the probability to come here is