From 686253cbaa77337d2e679e53710c51bf326aae03 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 18 Sep 2014 12:29:52 +0200 Subject: [PATCH] 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). --- eeschema/dialogs/dialog_edit_component_in_schematic.cpp | 3 +-- pcbnew/io_mgr.cpp | 6 +++++- pcbnew/loadcmp.cpp | 1 - 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/eeschema/dialogs/dialog_edit_component_in_schematic.cpp b/eeschema/dialogs/dialog_edit_component_in_schematic.cpp index 4a7e637017..2cce38f859 100644 --- a/eeschema/dialogs/dialog_edit_component_in_schematic.cpp +++ b/eeschema/dialogs/dialog_edit_component_in_schematic.cpp @@ -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 ); } diff --git a/pcbnew/io_mgr.cpp b/pcbnew/io_mgr.cpp index f29fe6fe23..c733d30441 100644 --- a/pcbnew/io_mgr.cpp +++ b/pcbnew/io_mgr.cpp @@ -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; } diff --git a/pcbnew/loadcmp.cpp b/pcbnew/loadcmp.cpp index a5da9dc222..cc740ba166 100644 --- a/pcbnew/loadcmp.cpp +++ b/pcbnew/loadcmp.cpp @@ -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 m( cur->FootprintLoad( curLibPath, mods[i] ) );