TOOL_SETTINGS acquires wxConfigBase each time it is used.
This commit is contained in:
+15
-13
@@ -58,20 +58,9 @@ void TOOL_BASE::attachManager( TOOL_MANAGER* aManager )
|
||||
}
|
||||
|
||||
|
||||
TOOL_SETTINGS::TOOL_SETTINGS( TOOL_BASE* aTool )
|
||||
TOOL_SETTINGS::TOOL_SETTINGS( TOOL_BASE* aTool ) :
|
||||
m_tool( aTool )
|
||||
{
|
||||
m_tool = aTool;
|
||||
|
||||
if( !aTool )
|
||||
{
|
||||
m_config = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
// fixme: make independent of pcbnew (post-stable)
|
||||
PCB_EDIT_FRAME* frame = aTool->getEditFrame<PCB_EDIT_FRAME>();
|
||||
|
||||
m_config = frame->GetSettings();
|
||||
}
|
||||
|
||||
|
||||
@@ -93,3 +82,16 @@ wxString TOOL_SETTINGS::getKeyName( const wxString& aEntryName ) const
|
||||
key += aEntryName;
|
||||
return key;
|
||||
}
|
||||
|
||||
|
||||
wxConfigBase* TOOL_SETTINGS::getConfigBase() const
|
||||
{
|
||||
if( !m_tool )
|
||||
return NULL;
|
||||
|
||||
// fixme: make independent of pcbnew (post-stable)
|
||||
if( PCB_EDIT_FRAME* frame = m_tool->getEditFrame<PCB_EDIT_FRAME>() )
|
||||
return frame->GetSettings();
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user