Browse Source

Read footprint info cache when fpinfo requested via kiway.

pull/13/head
Jeff Young 7 years ago
parent
commit
d52429fc3c
  1. 10
      common/footprint_info.cpp
  2. 5
      pcbnew/pcb_base_edit_frame.cpp

10
common/footprint_info.cpp

@ -142,7 +142,15 @@ static FOOTPRINT_LIST* get_instance_from_id( KIWAY& aKiway, int aId )
FOOTPRINT_LIST* FOOTPRINT_LIST::GetInstance( KIWAY& aKiway )
{
return get_instance_from_id( aKiway, KIFACE_FOOTPRINT_LIST );
FOOTPRINT_LIST* footprintInfo = get_instance_from_id( aKiway, KIFACE_FOOTPRINT_LIST );
if( !footprintInfo->GetCount() )
{
wxTextFile footprintInfoCache( aKiway.Prj().GetProjectPath() + "fp-info-cache" );
footprintInfo->ReadCacheFromFile( &footprintInfoCache );
}
return footprintInfo;
}

5
pcbnew/pcb_base_edit_frame.cpp

@ -38,13 +38,10 @@ PCB_BASE_EDIT_FRAME::PCB_BASE_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,
PCB_BASE_FRAME( aKiway, aParent, aFrameType, aTitle, aPos, aSize, aStyle, aFrameName ),
m_rotationAngle( 900 ), m_undoRedoBlocked( false )
{
static bool oneShot = true;
if( oneShot )
if( !GFootprintList.GetCount() )
{
wxTextFile footprintInfoCache( Prj().GetProjectPath() + "fp-info-cache" );
GFootprintList.ReadCacheFromFile( &footprintInfoCache );
oneShot = false;
}
}

Loading…
Cancel
Save