DRC_TREE_MODEL: Fix incorrect display of DRC errors on linux+wxGTK 3.0

Fixes #4038
https://gitlab.com/kicad/code/kicad/issues/4038
This commit is contained in:
jean-pierre charras 2020-03-11 10:46:08 +01:00
parent 51b9944667
commit fbd01f2f7d
1 changed files with 4 additions and 4 deletions

View File

@ -113,6 +113,10 @@ void DRC_TREE_MODEL::rebuildModel( DRC_ITEMS_PROVIDER* aProvider, int aSeveritie
n->m_Children.push_back( new DRC_TREE_NODE( n, drcItem, DRC_TREE_NODE::AUX_ITEM ) );
}
// Must be called after a significant change of items to force the
// wxDataViewModel to reread all of them, repopulating itself entirely.
Cleared();
#ifdef __WXGTK__
// The fastest method to update wxDataViewCtrl is to rebuild from
// scratch by calling Cleared(). Linux requires to reassociate model to
@ -126,10 +130,6 @@ void DRC_TREE_MODEL::rebuildModel( DRC_ITEMS_PROVIDER* aProvider, int aSeveritie
int width = m_view->GetMainWindow()->GetRect().GetWidth() - WX_DATAVIEW_WINDOW_PADDING;
m_view->AppendTextColumn( wxEmptyString, 0, wxDATAVIEW_CELL_INERT, width );
// Must be called after a significant change to force the wxDataViewModel
// to reread all of them, repopulating itself entirely.
Cleared();
ExpandAll();
}