Set readable flags correctly on open
Missing files may be thrown during open. These should have existence
and readable flags set correctly
(cherry picked from commit a05ec04ee8
)
This commit is contained in:
parent
cd0ac9e698
commit
9ca41cc8ee
|
@ -628,8 +628,16 @@ void SCH_SEXPR_PLUGIN::loadHierarchy( SCH_SHEET* aSheet )
|
|||
m_error += ioe.What();
|
||||
}
|
||||
|
||||
aSheet->GetScreen()->SetFileReadOnly( !fileName.IsFileWritable() );
|
||||
aSheet->GetScreen()->SetFileExists( true );
|
||||
if( fileName.FileExists() )
|
||||
{
|
||||
aSheet->GetScreen()->SetFileReadOnly( !fileName.IsFileWritable() );
|
||||
aSheet->GetScreen()->SetFileExists( true );
|
||||
}
|
||||
else
|
||||
{
|
||||
aSheet->GetScreen()->SetFileReadOnly( !fileName.IsDirWritable() );
|
||||
aSheet->GetScreen()->SetFileExists( false );
|
||||
}
|
||||
|
||||
// This was moved out of the try{} block so that any sheets definitionsthat
|
||||
// the plugin fully parsed before the exception was raised will be loaded.
|
||||
|
|
Loading…
Reference in New Issue