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
This commit is contained in:
Seth Hillbrand 2025-08-26 06:19:59 -07:00
parent dad60f99c0
commit cb620338db

View File

@ -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 );
}
}