From d20f36511f664422ad800a83294608c9b0ec5527 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 4 Mar 2020 18:04:14 +0000 Subject: [PATCH] Fix issue with severities not get initialised in DRC_TREE_MODELs. --- pcbnew/dialogs/dialog_drc.cpp | 4 ++++ pcbnew/drc/drc_tree_model.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pcbnew/dialogs/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp index 35800b1357..2b7b84f619 100644 --- a/pcbnew/dialogs/dialog_drc.cpp +++ b/pcbnew/dialogs/dialog_drc.cpp @@ -147,7 +147,11 @@ void DIALOG_DRC_CONTROL::initValues() m_cbRefillZones->SetValue( cfg->m_DrcDialog.refill_zones ); m_cbReportAllTrackErrors->SetValue( cfg->m_DrcDialog.test_track_to_zone ); m_cbTestFootprints->SetValue( cfg->m_DrcDialog.test_footprints ); + m_severities = cfg->m_DrcDialog.severities; + m_markerTreeModel->SetSeverities( m_severities ); + m_unconnectedTreeModel->SetSeverities( m_severities ); + m_footprintWarningsTreeModel->SetSeverities( m_severities ); Layout(); // adding the units above expanded Clearance text, now resize. diff --git a/pcbnew/drc/drc_tree_model.cpp b/pcbnew/drc/drc_tree_model.cpp index 676aea4efc..ca9e678fe8 100644 --- a/pcbnew/drc/drc_tree_model.cpp +++ b/pcbnew/drc/drc_tree_model.cpp @@ -82,7 +82,8 @@ void DRC_TREE_MODEL::rebuildModel( DRC_ITEMS_PROVIDER* aProvider, int aSeveritie // Even with the updateLock, wxWidgets sometimes ties its knickers in // a knot when trying to run a wxdataview_selection_changed_callback() // on a row that has been deleted. - m_view->UnselectAll(); + if( m_view ) + m_view->UnselectAll(); Cleared(); @@ -92,12 +93,11 @@ void DRC_TREE_MODEL::rebuildModel( DRC_ITEMS_PROVIDER* aProvider, int aSeveritie m_drcItemsProvider = aProvider; } - wxASSERT( m_drcItemsProvider ); - if( aSeverities != m_severities ) m_severities = aSeverities; - m_drcItemsProvider->SetSeverities( m_severities ); + if( m_drcItemsProvider ) + m_drcItemsProvider->SetSeverities( m_severities ); m_tree.clear();