From fbd01f2f7d74ed9f975e969d9e44397a6b3b9001 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 11 Mar 2020 10:46:08 +0100 Subject: [PATCH] DRC_TREE_MODEL: Fix incorrect display of DRC errors on linux+wxGTK 3.0 Fixes #4038 https://gitlab.com/kicad/code/kicad/issues/4038 --- pcbnew/drc/drc_tree_model.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pcbnew/drc/drc_tree_model.cpp b/pcbnew/drc/drc_tree_model.cpp index ec43ad33ca..57bb8c7ed6 100644 --- a/pcbnew/drc/drc_tree_model.cpp +++ b/pcbnew/drc/drc_tree_model.cpp @@ -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(); }