summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/settingsimpl.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/aqpkg/settingsimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/settingsimpl.cpp38
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()
void SettingsImpl :: setupData()
{
// add servers
- vector<Server>::iterator it;
- for ( it = dataMgr->getServerList().begin() ; it != dataMgr->getServerList().end() ; ++it )
+ QString serverName;
+ QListIterator<Server> it( dataMgr->getServerList() );
+ for ( ; it.current(); ++it )
{
- if ( it->getServerName() == LOCAL_SERVER || it->getServerName() == LOCAL_IPKGS )
+ serverName = it.current()->getServerName();
+ if ( serverName == LOCAL_SERVER || serverName == LOCAL_IPKGS )
continue;
- servers->insertItem( it->getServerName() );
+ servers->insertItem( serverName );
}
// add destinations
- vector<Destination>::iterator it2;
- for ( it2 = dataMgr->getDestinationList().begin() ; it2 != dataMgr->getDestinationList().end() ; ++it2 )
- destinations->insertItem( it2->getDestinationName() );
+ QListIterator<Destination> it2( dataMgr->getDestinationList() );
+ for ( ; it2.current(); ++it2 )
+ destinations->insertItem( it2.current()->getDestinationName() );
// setup proxy tab
txtHttpProxy->setText( dataMgr->getHttpProxy() );
txtFtpProxy->setText( dataMgr->getFtpProxy() );
@@ -282,9 +284,9 @@ void SettingsImpl :: setupData()
void SettingsImpl :: editServer( int sel )
{
currentSelectedServer = sel;
- vector<Server>::iterator s = dataMgr->getServer( servers->currentText() );
+ Server *s = dataMgr->getServer( servers->currentText() );
serverName = s->getServerName();
servername->setText( s->getServerName() );
serverurl->setText( s->getServerUrl() );
active->setChecked( s->isServerActive() );
@@ -301,10 +303,10 @@ void SettingsImpl :: newServer()
void SettingsImpl :: removeServer()
{
changed = true;
- vector<Server>::iterator s = dataMgr->getServer( servers->currentText() );
- dataMgr->getServerList().erase( s );
+ Server *s = dataMgr->getServer( servers->currentText() );
+ dataMgr->getServerList().removeRef( s );
servers->removeItem( currentSelectedServer );
}
void SettingsImpl :: changeServerDetails()
@@ -313,9 +315,9 @@ void SettingsImpl :: changeServerDetails()
QString newName = servername->text();
if ( !newserver )
{
- vector<Server>::iterator s = dataMgr->getServer( servers->currentText() );
+ Server *s = dataMgr->getServer( servers->currentText() );
// Update url
s->setServerUrl( serverurl->text() );
s->setActive( active->isChecked() );
@@ -337,10 +339,10 @@ void SettingsImpl :: changeServerDetails()
}
else
{
Server s( newName, serverurl->text() );
- dataMgr->getServerList().push_back( Server( newName, serverurl->text() ) );
- dataMgr->getServerList().end()->setActive( active->isChecked() );
+ dataMgr->getServerList().append( new Server( newName, serverurl->text() ) );
+ dataMgr->getServerList().last()->setActive( active->isChecked() );
servers->insertItem( newName );
servers->setCurrentItem( servers->count() );
newserver = false;
}
@@ -350,9 +352,9 @@ void SettingsImpl :: changeServerDetails()
void SettingsImpl :: editDestination( int sel )
{
currentSelectedDestination = sel;
- vector<Destination>::iterator d = dataMgr->getDestination( destinations->currentText() );
+ Destination *d = dataMgr->getDestination( destinations->currentText() );
destinationName = d->getDestinationName();
destinationname->setText( d->getDestinationName() );
destinationurl->setText( d->getDestinationPath() );
linkToRoot->setChecked( d->linkToRoot() );
@@ -369,10 +371,10 @@ void SettingsImpl :: newDestination()
void SettingsImpl :: removeDestination()
{
changed = true;
- vector<Destination>::iterator d = dataMgr->getDestination( destinations->currentText() );
- dataMgr->getDestinationList().erase( d );
+ Destination *d = dataMgr->getDestination( destinations->currentText() );
+ dataMgr->getDestinationList().removeRef( d );
destinations->removeItem( currentSelectedDestination );
}
void SettingsImpl :: changeDestinationDetails()
@@ -386,9 +388,9 @@ void SettingsImpl :: changeDestinationDetails()
QString newName = destinationname->text();
if ( !newdestination )
{
- vector<Destination>::iterator d = dataMgr->getDestination( destinations->currentText() );
+ Destination *d = dataMgr->getDestination( destinations->currentText() );
// Update url
d->setDestinationPath( destinationurl->text() );
d->linkToRoot( linkToRoot->isChecked() );
@@ -410,9 +412,9 @@ void SettingsImpl :: changeDestinationDetails()
#endif
}
else
{
- dataMgr->getDestinationList().push_back( Destination( newName, destinationurl->text() ) );
+ dataMgr->getDestinationList().append( new Destination( newName, destinationurl->text() ) );
destinations->insertItem( newName );
destinations->setCurrentItem( destinations->count() );
newdestination = false;