diff --git a/common/footprint_info.cpp b/common/footprint_info.cpp index 5a8c7d6fac..f094819a9c 100644 --- a/common/footprint_info.cpp +++ b/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; } diff --git a/pcbnew/pcb_base_edit_frame.cpp b/pcbnew/pcb_base_edit_frame.cpp index aaf1ceba4d..28efcd0b6f 100644 --- a/pcbnew/pcb_base_edit_frame.cpp +++ b/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; } }