From eb855d40bb8b372df1ef572eb90c4e4192dc8cd0 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 30 Mar 2020 17:27:33 +0100 Subject: [PATCH] Restore lib tree refreshing, but don't attempt to refresh tree root. --- common/lib_tree_model_adapter.cpp | 5 +++-- common/widgets/lib_tree.cpp | 7 ------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/common/lib_tree_model_adapter.cpp b/common/lib_tree_model_adapter.cpp index a5b7253954..41a7eaa074 100644 --- a/common/lib_tree_model_adapter.cpp +++ b/common/lib_tree_model_adapter.cpp @@ -394,10 +394,11 @@ void LIB_TREE_MODEL_ADAPTER::RefreshTree( LIB_TREE_NODE* aNode ) for( auto const& child: aNode->m_Children ) { if( child->m_Score > 0 ) + { RefreshTree( child.get() ); + ItemChanged( ToItem( aNode ) ); + } } - - ItemChanged( ToItem( aNode ) ); } diff --git a/common/widgets/lib_tree.cpp b/common/widgets/lib_tree.cpp index ec17683f4d..1d4c7b67d3 100644 --- a/common/widgets/lib_tree.cpp +++ b/common/widgets/lib_tree.cpp @@ -216,14 +216,7 @@ void LIB_TREE::Regenerate( bool aKeepState ) void LIB_TREE::RefreshLibTree() { - // m_adapter->RefreshTree() does not work fine on Windows. - // It creates a lot of wxWidgets alerts. - // calling Refresh of the wxPanel is enough -#ifdef _WINDOWS_ - Refresh(); -#else m_adapter->RefreshTree(); -#endif }