diff --git a/ChangeLog b/ChangeLog index 0e16d225..ef5149ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,9 @@ - do not change the server list order if the mouse is over the table to avoid selecting an incorrect server on a mouse double click (#293) +- if network name/address contains spaces, they are removed now, + coded by dingodoppelt (#462) + TODO improve compact channels: smaller font size of name is too long diff --git a/src/clientsettingsdlg.cpp b/src/clientsettingsdlg.cpp index 1e3e6215..048345de 100755 --- a/src/clientsettingsdlg.cpp +++ b/src/clientsettingsdlg.cpp @@ -676,7 +676,7 @@ void CClientSettingsDlg::OnCentralServerAddressEditingFinished() { // store new setting in the client pClient->SetServerListCentralServerAddress ( - edtCentralServerAddress->text() ); + NetworkUtil::FixAddress ( edtCentralServerAddress->text() ) ); } void CClientSettingsDlg::OnSndCrdBufferDelayButtonGroupClicked ( QAbstractButton* button ) diff --git a/src/connectdlg.cpp b/src/connectdlg.cpp index 71ac9be7..cbe015f2 100755 --- a/src/connectdlg.cpp +++ b/src/connectdlg.cpp @@ -658,8 +658,7 @@ void CConnectDlg::OnConnectClicked() } else { - // remove all spaces from the parsed string in the the combo box - strSelectedAddress = cbxServerAddr->currentText().simplified().replace ( " ", "" ); + strSelectedAddress = NetworkUtil::FixAddress ( cbxServerAddr->currentText() ); } // tell the parent window that the connection shall be initiated diff --git a/src/main.cpp b/src/main.cpp index 1684700f..1f3674d3 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -462,7 +462,7 @@ int main ( int argc, char** argv ) "--connect", strArgument ) ) { - strConnOnStartupAddress = strArgument.simplified().replace( " ", "" ); + strConnOnStartupAddress = NetworkUtil::FixAddress ( strArgument ); tsConsole << "- connect on startup to address: " << strConnOnStartupAddress << endl; continue; } diff --git a/src/util.cpp b/src/util.cpp index d0154552..0ee137ed 100755 --- a/src/util.cpp +++ b/src/util.cpp @@ -1061,6 +1061,12 @@ QString NetworkUtil::GetCentralServerAddress ( const ECSAddType eCentralServerAd } } +QString NetworkUtil::FixAddress ( const QString& strAddress ) +{ + // remove all spaces from the address string + return strAddress.simplified().replace ( " ", "" ); +} + // Instrument picture data base ------------------------------------------------ CVector& CInstPictures::GetTable ( const bool bReGenerateTable ) diff --git a/src/util.h b/src/util.h index d279d89d..e6423010 100755 --- a/src/util.h +++ b/src/util.h @@ -1112,6 +1112,7 @@ public: static bool ParseNetworkAddress ( QString strAddress, CHostAddress& HostAddress ); + static QString FixAddress ( const QString& strAddress ); static CHostAddress GetLocalAddress(); static QString GetCentralServerAddress ( const ECSAddType eCentralServerAddressType, const QString& strCentralServerAddress );