mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 05:25:26 +00:00
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:
parent
5bef46157c
commit
6751c8a72f
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user