-rw-r--r-- | noncore/settings/aqpkg/settingsimpl.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/noncore/settings/aqpkg/settingsimpl.cpp b/noncore/settings/aqpkg/settingsimpl.cpp index 7541f0b..9f611da 100644 --- a/noncore/settings/aqpkg/settingsimpl.cpp +++ b/noncore/settings/aqpkg/settingsimpl.cpp @@ -311,12 +311,27 @@ void SettingsImpl :: removeServer() void SettingsImpl :: changeServerDetails() { changed = true; QString newName = servername->text(); + + // Convert any spaces to underscores + char *tmpStr = new char[newName.length() + 1]; + for ( unsigned int i = 0 ; i < newName.length() ; ++i ) + { + if ( newName[i] == ' ' ) + tmpStr[i] = '_'; + else + tmpStr[i] = newName[i].latin1(); + } + tmpStr[newName.length()] = '\0'; + + newName = tmpStr; + delete tmpStr; + if ( !newserver ) { Server *s = dataMgr->getServer( servers->currentText() ); // Update url s->setServerUrl( serverurl->text() ); @@ -325,20 +340,16 @@ void SettingsImpl :: changeServerDetails() // Check if server name has changed, if it has then we need to replace the key in the map if ( serverName != newName ) { // Update server name s->setServerName( newName ); - - // See if this server is the active server -// if ( dataMgr->getActiveServer() == serverName ) -// dataMgr->setActiveServer( newName ); - - // Update list box - servers->changeItem( newName, currentSelectedServer ); } + + // Update list box + servers->changeItem( newName, currentSelectedServer ); } else { Server s( newName, serverurl->text() ); dataMgr->getServerList().append( new Server( newName, serverurl->text() ) ); dataMgr->getServerList().last()->setActive( active->isChecked() ); |