From 45ba00ac22e7825832c258a146925e344391a822 Mon Sep 17 00:00:00 2001 From: Mike Williams Date: Mon, 3 Feb 2025 10:24:46 -0500 Subject: [PATCH] design blocks: point to new lib table on project change Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19783 --- eeschema/design_block_tree_model_adapter.h | 2 ++ eeschema/widgets/panel_design_block_chooser.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/eeschema/design_block_tree_model_adapter.h b/eeschema/design_block_tree_model_adapter.h index c7903a9a9d..b8e46e1cbd 100644 --- a/eeschema/design_block_tree_model_adapter.h +++ b/eeschema/design_block_tree_model_adapter.h @@ -44,6 +44,8 @@ public: TOOL_INTERACTIVE* GetContextMenuTool() override; + void SetLibTable( DESIGN_BLOCK_LIB_TABLE* aLibs ) { m_libs = aLibs; } + protected: /** * Constructor; takes a set of libraries to be included in the search. diff --git a/eeschema/widgets/panel_design_block_chooser.cpp b/eeschema/widgets/panel_design_block_chooser.cpp index 5a757268c5..e71e769016 100644 --- a/eeschema/widgets/panel_design_block_chooser.cpp +++ b/eeschema/widgets/panel_design_block_chooser.cpp @@ -265,6 +265,7 @@ void PANEL_DESIGN_BLOCK_CHOOSER::RefreshLibs( bool aProgress ) // Read the libraries from disk if they've changed DESIGN_BLOCK_LIB_TABLE* fpTable = m_frame->Prj().DesignBlockLibs(); + adapter->SetLibTable( fpTable ); // Sync FOOTPRINT_INFO list to the libraries on disk if( aProgress )