summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/aqpkg/settingsimpl.cpp36
1 files changed, 33 insertions, 3 deletions
diff --git a/noncore/settings/aqpkg/settingsimpl.cpp b/noncore/settings/aqpkg/settingsimpl.cpp
index 9f611da..e2afada 100644
--- a/noncore/settings/aqpkg/settingsimpl.cpp
+++ b/noncore/settings/aqpkg/settingsimpl.cpp
@@ -287,4 +287,6 @@ void SettingsImpl :: editServer( int sel )
currentSelectedServer = sel;
Server *s = dataMgr->getServer( servers->currentText() );
+ if ( s )
+ {
serverName = s->getServerName();
servername->setText( s->getServerName() );
@@ -292,4 +294,12 @@ void SettingsImpl :: editServer( int sel )
active->setChecked( s->isServerActive() );
}
+ else
+ {
+ serverName = "";
+ servername->setText( "" );
+ serverurl->setText( "" );
+ active->setChecked( false );
+ }
+}
void SettingsImpl :: newServer()
@@ -306,7 +316,10 @@ void SettingsImpl :: removeServer()
changed = true;
Server *s = dataMgr->getServer( servers->currentText() );
+ if ( s )
+ {
dataMgr->getServerList().removeRef( s );
servers->removeItem( currentSelectedServer );
}
+}
void SettingsImpl :: changeServerDetails()
@@ -333,10 +346,10 @@ void SettingsImpl :: changeServerDetails()
{
Server *s = dataMgr->getServer( servers->currentText() );
-
+ if ( s )
+ {
// Update url
s->setServerUrl( serverurl->text() );
s->setActive( active->isChecked() );
-
// Check if server name has changed, if it has then we need to replace the key in the map
if ( serverName != newName )
@@ -349,4 +362,5 @@ void SettingsImpl :: changeServerDetails()
servers->changeItem( newName, currentSelectedServer );
}
+ }
else
{
@@ -366,4 +380,6 @@ void SettingsImpl :: editDestination( int sel )
currentSelectedDestination = sel;
Destination *d = dataMgr->getDestination( destinations->currentText() );
+ if ( d )
+ {
destinationName = d->getDestinationName();
destinationname->setText( d->getDestinationName() );
@@ -371,4 +387,12 @@ void SettingsImpl :: editDestination( int sel )
linkToRoot->setChecked( d->linkToRoot() );
}
+ else
+ {
+ destinationName = "";
+ destinationname->setText( "" );
+ destinationurl->setText( "" );
+ linkToRoot->setChecked( false );
+ }
+}
void SettingsImpl :: newDestination()
@@ -385,7 +409,10 @@ void SettingsImpl :: removeDestination()
changed = true;
Destination *d = dataMgr->getDestination( destinations->currentText() );
+ if ( d )
+ {
dataMgr->getDestinationList().removeRef( d );
destinations->removeItem( currentSelectedDestination );
}
+}
void SettingsImpl :: changeDestinationDetails()
@@ -402,5 +429,6 @@ void SettingsImpl :: changeDestinationDetails()
{
Destination *d = dataMgr->getDestination( destinations->currentText() );
-
+ if ( d )
+ {
// Update url
d->setDestinationPath( destinationurl->text() );
@@ -416,4 +444,5 @@ void SettingsImpl :: changeDestinationDetails()
destinations->changeItem( newName, currentSelectedDestination );
}
+
#ifdef QWS
QString key = newName;
@@ -423,4 +452,5 @@ void SettingsImpl :: changeDestinationDetails()
#endif
}
+ }
else
{