Diffstat (limited to 'noncore/settings/networksettings2/editconnection.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/editconnection.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/noncore/settings/networksettings2/editconnection.cpp b/noncore/settings/networksettings2/editconnection.cpp index 0c3ead6..717d9e9 100644 --- a/noncore/settings/networksettings2/editconnection.cpp +++ b/noncore/settings/networksettings2/editconnection.cpp | |||
@@ -110,97 +110,96 @@ NodeCollection * EditConnection::getTmpCollection( void ) { | |||
110 | if( TmpIsValid ) | 110 | if( TmpIsValid ) |
111 | // content is stil OK | 111 | // content is stil OK |
112 | return &(TmpCollection); | 112 | return &(TmpCollection); |
113 | 113 | ||
114 | // reset collection -> delete all NEW NetNodes | 114 | // reset collection -> delete all NEW NetNodes |
115 | for( QListIterator<ANetNodeInstance> it(TmpCollection); | 115 | for( QListIterator<ANetNodeInstance> it(TmpCollection); |
116 | it.current(); | 116 | it.current(); |
117 | ++it ) { | 117 | ++it ) { |
118 | if( it.current()->isNew() ) { | 118 | if( it.current()->isNew() ) { |
119 | delete it.current(); | 119 | delete it.current(); |
120 | } | 120 | } |
121 | } | 121 | } |
122 | TmpCollection.clear(); | 122 | TmpCollection.clear(); |
123 | 123 | ||
124 | // update content | 124 | // update content |
125 | QListViewItem * it = Nodes_LV->firstChild(); | 125 | QListViewItem * it = Nodes_LV->firstChild(); |
126 | ANetNode * NN; | 126 | ANetNode * NN; |
127 | 127 | ||
128 | // start iter (if there is a collection) | 128 | // start iter (if there is a collection) |
129 | /* | 129 | /* |
130 | 130 | ||
131 | a node collection is sorted from the toplevel | 131 | a node collection is sorted from the toplevel |
132 | node to the deepest node | 132 | node to the deepest node |
133 | 133 | ||
134 | */ | 134 | */ |
135 | ANetNodeInstance * NNI = | 135 | ANetNodeInstance * NNI = |
136 | (SelectedNodes) ? SelectedNodes->first() : 0 ; | 136 | (SelectedNodes) ? SelectedNodes->first() : 0 ; |
137 | 137 | ||
138 | TmpCollection.setModified( 0 ); | 138 | TmpCollection.setModified( 0 ); |
139 | 139 | ||
140 | // the listview always starts with the toplevel | 140 | // the listview always starts with the toplevel |
141 | // hierarchy. This is always a controller item | 141 | // hierarchy. This is always a controller item |
142 | while ( it ) { | 142 | while ( it ) { |
143 | NN = (*Mapping)[it]; | 143 | NN = (*Mapping)[it]; |
144 | if( NN == 0 ) { | 144 | if( NN == 0 ) { |
145 | // this item is a controller -> | 145 | // this item is a controller -> |
146 | // has radio items as children -> | 146 | // has radio items as children -> |
147 | // find selected one | 147 | // find selected one |
148 | it = it->firstChild(); | 148 | it = it->firstChild(); |
149 | while( it ) { | 149 | while( it ) { |
150 | if( ((QCheckListItem *)it)->isOn() ) { | 150 | if( ((QCheckListItem *)it)->isOn() ) { |
151 | // this radio is selected -> go deeper | 151 | // this radio is selected -> go deeper |
152 | break; | 152 | break; |
153 | } | 153 | } |
154 | it = it->nextSibling(); | 154 | it = it->nextSibling(); |
155 | } | 155 | } |
156 | 156 | ||
157 | if( ! it ) { | 157 | if( ! it ) { |
158 | owarn << "Radio not selected" << oendl; | ||
159 | TmpIsValid = 0; | 158 | TmpIsValid = 0; |
160 | return 0; | 159 | return 0; |
161 | } | 160 | } |
162 | 161 | ||
163 | // it now contains selected radio | 162 | // it now contains selected radio |
164 | NN = (*Mapping)[it]; | 163 | NN = (*Mapping)[it]; |
165 | } | 164 | } |
166 | 165 | ||
167 | // NN here contains the netnode of the | 166 | // NN here contains the netnode of the |
168 | // current item -> this node needs to | 167 | // current item -> this node needs to |
169 | // be stored in the collection | 168 | // be stored in the collection |
170 | if( NNI == 0 || | 169 | if( NNI == 0 || |
171 | it->text(0) != NNI->nodeClass()->name() ) { | 170 | it->text(0) != NNI->nodeClass()->name() ) { |
172 | // new item not in previous collection | 171 | // new item not in previous collection |
173 | ANetNodeInstance * NNI = NN->createInstance(); | 172 | ANetNodeInstance * NNI = NN->createInstance(); |
174 | NNI->initialize(); | 173 | NNI->initialize(); |
175 | // this node type not in collection | 174 | // this node type not in collection |
176 | TmpCollection.append( NNI ); | 175 | TmpCollection.append( NNI ); |
177 | // master collection changed because new item in it | 176 | // master collection changed because new item in it |
178 | TmpCollection.setModified( 1 ); | 177 | TmpCollection.setModified( 1 ); |
179 | // no more valid items in old list | 178 | // no more valid items in old list |
180 | NNI = 0; | 179 | NNI = 0; |
181 | } else { | 180 | } else { |
182 | // already in list -> copy pointer | 181 | // already in list -> copy pointer |
183 | TmpCollection.append( NNI ); | 182 | TmpCollection.append( NNI ); |
184 | NNI = SelectedNodes->next(); | 183 | NNI = SelectedNodes->next(); |
185 | } | 184 | } |
186 | 185 | ||
187 | // go deeper to next level | 186 | // go deeper to next level |
188 | // this level is can be a new controller | 187 | // this level is can be a new controller |
189 | // or an item | 188 | // or an item |
190 | it = it->firstChild(); | 189 | it = it->firstChild(); |
191 | } | 190 | } |
192 | 191 | ||
193 | TmpIsValid = 1; | 192 | TmpIsValid = 1; |
194 | return &(TmpCollection); | 193 | return &(TmpCollection); |
195 | } | 194 | } |
196 | 195 | ||
197 | // pass a connection NodeCollection to be edited | 196 | // pass a connection NodeCollection to be edited |
198 | void EditConnection::setConnection( NodeCollection * NC ) { | 197 | void EditConnection::setConnection( NodeCollection * NC ) { |
199 | ANetNodeInstance * NNI; | 198 | ANetNodeInstance * NNI; |
200 | ANetNode * NN; | 199 | ANetNode * NN; |
201 | 200 | ||
202 | SelectedNodes = NC; | 201 | SelectedNodes = NC; |
203 | Name_LE->setText( NC->name() ); | 202 | Name_LE->setText( NC->name() ); |
204 | NNI = NC->first(); | 203 | NNI = NC->first(); |
205 | 204 | ||
206 | // show configure tabl | 205 | // show configure tabl |