Another attempt to fix qa error.

This commit is contained in:
Jeff Young 2023-07-03 15:51:09 +01:00
parent 80340c607c
commit 67c9d3932b
3 changed files with 18 additions and 13 deletions

View File

@ -42,19 +42,24 @@
using namespace std::placeholders; 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(); if( PCB_TOOL_BASE* pcb_tool = dynamic_cast<PCB_TOOL_BASE*>( aTool ) )
m_isFootprintEditor = aTool->IsFootprintEditor(); {
m_isBoardEditor = aTool->IsBoardEditor(); 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 );
} }

View File

@ -47,7 +47,7 @@ class BOARD_COMMIT : public COMMIT
{ {
public: public:
BOARD_COMMIT( EDA_DRAW_FRAME* aFrame ); BOARD_COMMIT( EDA_DRAW_FRAME* aFrame );
BOARD_COMMIT( PCB_TOOL_BASE *aTool ); BOARD_COMMIT( TOOL_BASE *aTool );
virtual ~BOARD_COMMIT(); virtual ~BOARD_COMMIT();

View File

@ -31,7 +31,7 @@
#include <mutex> #include <mutex>
#include <map> #include <map>
#include <reporter.h> #include <reporter.h>
#include <tools/pcb_tool_base.h> #include <tool/tool_manager.h>
class BOARD; class BOARD;
class BOARD_ITEM; class BOARD_ITEM;
@ -46,14 +46,14 @@ class SETTINGS_MANAGER;
namespace KI_TEST namespace KI_TEST
{ {
class DUMMY_TOOL : public PCB_TOOL_BASE class DUMMY_TOOL : public TOOL_BASE
{ {
public: public:
DUMMY_TOOL() : 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 {}
}; };