Commit 686253cb authored by jean-pierre charras's avatar jean-pierre charras

IO_MGR::PCB_FILE_T IO_MGR::GuessPluginTypeFromLibPath() : better test for...

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).
parent 93a3d4cb
...@@ -225,7 +225,6 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnTestChipName( wxCommandEvent& event ) ...@@ -225,7 +225,6 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnTestChipName( wxCommandEvent& event )
msg.Printf( _( "Component '%s' not found in any library" ), GetChars( partname ) ); 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, // Try to find components which have a name "near" the current chip name,
// i.e. the same name when the comparison is case insensitive. // i.e. the same name when the comparison is case insensitive.
// Could be helpful for old designs when lower cases and upper case were // 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 ) ...@@ -250,7 +249,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnTestChipName( wxCommandEvent& event )
GetChars( candidates[ii]->GetName() ), GetChars( candidates[ii]->GetName() ),
GetChars( candidates[ii]->GetLibraryName() ) ); GetChars( candidates[ii]->GetLibraryName() ) );
} }
#endif
wxMessageBox( msg ); wxMessageBox( msg );
} }
......
...@@ -215,7 +215,11 @@ IO_MGR::PCB_FILE_T IO_MGR::GuessPluginTypeFromLibPath( const wxString& aLibPath ...@@ -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 // mistakenly put a pretty library into a directory other than
// *.pretty/ with *.kicad_mod in there., and I don't want to return -1, // *.pretty/ with *.kicad_mod in there., and I don't want to return -1,
// since we only claimed to be guessing. // 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; ret = KICAD;
} }
......
...@@ -530,7 +530,6 @@ void FOOTPRINT_EDIT_FRAME::OnSaveLibraryAs( wxCommandEvent& aEvent ) ...@@ -530,7 +530,6 @@ void FOOTPRINT_EDIT_FRAME::OnSaveLibraryAs( wxCommandEvent& aEvent )
PLUGIN::RELEASER dst( IO_MGR::PluginFind( dstType ) ); PLUGIN::RELEASER dst( IO_MGR::PluginFind( dstType ) );
wxArrayString mods = cur->FootprintEnumerate( curLibPath ); wxArrayString mods = cur->FootprintEnumerate( curLibPath );
for( unsigned i = 0; i < mods.size(); ++i ) for( unsigned i = 0; i < mods.size(); ++i )
{ {
std::auto_ptr<MODULE> m( cur->FootprintLoad( curLibPath, mods[i] ) ); std::auto_ptr<MODULE> m( cur->FootprintLoad( curLibPath, mods[i] ) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment