Browse Source

Check for read permissions before trying to import schematic file

This will display a better error message to the user, instead of saying
that no plugins to load the file are found (because the plugin tests
will also fail due to being unable to read the file).
newinvert
Ian McInerney 2 years ago
committed by Ian McInerney
parent
commit
e67eae90e9
  1. 6
      eeschema/files-io.cpp

6
eeschema/files-io.cpp

@ -758,6 +758,12 @@ void SCH_EDIT_FRAME::OnImportProject( wxCommandEvent& aEvent )
wxFileName fn = dlg.GetPath();
if( !fn.IsFileReadable() )
{
wxLogError( _( "Insufficient permissions to read file '%s'." ), fn.GetFullPath() );
return;
}
SCH_IO_MGR::SCH_FILE_T pluginType = SCH_IO_MGR::SCH_FILE_T::SCH_FILE_UNKNOWN;
for( const SCH_IO_MGR::SCH_FILE_T& fileType : SCH_IO_MGR::SCH_FILE_T_vector )

Loading…
Cancel
Save