Set readable flags correctly on open

Missing files may be thrown during open.  These should have existence
and readable flags set correctly
This commit is contained in:
Seth Hillbrand 2022-01-05 09:54:10 -08:00
parent 362eedc510
commit a05ec04ee8
1 changed files with 10 additions and 2 deletions

View File

@ -648,8 +648,16 @@ void SCH_SEXPR_PLUGIN::loadHierarchy( SCH_SHEET* aSheet )
m_error += ioe.What(); m_error += ioe.What();
} }
if( fileName.FileExists() )
{
aSheet->GetScreen()->SetFileReadOnly( !fileName.IsFileWritable() ); aSheet->GetScreen()->SetFileReadOnly( !fileName.IsFileWritable() );
aSheet->GetScreen()->SetFileExists( true ); 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 // 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. // the plugin fully parsed before the exception was raised will be loaded.