summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/editconnection.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/editconnection.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/editconnection.cpp35
1 files changed, 15 insertions, 20 deletions
diff --git a/noncore/settings/networksettings2/editconnection.cpp b/noncore/settings/networksettings2/editconnection.cpp
index ce13573..4bbe502 100644
--- a/noncore/settings/networksettings2/editconnection.cpp
+++ b/noncore/settings/networksettings2/editconnection.cpp
@@ -104,16 +104,14 @@ NodeCollection * EditConnection::getTmpCollection( void ) {
104 return &(TmpCollection); 104 return &(TmpCollection);
105 105
106 // reset collection -> delete all NEW NetNodes 106 // reset collection -> delete all NEW NetNodes
107 { ANetNodeInstance * NNI; 107 for( QListIterator<ANetNodeInstance> it(TmpCollection);
108 for( QListIterator<ANetNodeInstance> it(TmpCollection); 108 it.current();
109 it.current(); 109 ++it ) {
110 ++it ) { 110 if( it.current()->isNew() ) {
111 if( it.current()->isNew() ) { 111 delete it.current();
112 delete it.current();
113 }
114 } 112 }
115 TmpCollection.clear();
116 } 113 }
114 TmpCollection.clear();
117 115
118 // update content 116 // update content
119 QListViewItem * it = Nodes_LV->firstChild(); 117 QListViewItem * it = Nodes_LV->firstChild();
@@ -135,7 +133,7 @@ NodeCollection * EditConnection::getTmpCollection( void ) {
135 // this radio is selected -> go deeper 133 // this radio is selected -> go deeper
136 if( SelectedNodes == 0 || 134 if( SelectedNodes == 0 ||
137 NNI == 0 || 135 NNI == 0 ||
138 NNI->netNode()->nodeName() != it->text(0) ) { 136 NNI->nodeClass()->nodeName() != it->text(0) ) {
139 // new item not in previous collection 137 // new item not in previous collection
140 ANetNodeInstance * NNI = (*Mapping)[it]->createInstance(); 138 ANetNodeInstance * NNI = (*Mapping)[it]->createInstance();
141 NNI->initialize(); 139 NNI->initialize();
@@ -198,10 +196,10 @@ void EditConnection::setConnection( NodeCollection * NC ) {
198 it = it->firstChild(); 196 it = it->firstChild();
199 Found = 0; 197 Found = 0;
200 while( it ) { 198 while( it ) {
201 if( NNI && NNI->netNode()->nodeName() == it->text(0) ) { 199 if( NNI && NNI->nodeClass()->nodeName() == it->text(0) ) {
202 // this radio is part of the collection 200 // this radio is part of the collection
203 ((QCheckListItem *)it)->setOn( 1 ); 201 ((QCheckListItem *)it)->setOn( 1 );
204 updateGUI( it, NNI->netNode() ); 202 updateGUI( it, NNI->nodeClass() );
205 // check its children 203 // check its children
206 Found = 1; 204 Found = 1;
207 it = it->firstChild(); 205 it = it->firstChild();
@@ -240,13 +238,10 @@ NodeCollection * EditConnection::connection( void ) {
240 SelectedNodes->clear(); 238 SelectedNodes->clear();
241 239
242 // transfer 240 // transfer
243 { ANetNodeInstance * NNI; 241 for( QListIterator<ANetNodeInstance> it(TmpCollection);
244 242 it.current();
245 for( QListIterator<ANetNodeInstance> it(TmpCollection); 243 ++it ) {
246 it.current(); 244 SelectedNodes->append( it.current() );
247 ++it ) {
248 SelectedNodes->append( it.current() );
249 }
250 } 245 }
251 246
252 if( TmpCollection.isModified() ) 247 if( TmpCollection.isModified() )
@@ -448,8 +443,8 @@ void EditConnection::SLOT_AlterTab( const QString & S ) {
448 for ( ; it.current(); ++it ) { 443 for ( ; it.current(); ++it ) {
449 NNI = it.current(); 444 NNI = it.current();
450 Devices_CB->insertItem( 445 Devices_CB->insertItem(
451 NSResources->getPixmap( NNI->netNode()->pixmapName() ), 446 NSResources->getPixmap( NNI->nodeClass()->pixmapName() ),
452 NNI->netNode()->nodeName() 447 NNI->nodeClass()->nodeName()
453 ); 448 );
454 449
455 // add edit widget 450 // add edit widget