kicad_plugin.cpp: fix incorrect detection of existing footprints in PCB_IO::FootprintExists(), when fp names contain a point.

Fixes: lp:1837221
https://bugs.launchpad.net/kicad/+bug/1837221
This commit is contained in:
jean-pierre charras 2019-07-19 18:15:23 +02:00
parent 9fae30162d
commit b4fc78fc0d
3 changed files with 10 additions and 10 deletions

View File

@ -2108,9 +2108,9 @@ bool PCB_IO::FootprintExists( const wxString& aLibraryPath, const wxString& aFoo
//
// Since this goes out to the native filesystem, we get platform differences (ie: MSW's
// case-insensitive filesystem) handled "for free".
wxFileName footprintFile( aLibraryPath, aFootprintName );
footprintFile.SetExt( KiCadFootprintFileExtension );
// Warning: footprint names frequently contain a point. So be careful when initializing
// wxFileName, and use a CTOR with extension specified
wxFileName footprintFile( aLibraryPath, aFootprintName, KiCadFootprintFileExtension );
return footprintFile.Exists();
}

View File

@ -73,7 +73,7 @@ public:
*/
inline void SetClickHandler( CLICK_HANDLER aHandler )
{
assert( !m_clickHandler );
wxASSERT( !m_clickHandler );
m_clickHandler = aHandler;
}
@ -93,7 +93,7 @@ public:
*/
inline void SetCancelHandler( CANCEL_HANDLER aHandler )
{
assert( !m_cancelHandler );
wxASSERT( !m_cancelHandler );
m_cancelHandler = aHandler;
}
@ -103,7 +103,7 @@ public:
*/
inline void SetFinalizeHandler( FINALIZE_HANDLER aHandler )
{
assert( !m_finalizeHandler );
wxASSERT( !m_finalizeHandler );
m_finalizeHandler = aHandler;
}