Clearer naming.
This commit is contained in:
parent
2f3c0a608d
commit
a4a946ab75
|
@ -177,9 +177,9 @@ void LIB_TREE_NODE_UNIT::UpdateScore( EDA_COMBINED_MATCHER* aMatcher, const wxSt
|
|||
}
|
||||
|
||||
|
||||
LIB_TREE_NODE_LIB_ITEM::LIB_TREE_NODE_LIB_ITEM( LIB_TREE_NODE* aParent, LIB_TREE_ITEM* aItem )
|
||||
LIB_TREE_NODE_ITEM::LIB_TREE_NODE_ITEM( LIB_TREE_NODE* aParent, LIB_TREE_ITEM* aItem )
|
||||
{
|
||||
m_Type = LIB_ITEM;
|
||||
m_Type = ITEM;
|
||||
m_Parent = aParent;
|
||||
|
||||
m_LibId.SetLibNickname( aItem->GetLibNickname() );
|
||||
|
@ -204,7 +204,7 @@ LIB_TREE_NODE_LIB_ITEM::LIB_TREE_NODE_LIB_ITEM( LIB_TREE_NODE* aParent, LIB_TREE
|
|||
}
|
||||
|
||||
|
||||
LIB_TREE_NODE_UNIT& LIB_TREE_NODE_LIB_ITEM::AddUnit( LIB_TREE_ITEM* aItem, int aUnit )
|
||||
LIB_TREE_NODE_UNIT& LIB_TREE_NODE_ITEM::AddUnit( LIB_TREE_ITEM* aItem, int aUnit )
|
||||
{
|
||||
LIB_TREE_NODE_UNIT* unit = new LIB_TREE_NODE_UNIT( this, aItem, aUnit );
|
||||
m_Children.push_back( std::unique_ptr<LIB_TREE_NODE>( unit ) );
|
||||
|
@ -212,7 +212,7 @@ LIB_TREE_NODE_UNIT& LIB_TREE_NODE_LIB_ITEM::AddUnit( LIB_TREE_ITEM* aItem, int a
|
|||
}
|
||||
|
||||
|
||||
void LIB_TREE_NODE_LIB_ITEM::Update( LIB_TREE_ITEM* aItem )
|
||||
void LIB_TREE_NODE_ITEM::Update( LIB_TREE_ITEM* aItem )
|
||||
{
|
||||
m_LibId.SetLibNickname( aItem->GetLibId().GetLibNickname() );
|
||||
m_LibId.SetLibItemName( aItem->GetName() );
|
||||
|
@ -232,8 +232,8 @@ void LIB_TREE_NODE_LIB_ITEM::Update( LIB_TREE_ITEM* aItem )
|
|||
}
|
||||
|
||||
|
||||
void LIB_TREE_NODE_LIB_ITEM::UpdateScore( EDA_COMBINED_MATCHER* aMatcher, const wxString& aLib,
|
||||
std::function<bool( LIB_TREE_NODE& aNode )>* aFilter )
|
||||
void LIB_TREE_NODE_ITEM::UpdateScore( EDA_COMBINED_MATCHER* aMatcher, const wxString& aLib,
|
||||
std::function<bool( LIB_TREE_NODE& aNode )>* aFilter )
|
||||
{
|
||||
// aMatcher test is additive
|
||||
if( aMatcher )
|
||||
|
@ -269,9 +269,9 @@ LIB_TREE_NODE_LIBRARY::LIB_TREE_NODE_LIBRARY( LIB_TREE_NODE* aParent, wxString c
|
|||
}
|
||||
|
||||
|
||||
LIB_TREE_NODE_LIB_ITEM& LIB_TREE_NODE_LIBRARY::AddItem( LIB_TREE_ITEM* aItem )
|
||||
LIB_TREE_NODE_ITEM& LIB_TREE_NODE_LIBRARY::AddItem( LIB_TREE_ITEM* aItem )
|
||||
{
|
||||
LIB_TREE_NODE_LIB_ITEM* item = new LIB_TREE_NODE_LIB_ITEM( this, aItem );
|
||||
LIB_TREE_NODE_ITEM* item = new LIB_TREE_NODE_ITEM( this, aItem );
|
||||
m_Children.push_back( std::unique_ptr<LIB_TREE_NODE>( item ) );
|
||||
return *item;
|
||||
}
|
||||
|
|
|
@ -418,7 +418,7 @@ unsigned int LIB_TREE_MODEL_ADAPTER::GetChildren( const wxDataViewItem& aItem,
|
|||
|
||||
if( node->m_Type == LIB_TREE_NODE::TYPE::ROOT
|
||||
|| node->m_Type == LIB_TREE_NODE::LIBRARY
|
||||
|| ( m_show_units && node->m_Type == LIB_TREE_NODE::TYPE::LIB_ITEM ) )
|
||||
|| ( m_show_units && node->m_Type == LIB_TREE_NODE::TYPE::ITEM ) )
|
||||
{
|
||||
for( std::unique_ptr<LIB_TREE_NODE> const& child: node->m_Children )
|
||||
{
|
||||
|
@ -592,7 +592,7 @@ bool LIB_TREE_MODEL_ADAPTER::GetAttr( const wxDataViewItem& aItem,
|
|||
LIB_TREE_NODE* node = ToNode( aItem );
|
||||
wxCHECK( node, false );
|
||||
|
||||
if( node->m_Type == LIB_TREE_NODE::LIB_ITEM )
|
||||
if( node->m_Type == LIB_TREE_NODE::ITEM )
|
||||
{
|
||||
if( !node->m_IsRoot && aCol == 0 )
|
||||
{
|
||||
|
@ -626,7 +626,7 @@ const LIB_TREE_NODE* LIB_TREE_MODEL_ADAPTER::ShowResults()
|
|||
recursiveDescent( m_tree,
|
||||
[&]( const LIB_TREE_NODE* n )
|
||||
{
|
||||
if( n->m_Type == LIB_TREE_NODE::TYPE::LIB_ITEM && n->m_Score > 1 )
|
||||
if( n->m_Type == LIB_TREE_NODE::TYPE::ITEM && n->m_Score > 1 )
|
||||
{
|
||||
if( !firstMatch )
|
||||
firstMatch = n;
|
||||
|
@ -645,7 +645,7 @@ const LIB_TREE_NODE* LIB_TREE_MODEL_ADAPTER::ShowResults()
|
|||
recursiveDescent( m_tree,
|
||||
[&]( const LIB_TREE_NODE* n )
|
||||
{
|
||||
if( n->m_Type == LIB_TREE_NODE::LIB_ITEM
|
||||
if( n->m_Type == LIB_TREE_NODE::ITEM
|
||||
&& ( n->m_Children.empty() || !m_preselect_unit )
|
||||
&& m_preselect_lib_id == n->m_LibId )
|
||||
{
|
||||
|
@ -683,7 +683,7 @@ const LIB_TREE_NODE* LIB_TREE_MODEL_ADAPTER::ShowResults()
|
|||
recursiveDescent( m_tree,
|
||||
[&]( const LIB_TREE_NODE* n )
|
||||
{
|
||||
if( n->m_Type == LIB_TREE_NODE::TYPE::LIB_ITEM )
|
||||
if( n->m_Type == LIB_TREE_NODE::TYPE::ITEM )
|
||||
{
|
||||
firstMatch = n;
|
||||
m_widget->ExpandAncestors( ToItem( n ) );
|
||||
|
|
|
@ -1145,7 +1145,7 @@ void SYMBOL_EDIT_FRAME::UpdateLibraryTree( const wxDataViewItem& aTreeItem, LIB_
|
|||
if( aTreeItem.IsOk() ) // Can be not found in tree if the current footprint is imported
|
||||
// from file therefore not yet in tree.
|
||||
{
|
||||
static_cast<LIB_TREE_NODE_LIB_ITEM*>( aTreeItem.GetID() )->Update( aSymbol );
|
||||
static_cast<LIB_TREE_NODE_ITEM*>( aTreeItem.GetID() )->Update( aSymbol );
|
||||
m_treePane->GetLibTree()->RefreshLibTree();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -181,7 +181,7 @@ void SYMBOL_TREE_SYNCHRONIZING_ADAPTER::updateLibrary( LIB_TREE_NODE_LIBRARY& aL
|
|||
{
|
||||
// alias exists both in the symbol tree and the library manager,
|
||||
// update only the node data.
|
||||
static_cast<LIB_TREE_NODE_LIB_ITEM*>( nodeIt->get() )->Update( *aliasIt );
|
||||
static_cast<LIB_TREE_NODE_ITEM*>( nodeIt->get() )->Update( *aliasIt );
|
||||
aliases.erase( aliasIt );
|
||||
++nodeIt;
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ void SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue( wxVariant& aVariant, wxDataVie
|
|||
if( m_libMgr->IsLibraryModified( node->m_Name ) )
|
||||
aVariant = aVariant.GetString() + " *";
|
||||
}
|
||||
else if( node->m_Type == LIB_TREE_NODE::LIB_ITEM )
|
||||
else if( node->m_Type == LIB_TREE_NODE::ITEM )
|
||||
{
|
||||
if( m_libMgr->IsSymbolModified( node->m_Name, node->m_Parent->m_Name ) )
|
||||
aVariant = aVariant.GetString() + " *";
|
||||
|
@ -340,7 +340,7 @@ bool SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetAttr( wxDataViewItem const& aItem, un
|
|||
}
|
||||
break;
|
||||
|
||||
case LIB_TREE_NODE::LIB_ITEM:
|
||||
case LIB_TREE_NODE::ITEM:
|
||||
// mark modified part with bold font
|
||||
aAttr.SetBold( m_libMgr->IsSymbolModified( node->m_Name, node->m_Parent->m_Name ) );
|
||||
|
||||
|
@ -374,7 +374,7 @@ bool SYMBOL_TREE_SYNCHRONIZING_ADAPTER::HasPreview( const wxDataViewItem& aItem
|
|||
LIB_TREE_NODE* node = ToNode( aItem );
|
||||
wxCHECK( node, false );
|
||||
|
||||
return node->m_Type == LIB_TREE_NODE::LIB_ITEM && node->m_LibId != m_frame->GetTargetLibId();
|
||||
return node->m_Type == LIB_TREE_NODE::ITEM && node->m_LibId != m_frame->GetTargetLibId();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ public:
|
|||
{
|
||||
ROOT,
|
||||
LIBRARY,
|
||||
LIB_ITEM,
|
||||
ITEM,
|
||||
UNIT,
|
||||
INVALID
|
||||
};
|
||||
|
@ -181,15 +181,15 @@ public:
|
|||
/**
|
||||
* Node type: #LIB_ID.
|
||||
*/
|
||||
class LIB_TREE_NODE_LIB_ITEM : public LIB_TREE_NODE
|
||||
class LIB_TREE_NODE_ITEM : public LIB_TREE_NODE
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* The addresses of CMP_TREE_NODEs are used as unique IDs for the
|
||||
* wxDataViewModel, so don't let them be copied around.
|
||||
*/
|
||||
LIB_TREE_NODE_LIB_ITEM( LIB_TREE_NODE_LIB_ITEM const& _ ) = delete;
|
||||
void operator=( LIB_TREE_NODE_LIB_ITEM const& _ ) = delete;
|
||||
LIB_TREE_NODE_ITEM( LIB_TREE_NODE_ITEM const& _ ) = delete;
|
||||
void operator=( LIB_TREE_NODE_ITEM const& _ ) = delete;
|
||||
|
||||
/**
|
||||
* Construct a #LIB_ID node.
|
||||
|
@ -203,7 +203,7 @@ public:
|
|||
* @param aParent parent node, should be a CMP_TREE_NODE_LIB
|
||||
* @param aItem LIB_COMPONENT to populate the node.
|
||||
*/
|
||||
LIB_TREE_NODE_LIB_ITEM( LIB_TREE_NODE* aParent, LIB_TREE_ITEM* aItem );
|
||||
LIB_TREE_NODE_ITEM( LIB_TREE_NODE* aParent, LIB_TREE_ITEM* aItem );
|
||||
|
||||
/**
|
||||
* Update the node using data from a LIB_ALIAS object.
|
||||
|
@ -253,7 +253,7 @@ public:
|
|||
*
|
||||
* @param aItem LIB_COMPONENT to provide data
|
||||
*/
|
||||
LIB_TREE_NODE_LIB_ITEM& AddItem( LIB_TREE_ITEM* aItem );
|
||||
LIB_TREE_NODE_ITEM& AddItem( LIB_TREE_ITEM* aItem );
|
||||
|
||||
void UpdateScore( EDA_COMBINED_MATCHER* aMatcher, const wxString& aLib,
|
||||
std::function<bool( LIB_TREE_NODE& aNode )>* aFilter ) override;
|
||||
|
|
|
@ -156,7 +156,7 @@ void FOOTPRINT_EDIT_FRAME::UpdateLibraryTree( const wxDataViewItem& aTreeItem,
|
|||
if( aTreeItem.IsOk() ) // Can be not found in tree if the current footprint is imported
|
||||
// from file therefore not yet in tree.
|
||||
{
|
||||
static_cast<LIB_TREE_NODE_LIB_ITEM*>( aTreeItem.GetID() )->Update( &footprintInfo );
|
||||
static_cast<LIB_TREE_NODE_ITEM*>( aTreeItem.GetID() )->Update( &footprintInfo );
|
||||
m_treePane->GetLibTree()->RefreshLibTree();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -148,7 +148,7 @@ void FP_TREE_SYNCHRONIZING_ADAPTER::updateLibrary( LIB_TREE_NODE_LIBRARY& aLibNo
|
|||
{
|
||||
// footprint exists both in the lib tree and the footprint info list; just
|
||||
// update the node data
|
||||
static_cast<LIB_TREE_NODE_LIB_ITEM*>( nodeIt->get() )->Update( *footprintIt );
|
||||
static_cast<LIB_TREE_NODE_ITEM*>( nodeIt->get() )->Update( *footprintIt );
|
||||
footprints.erase( footprintIt );
|
||||
++nodeIt;
|
||||
}
|
||||
|
@ -295,7 +295,7 @@ bool FP_TREE_SYNCHRONIZING_ADAPTER::GetAttr( wxDataViewItem const& aItem, unsign
|
|||
}
|
||||
break;
|
||||
|
||||
case LIB_TREE_NODE::LIB_ITEM:
|
||||
case LIB_TREE_NODE::ITEM:
|
||||
if( node->m_LibId == m_frame->GetLoadedFPID() )
|
||||
{
|
||||
#ifdef __WXGTK__
|
||||
|
@ -326,7 +326,7 @@ bool FP_TREE_SYNCHRONIZING_ADAPTER::HasPreview( const wxDataViewItem& aItem )
|
|||
LIB_TREE_NODE* node = ToNode( aItem );
|
||||
wxCHECK( node, false );
|
||||
|
||||
return node->m_Type == LIB_TREE_NODE::LIB_ITEM && node->m_LibId != m_frame->GetLoadedFPID();
|
||||
return node->m_Type == LIB_TREE_NODE::ITEM && node->m_LibId != m_frame->GetLoadedFPID();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue