Fixed disappearing components in COMPONENT_TREE in library editor

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.

Fixes: lp:1737132
* https://bugs.launchpad.net/kicad/+bug/1737132
This commit is contained in:
jean-pierre charras 2017-12-13 10:33:04 +01:00 committed by Maciej Suminski
parent 8e764f85a4
commit 33c2d6e4ba
1 changed files with 3 additions and 2 deletions

View File

@ -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