Diffstat (limited to 'noncore/settings/aqpkg/settingsimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/settingsimpl.cpp | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/noncore/settings/aqpkg/settingsimpl.cpp b/noncore/settings/aqpkg/settingsimpl.cpp index c5a55d2..7541f0b 100644 --- a/noncore/settings/aqpkg/settingsimpl.cpp +++ b/noncore/settings/aqpkg/settingsimpl.cpp | |||
@@ -253,22 +253,24 @@ QWidget *SettingsImpl :: initProxyTab() | |||
253 | 253 | ||
254 | void SettingsImpl :: setupData() | 254 | void SettingsImpl :: setupData() |
255 | { | 255 | { |
256 | // add servers | 256 | // add servers |
257 | vector<Server>::iterator it; | 257 | QString serverName; |
258 | for ( it = dataMgr->getServerList().begin() ; it != dataMgr->getServerList().end() ; ++it ) | 258 | QListIterator<Server> it( dataMgr->getServerList() ); |
259 | for ( ; it.current(); ++it ) | ||
259 | { | 260 | { |
260 | if ( it->getServerName() == LOCAL_SERVER || it->getServerName() == LOCAL_IPKGS ) | 261 | serverName = it.current()->getServerName(); |
262 | if ( serverName == LOCAL_SERVER || serverName == LOCAL_IPKGS ) | ||
261 | continue; | 263 | continue; |
262 | 264 | ||
263 | servers->insertItem( it->getServerName() ); | 265 | servers->insertItem( serverName ); |
264 | } | 266 | } |
265 | 267 | ||
266 | 268 | ||
267 | // add destinations | 269 | // add destinations |
268 | vector<Destination>::iterator it2; | 270 | QListIterator<Destination> it2( dataMgr->getDestinationList() ); |
269 | for ( it2 = dataMgr->getDestinationList().begin() ; it2 != dataMgr->getDestinationList().end() ; ++it2 ) | 271 | for ( ; it2.current(); ++it2 ) |
270 | destinations->insertItem( it2->getDestinationName() ); | 272 | destinations->insertItem( it2.current()->getDestinationName() ); |
271 | 273 | ||
272 | // setup proxy tab | 274 | // setup proxy tab |
273 | txtHttpProxy->setText( dataMgr->getHttpProxy() ); | 275 | txtHttpProxy->setText( dataMgr->getHttpProxy() ); |
274 | txtFtpProxy->setText( dataMgr->getFtpProxy() ); | 276 | txtFtpProxy->setText( dataMgr->getFtpProxy() ); |
@@ -282,9 +284,9 @@ void SettingsImpl :: setupData() | |||
282 | 284 | ||
283 | void SettingsImpl :: editServer( int sel ) | 285 | void SettingsImpl :: editServer( int sel ) |
284 | { | 286 | { |
285 | currentSelectedServer = sel; | 287 | currentSelectedServer = sel; |
286 | vector<Server>::iterator s = dataMgr->getServer( servers->currentText() ); | 288 | Server *s = dataMgr->getServer( servers->currentText() ); |
287 | serverName = s->getServerName(); | 289 | serverName = s->getServerName(); |
288 | servername->setText( s->getServerName() ); | 290 | servername->setText( s->getServerName() ); |
289 | serverurl->setText( s->getServerUrl() ); | 291 | serverurl->setText( s->getServerUrl() ); |
290 | active->setChecked( s->isServerActive() ); | 292 | active->setChecked( s->isServerActive() ); |
@@ -301,10 +303,10 @@ void SettingsImpl :: newServer() | |||
301 | 303 | ||
302 | void SettingsImpl :: removeServer() | 304 | void SettingsImpl :: removeServer() |
303 | { | 305 | { |
304 | changed = true; | 306 | changed = true; |
305 | vector<Server>::iterator s = dataMgr->getServer( servers->currentText() ); | 307 | Server *s = dataMgr->getServer( servers->currentText() ); |
306 | dataMgr->getServerList().erase( s ); | 308 | dataMgr->getServerList().removeRef( s ); |
307 | servers->removeItem( currentSelectedServer ); | 309 | servers->removeItem( currentSelectedServer ); |
308 | } | 310 | } |
309 | 311 | ||
310 | void SettingsImpl :: changeServerDetails() | 312 | void SettingsImpl :: changeServerDetails() |
@@ -313,9 +315,9 @@ void SettingsImpl :: changeServerDetails() | |||
313 | 315 | ||
314 | QString newName = servername->text(); | 316 | QString newName = servername->text(); |
315 | if ( !newserver ) | 317 | if ( !newserver ) |
316 | { | 318 | { |
317 | vector<Server>::iterator s = dataMgr->getServer( servers->currentText() ); | 319 | Server *s = dataMgr->getServer( servers->currentText() ); |
318 | 320 | ||
319 | // Update url | 321 | // Update url |
320 | s->setServerUrl( serverurl->text() ); | 322 | s->setServerUrl( serverurl->text() ); |
321 | s->setActive( active->isChecked() ); | 323 | s->setActive( active->isChecked() ); |
@@ -337,10 +339,10 @@ void SettingsImpl :: changeServerDetails() | |||
337 | } | 339 | } |
338 | else | 340 | else |
339 | { | 341 | { |
340 | Server s( newName, serverurl->text() ); | 342 | Server s( newName, serverurl->text() ); |
341 | dataMgr->getServerList().push_back( Server( newName, serverurl->text() ) ); | 343 | dataMgr->getServerList().append( new Server( newName, serverurl->text() ) ); |
342 | dataMgr->getServerList().end()->setActive( active->isChecked() ); | 344 | dataMgr->getServerList().last()->setActive( active->isChecked() ); |
343 | servers->insertItem( newName ); | 345 | servers->insertItem( newName ); |
344 | servers->setCurrentItem( servers->count() ); | 346 | servers->setCurrentItem( servers->count() ); |
345 | newserver = false; | 347 | newserver = false; |
346 | } | 348 | } |
@@ -350,9 +352,9 @@ void SettingsImpl :: changeServerDetails() | |||
350 | 352 | ||
351 | void SettingsImpl :: editDestination( int sel ) | 353 | void SettingsImpl :: editDestination( int sel ) |
352 | { | 354 | { |
353 | currentSelectedDestination = sel; | 355 | currentSelectedDestination = sel; |
354 | vector<Destination>::iterator d = dataMgr->getDestination( destinations->currentText() ); | 356 | Destination *d = dataMgr->getDestination( destinations->currentText() ); |
355 | destinationName = d->getDestinationName(); | 357 | destinationName = d->getDestinationName(); |
356 | destinationname->setText( d->getDestinationName() ); | 358 | destinationname->setText( d->getDestinationName() ); |
357 | destinationurl->setText( d->getDestinationPath() ); | 359 | destinationurl->setText( d->getDestinationPath() ); |
358 | linkToRoot->setChecked( d->linkToRoot() ); | 360 | linkToRoot->setChecked( d->linkToRoot() ); |
@@ -369,10 +371,10 @@ void SettingsImpl :: newDestination() | |||
369 | 371 | ||
370 | void SettingsImpl :: removeDestination() | 372 | void SettingsImpl :: removeDestination() |
371 | { | 373 | { |
372 | changed = true; | 374 | changed = true; |
373 | vector<Destination>::iterator d = dataMgr->getDestination( destinations->currentText() ); | 375 | Destination *d = dataMgr->getDestination( destinations->currentText() ); |
374 | dataMgr->getDestinationList().erase( d ); | 376 | dataMgr->getDestinationList().removeRef( d ); |
375 | destinations->removeItem( currentSelectedDestination ); | 377 | destinations->removeItem( currentSelectedDestination ); |
376 | } | 378 | } |
377 | 379 | ||
378 | void SettingsImpl :: changeDestinationDetails() | 380 | void SettingsImpl :: changeDestinationDetails() |
@@ -386,9 +388,9 @@ void SettingsImpl :: changeDestinationDetails() | |||
386 | 388 | ||
387 | QString newName = destinationname->text(); | 389 | QString newName = destinationname->text(); |
388 | if ( !newdestination ) | 390 | if ( !newdestination ) |
389 | { | 391 | { |
390 | vector<Destination>::iterator d = dataMgr->getDestination( destinations->currentText() ); | 392 | Destination *d = dataMgr->getDestination( destinations->currentText() ); |
391 | 393 | ||
392 | // Update url | 394 | // Update url |
393 | d->setDestinationPath( destinationurl->text() ); | 395 | d->setDestinationPath( destinationurl->text() ); |
394 | d->linkToRoot( linkToRoot->isChecked() ); | 396 | d->linkToRoot( linkToRoot->isChecked() ); |
@@ -410,9 +412,9 @@ void SettingsImpl :: changeDestinationDetails() | |||
410 | #endif | 412 | #endif |
411 | } | 413 | } |
412 | else | 414 | else |
413 | { | 415 | { |
414 | dataMgr->getDestinationList().push_back( Destination( newName, destinationurl->text() ) ); | 416 | dataMgr->getDestinationList().append( new Destination( newName, destinationurl->text() ) ); |
415 | destinations->insertItem( newName ); | 417 | destinations->insertItem( newName ); |
416 | destinations->setCurrentItem( destinations->count() ); | 418 | destinations->setCurrentItem( destinations->count() ); |
417 | newdestination = false; | 419 | newdestination = false; |
418 | 420 | ||