Handle the case where a file exists but is not readable by the current user.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22686 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2008-01-26 20:37:54 +00:00
parent 5bef46157c
commit 6751c8a72f

View File

@ -80,7 +80,14 @@ Buffer * checkAndLoadLyXFile(FileName const & filename)
return checkAndLoadLyXFile(filename);
}
if (filename.isReadableFile()) {
if (filename.exists()) {
if (!filename.isReadableFile()) {
docstring text = bformat(_("The file %1$s exists but is not "
"readable by the current user."),
from_utf8(filename.absFilename()));
Alert::error(_("File not readable!"), text);
return 0;
}
Buffer * b = theBufferList().newBuffer(filename.absFilename());
if (!b)
// Buffer creation is not possible.