From 7300640da004b52fe729d63279fe5994e35dc54f Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 26 Sep 2020 16:48:36 +0100 Subject: [PATCH] Reload DRC rules on MODEL_RELOAD. Fixes https://gitlab.com/kicad/code/kicad/issues/5794 --- pcbnew/tools/drc_tool.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pcbnew/tools/drc_tool.cpp b/pcbnew/tools/drc_tool.cpp index 09f65f7d32..a09d7a60ae 100644 --- a/pcbnew/tools/drc_tool.cpp +++ b/pcbnew/tools/drc_tool.cpp @@ -63,6 +63,19 @@ void DRC_TOOL::Reset( RESET_REASON aReason ) m_pcb = m_editFrame->GetBoard(); m_drcEngine = m_pcb->GetDesignSettings().m_DRCEngine; } + + if( aReason == MODEL_RELOAD ) + { + try + { + m_drcEngine->InitEngine( m_editFrame->GetDesignRulesPath() ); + } + catch( PARSE_ERROR& pe ) + { + // Not sure this is the best place to tell the user their rules are buggy, so + // we'll stay quiet for now. Feel free to revisit this decision.... + } + } }