Read footprint info cache when fpinfo requested via kiway.

This commit is contained in:
Jeff Young 2018-08-05 00:07:25 +01:00
parent c1cf7c32c3
commit d52429fc3c
2 changed files with 10 additions and 5 deletions

View File

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

View File

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