IO_MGR::PCB_FILE_T IO_MGR::GuessPluginTypeFromLibPath() : better test for KICAD type footprint libraries: previoulsy, just test if a library name ends with .pretty, which is not enough.

GitHub lib names also ends  by .pretty, so also test if a lib name does not start by http (which could be a GitHub lib name).
This commit is contained in:
jean-pierre charras 2014-09-18 12:29:52 +02:00
parent 93a3d4cb28
commit 686253cbaa
3 changed files with 6 additions and 4 deletions

View File

@ -225,7 +225,6 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnTestChipName( wxCommandEvent& event )
msg.Printf( _( "Component '%s' not found in any library" ), GetChars( partname ) );
#ifdef KICAD_KEEPCASE
// Try to find components which have a name "near" the current chip name,
// i.e. the same name when the comparison is case insensitive.
// Could be helpful for old designs when lower cases and upper case were
@ -250,7 +249,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnTestChipName( wxCommandEvent& event )
GetChars( candidates[ii]->GetName() ),
GetChars( candidates[ii]->GetLibraryName() ) );
}
#endif
wxMessageBox( msg );
}

View File

@ -215,7 +215,11 @@ IO_MGR::PCB_FILE_T IO_MGR::GuessPluginTypeFromLibPath( const wxString& aLibPath
// mistakenly put a pretty library into a directory other than
// *.pretty/ with *.kicad_mod in there., and I don't want to return -1,
// since we only claimed to be guessing.
else if( fn.GetExt() == KiCadFootprintLibPathExtension )
//
// However libraries on GitHub have names ending by .pretty
// so test also this is not a name starting by http (including https).
else if( fn.GetExt() == KiCadFootprintLibPathExtension &&
!aLibPath.StartsWith( wxT( "http" ) ) )
{
ret = KICAD;
}

View File

@ -530,7 +530,6 @@ void FOOTPRINT_EDIT_FRAME::OnSaveLibraryAs( wxCommandEvent& aEvent )
PLUGIN::RELEASER dst( IO_MGR::PluginFind( dstType ) );
wxArrayString mods = cur->FootprintEnumerate( curLibPath );
for( unsigned i = 0; i < mods.size(); ++i )
{
std::auto_ptr<MODULE> m( cur->FootprintLoad( curLibPath, mods[i] ) );