diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index b456f47b63..fd82c2b7d9 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -2595,7 +2595,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets, { // It is a new net, we have to add it netinfo = new NETINFO_ITEM( this, net.GetNetName() ); - m_NetInfo.AppendNet( netinfo ); + Add( netinfo ); } pad->SetNetCode( netinfo->GetNet() ); diff --git a/pcbnew/class_board.h b/pcbnew/class_board.h index 09caae0458..7035e19102 100644 --- a/pcbnew/class_board.h +++ b/pcbnew/class_board.h @@ -784,16 +784,6 @@ public: */ NETINFO_ITEM* FindNet( const wxString& aNetname ) const; - /** - * Function AppendNet - * adds a new net description item to the current board. - * @param aNewNet is the new description item. - */ - void AppendNet( NETINFO_ITEM* aNewNet ) - { - m_NetInfo.AppendNet( aNewNet ); - } - NETINFO_LIST& GetNetInfo() { return m_NetInfo; diff --git a/pcbnew/eagle_plugin.cpp b/pcbnew/eagle_plugin.cpp index 8e51b5763c..55f6108cba 100644 --- a/pcbnew/eagle_plugin.cpp +++ b/pcbnew/eagle_plugin.cpp @@ -2622,7 +2622,7 @@ void EAGLE_PLUGIN::loadSignals( CPTREE& aSignals ) const string& nname = net->second.get( ".name" ); wxString netName = FROM_UTF8( nname.c_str() ); - m_board->AppendNet( new NETINFO_ITEM( m_board, netName, netCode ) ); + m_board->Add( new NETINFO_ITEM( m_board, netName, netCode ) ); m_xpath->Value( nname.c_str() ); diff --git a/pcbnew/legacy_plugin.cpp b/pcbnew/legacy_plugin.cpp index d5a0988c21..bc8f23c7ef 100644 --- a/pcbnew/legacy_plugin.cpp +++ b/pcbnew/legacy_plugin.cpp @@ -2080,7 +2080,7 @@ void LEGACY_PLUGIN::loadNETINFO_ITEM() // if it is not the net 0, or if the net 0 does not exists. if( net && ( net->GetNet() > 0 || m_board->FindNet( 0 ) == NULL ) ) { - m_board->AppendNet( net ); + m_board->Add( net ); // Be sure we have room to store the net in m_netCodes if( (int)m_netCodes.size() <= netCode ) diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb.cpp b/pcbnew/pcad2kicadpcb_plugin/pcb.cpp index feedb83135..1b27a8f725 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb.cpp +++ b/pcbnew/pcad2kicadpcb_plugin/pcb.cpp @@ -925,7 +925,7 @@ void PCB::AddToBoard() { net = m_pcbNetlist[i]; - m_board->AppendNet( new NETINFO_ITEM( m_board, net->m_name, net->m_netCode ) ); + m_board->Add( new NETINFO_ITEM( m_board, net->m_name, net->m_netCode ) ); } for( i = 0; i < (int) m_pcbComponents.GetCount(); i++ ) diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_pad.cpp b/pcbnew/pcad2kicadpcb_plugin/pcb_pad.cpp index f1e9b91723..716a7cf9bb 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_pad.cpp +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_pad.cpp @@ -278,7 +278,7 @@ void PCB_PAD::AddToModule( MODULE* aModule, int aRotation, bool aEncapsulatedPad { // It is a new net netinfo = new NETINFO_ITEM( m_board, m_net ); - m_board->AppendNet( netinfo ); + m_board->Add( netinfo ); } pad->SetNetCode( netinfo->GetNet() ); diff --git a/pcbnew/pcb_parser.cpp b/pcbnew/pcb_parser.cpp index e6413c878d..228cbe9913 100644 --- a/pcbnew/pcb_parser.cpp +++ b/pcbnew/pcb_parser.cpp @@ -1242,10 +1242,10 @@ void PCB_PARSER::parseNETINFO_ITEM() throw( IO_ERROR, PARSE_ERROR ) // net 0 should be already in list, so store this net // if it is not the net 0, or if the net 0 does not exists. // (TODO: a better test.) - if( netCode > 0 || m_board->FindNet( 0 ) == NULL ) + if( netCode > NETINFO_LIST::UNCONNECTED || !m_board->FindNet( NETINFO_LIST::UNCONNECTED ) ) { NETINFO_ITEM* net = new NETINFO_ITEM( m_board, name, netCode ); - m_board->AppendNet( net ); + m_board->Add( net ); // Store the new code mapping pushValueIntoMap( netCode, net->GetNet() ); @@ -2988,7 +2988,7 @@ ZONE_CONTAINER* PCB_PARSER::parseZONE_CONTAINER() throw( IO_ERROR, PARSE_ERROR ) { int newnetcode = m_board->GetNetCount(); net = new NETINFO_ITEM( m_board, netnameFromfile, newnetcode ); - m_board->AppendNet( net ); + m_board->Add( net ); // Store the new code mapping pushValueIntoMap( newnetcode, net->GetNet() );