mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-26 14:15:32 +00:00
First part of http://bugzilla.lyx.org/show_bug.cgi?id=4918
Prevent deletion of LyX temporary directory is this is not a LyX created directory. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25199 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
dbc07ef630
commit
48cd43fd51
21
src/LyX.cpp
21
src/LyX.cpp
@ -463,14 +463,21 @@ void LyX::prepareExit()
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user