← Back to team overview

kicad-developers team mailing list archive

Partial fix for Bug #1737132

 

Hi Orson,

Could you have a look into this patch.

It fixes the Bug #1737132 (component tree widget cleared in lib editor after any change in symbol),
but there is still a minor issue.

The reason the component tree widget was cleared on Windows is the fact
m_adapter->UpdateSearchString( m_query_ctrl->GetLineText( 0 ) )
is called on any change of the symbol.
But if m_query_ctrl is empty, m_query_ctrl->GetLineText( 0 ) returns the "hint" (currently the word
"Search") not the actual value, so there is no "candidate" symbol in list.
Using m_query_ctrl->GetValue() returns the actual value and fixes this issue.

However I still have an other (minor but annoying) issue:
When the current symbol is edited, the selection in the tree changes after each edition:
sometimes the previous tree item is selected, sometimes the next item, and sometimes it does not happen.
It does not happen for each symbol, so perhaps this issue depends on the phase of the moon.

Thanks

-- 
Jean-Pierre CHARRAS
 eeschema/widgets/component_tree.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/eeschema/widgets/component_tree.cpp b/eeschema/widgets/component_tree.cpp
index 7e2119d..0197e27 100644
--- a/eeschema/widgets/component_tree.cpp
+++ b/eeschema/widgets/component_tree.cpp
@@ -149,8 +149,9 @@ void COMPONENT_TREE::Regenerate()
     else
         current = getState();
 
-    m_adapter->UpdateSearchString( m_query_ctrl->GetLineText( 0 ) );
-    m_filtering = !m_query_ctrl->IsEmpty();
+    wxString filter = m_query_ctrl->GetValue();
+    m_adapter->UpdateSearchString( filter );
+    m_filtering = !filter.IsEmpty();
     postPreselectEvent();
 
     // Restore the state

Follow ups