Component Chooser: do not create FP list when the FP preview is disabled

This commit is contained in:
Maciej Suminski 2018-05-30 09:51:47 +02:00
parent 52fceb3243
commit 8c63dac0c3
2 changed files with 3 additions and 4 deletions

View File

@ -65,8 +65,6 @@ DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT( SCH_BASE_FRAME* aParent, const
m_load_footprints( aShowFootprints ),
m_external_browser_requested( false )
{
m_fp_list = FOOTPRINT_LIST::GetInstance( Kiway() );
auto sizer = new wxBoxSizer( wxVERTICAL );
// Use a slightly different layout, with a details pane spanning the entire window,
@ -161,8 +159,10 @@ wxPanel* DIALOG_CHOOSE_COMPONENT::ConstructRightPanel( wxWindow* aParent )
if( m_show_footprints )
{
FOOTPRINT_LIST* fp_list = FOOTPRINT_LIST::GetInstance( Kiway() );
if( m_allow_field_edits )
m_fp_sel_ctrl = new FOOTPRINT_SELECT_WIDGET( panel, m_fp_list, true );
m_fp_sel_ctrl = new FOOTPRINT_SELECT_WIDGET( panel, fp_list, true );
m_fp_view_ctrl = new FOOTPRINT_PREVIEW_WIDGET( panel, Kiway() );

View File

@ -211,7 +211,6 @@ protected:
bool m_external_browser_requested;
wxString m_fp_override;
FOOTPRINT_LIST* m_fp_list;
std::vector<std::pair<int, wxString>> m_field_edits;
// Remember the dialog size during a session