Browse Source

Prevent stale names in fp browser

When switching libraries, if there is an additional footprint with the
same name, we don't want to select it by default as this will prevent
updating the footprint display.  Instead, force the update

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9763
master
Seth Hillbrand 2 months ago
parent
commit
cb620338db
  1. 8
      pcbnew/footprint_viewer_frame.cpp

8
pcbnew/footprint_viewer_frame.cpp

@ -534,7 +534,10 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList()
m_fpList->Append( footprint->GetFootprintName() );
}
int index = m_fpList->FindString( getCurFootprintName(), true );
int index = wxNOT_FOUND;
if( !getCurFootprintName().IsEmpty() )
index = m_fpList->FindString( getCurFootprintName(), true );
if( index == wxNOT_FOUND )
{
@ -555,6 +558,9 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList()
{
m_fpList->SetSelection( index, true );
m_fpList->EnsureVisible( index );
wxCommandEvent dummy;
ClickOnFootprintList( dummy );
}
}

Loading…
Cancel
Save