Fix issue with severities not get initialised in DRC_TREE_MODELs.

This commit is contained in:
Jeff Young 2020-03-04 18:04:14 +00:00
parent 0894674869
commit d20f36511f
2 changed files with 8 additions and 4 deletions

View File

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

View File

@ -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();