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

(cherry picked from commit cb620338db)
9.0
Seth Hillbrand 2 months ago
parent
commit
f13c9cbd49
  1. 8
      pcbnew/footprint_viewer_frame.cpp

8
pcbnew/footprint_viewer_frame.cpp

@ -538,7 +538,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 )
{
@ -559,6 +562,9 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList()
{
m_fpList->SetSelection( index, true );
m_fpList->EnsureVisible( index );
wxCommandEvent dummy;
ClickOnFootprintList( dummy );
}
}

Loading…
Cancel
Save