From 67c9d3932bc97acb4fcb7bd93c0e70a5c3b16d20 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 3 Jul 2023 15:51:09 +0100 Subject: [PATCH] Another attempt to fix qa error. --- pcbnew/board_commit.cpp | 21 ++++++++++++------- pcbnew/board_commit.h | 2 +- .../include/pcbnew_utils/board_test_utils.h | 8 +++---- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/pcbnew/board_commit.cpp b/pcbnew/board_commit.cpp index 220dec3b92..b103f25536 100644 --- a/pcbnew/board_commit.cpp +++ b/pcbnew/board_commit.cpp @@ -42,19 +42,24 @@ using namespace std::placeholders; -BOARD_COMMIT::BOARD_COMMIT( PCB_TOOL_BASE* aTool ) +BOARD_COMMIT::BOARD_COMMIT( TOOL_BASE* aTool ) : + m_toolMgr( aTool->GetManager() ), + m_isFootprintEditor( false ), + m_isBoardEditor( false ) { - m_toolMgr = aTool->GetManager(); - m_isFootprintEditor = aTool->IsFootprintEditor(); - m_isBoardEditor = aTool->IsBoardEditor(); + if( PCB_TOOL_BASE* pcb_tool = dynamic_cast( aTool ) ) + { + m_isFootprintEditor = pcb_tool->IsFootprintEditor(); + m_isBoardEditor = pcb_tool->IsBoardEditor(); + } } -BOARD_COMMIT::BOARD_COMMIT( EDA_DRAW_FRAME* aFrame ) +BOARD_COMMIT::BOARD_COMMIT( EDA_DRAW_FRAME* aFrame ) : + m_toolMgr( aFrame->GetToolManager() ), + m_isFootprintEditor( aFrame->IsType( FRAME_FOOTPRINT_EDITOR ) ), + m_isBoardEditor( aFrame->IsType( FRAME_PCB_EDITOR ) ) { - m_toolMgr = aFrame->GetToolManager(); - m_isFootprintEditor = aFrame->IsType( FRAME_FOOTPRINT_EDITOR ); - m_isBoardEditor = aFrame->IsType( FRAME_PCB_EDITOR ); } diff --git a/pcbnew/board_commit.h b/pcbnew/board_commit.h index 7f90f1072e..ecb5d97a27 100644 --- a/pcbnew/board_commit.h +++ b/pcbnew/board_commit.h @@ -47,7 +47,7 @@ class BOARD_COMMIT : public COMMIT { public: BOARD_COMMIT( EDA_DRAW_FRAME* aFrame ); - BOARD_COMMIT( PCB_TOOL_BASE *aTool ); + BOARD_COMMIT( TOOL_BASE *aTool ); virtual ~BOARD_COMMIT(); diff --git a/qa/pcbnew_utils/include/pcbnew_utils/board_test_utils.h b/qa/pcbnew_utils/include/pcbnew_utils/board_test_utils.h index e7feff701f..4c79ae0218 100644 --- a/qa/pcbnew_utils/include/pcbnew_utils/board_test_utils.h +++ b/qa/pcbnew_utils/include/pcbnew_utils/board_test_utils.h @@ -31,7 +31,7 @@ #include #include #include -#include +#include class BOARD; class BOARD_ITEM; @@ -46,14 +46,14 @@ class SETTINGS_MANAGER; namespace KI_TEST { -class DUMMY_TOOL : public PCB_TOOL_BASE +class DUMMY_TOOL : public TOOL_BASE { public: DUMMY_TOOL() : - PCB_TOOL_BASE( "testframework.dummytool" ) + TOOL_BASE( BATCH, TOOL_MANAGER::MakeToolId( "" ), "testframework.dummytool" ) {}; - bool Init() override { return true }; + void Reset( RESET_REASON aReason ) override {} };