From 2bc5aaa5c480c2b8924593f1010c7efd3bd50693 Mon Sep 17 00:00:00 2001 From: andyq Date: Mon, 10 Feb 2003 18:20:16 +0000 Subject: Fixed bug where feed names could have spaces in them --- 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 @@ -314,6 +314,21 @@ 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() ); @@ -328,14 +343,10 @@ void SettingsImpl :: changeServerDetails() { // 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 { -- cgit v0.9.0.2