Le 04/11/2015 17:16, PhilipPirrip a écrit :

I personally find this very annoying. As a user. It doesn't happen on
Linux, so I'm still good, but on Windows:
I tested the patch on Windows, no messages were shown if LyX was closed,
Windows Explorer window would just close upon the deletion of the temp
folder. But, if I had Acrobat Reader open with the document still loaded
in, two error messages would pop out giving me totally irrelevant
information... I press ok, and than what? LyX is going to close anyway,
should I look for the temp folder and delete it myself?


I also agree that it's better to replace the alert with a message on
stderr. I noticed that there are already similar messages on the
terminal when files cannot be removed.

Attached is a patch. Shall I commit it?


On 11/03/2015 07:00 PM, Andrew Parsloe wrote:

I have found the message helpful, particularly when developing a
module or a latex package to work with LyX. In the latter case, the
failure to remove the temp directory may indicate that a latex
process is still running. (Failure of a preview snippet for
instance.) From experience I know that this can lead to multiple
occurrences of the latex executable running at once, and LyX
becoming more and more sluggish.

Do you have other examples of good informations you get from this
message? For running processes, I agree that it can be sometimes useful
although I find using a system monitor more useful. But it's
double-edged: I have already seen this message pop up because instant
preview was still running, for instance.
diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 847b029..8bdbd66 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -526,9 +526,8 @@ Buffer::~Buffer()
 		d->position_to_children.clear();
 
 		if (!d->temppath.destroyDirectory()) {
-			Alert::warning(_("Could not remove temporary directory"),
-				bformat(_("Could not remove the temporary directory %1$s"),
-				from_utf8(d->temppath.absFileName())));
+			LYXERR0(bformat(_("Could not remove the temporary directory %1$s"),
+							from_utf8(d->temppath.absFileName())));
 		}
 		removePreviews();
 	}
diff --git a/src/LyX.cpp b/src/LyX.cpp
index a1fdac9..fe4ba78 100644
--- a/src/LyX.cpp
+++ b/src/LyX.cpp
@@ -404,10 +404,8 @@ void LyX::prepareExit()
 			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);
+				LYXERR0(bformat(_("Unable to remove the temporary directory %1$s"),
+								from_utf8(package().temp_dir().absFileName())));
 			}
 		}
 	}

Reply via email to