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.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/noncore/settings/aqpkg/settingsimpl.cpp b/noncore/settings/aqpkg/settingsimpl.cpp
index a18a178..9dd2206 100644
--- a/noncore/settings/aqpkg/settingsimpl.cpp
+++ b/noncore/settings/aqpkg/settingsimpl.cpp
@@ -13,12 +13,13 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include <fstream>
+#include <algorithm>
using namespace std;
#include <qlistbox.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qtabwidget.h>
@@ -88,13 +89,13 @@ void SettingsImpl :: setupData()
//------------------ Servers tab ----------------------
void SettingsImpl :: editServer( int sel )
{
currentSelectedServer = sel;
- Server *s = dataMgr->getServer( servers->currentText() );
+ vector<Server>::iterator s = dataMgr->getServer( servers->currentText() );
serverName = s->getServerName();
servername->setText( s->getServerName() );
serverurl->setText( s->getServerUrl() );
active->setChecked( s->isServerActive() );
}
@@ -106,26 +107,26 @@ void SettingsImpl :: newServer()
servername->setFocus();
active->setChecked( true );
}
void SettingsImpl :: removeServer()
{
- changed = true;
- Server *s = dataMgr->getServer( servers->currentText() );
- dataMgr->getServerList().erase( s );
- servers->removeItem( currentSelectedServer );
+ changed = true;
+ vector<Server>::iterator s = dataMgr->getServer( servers->currentText() );
+ dataMgr->getServerList().erase( s );
+ servers->removeItem( currentSelectedServer );
}
void SettingsImpl :: changeServerDetails()
{
changed = true;
QString newName = servername->text();
if ( !newserver )
{
- Server *s = dataMgr->getServer( serverName );
+ vector<Server>::iterator s = dataMgr->getServer( servers->currentText() );
// Update url
s->setServerUrl( serverurl->text() );
s->setActive( active->isChecked() );
@@ -156,13 +157,13 @@ void SettingsImpl :: changeServerDetails()
//------------------ Destinations tab ----------------------
void SettingsImpl :: editDestination( int sel )
{
currentSelectedDestination = sel;
- Destination *d = dataMgr->getDestination( destinations->currentText() );
+ vector<Destination>::iterator d = dataMgr->getDestination( destinations->currentText() );
destinationName = d->getDestinationName();
destinationname->setText( d->getDestinationName() );
destinationurl->setText( d->getDestinationPath() );
linkToRoot->setChecked( d->linkToRoot() );
}
@@ -174,15 +175,15 @@ void SettingsImpl :: newDestination()
destinationname->setFocus();
linkToRoot->setChecked( true );
}
void SettingsImpl :: removeDestination()
{
- changed = true;
- Destination *d = dataMgr->getDestination( destinations->currentText() );
- dataMgr->getDestinationList().erase( d );
+ changed = true;
+ vector<Destination>::iterator d = dataMgr->getDestination( destinations->currentText() );
+ dataMgr->getDestinationList().erase( d );
destinations->removeItem( currentSelectedDestination );
}
void SettingsImpl :: changeDestinationDetails()
{
changed = true;
@@ -192,13 +193,13 @@ void SettingsImpl :: changeDestinationDetails()
cfg.setGroup( "destinations" );
#endif
QString newName = destinationname->text();
if ( !newdestination )
{
- Destination *d = dataMgr->getDestination( destinationName );
+ vector<Destination>::iterator d = dataMgr->getDestination( destinations->currentText() );
// Update url
d->setDestinationPath( destinationurl->text() );
d->linkToRoot( linkToRoot->isChecked() );
// Check if server name has changed, if it has then we need to replace the key in the map