if network name/address contains spaces, they are removed now, coded by dingodoppelt (#462)

This commit is contained in:
Volker Fischer 2020-07-20 15:44:00 +02:00
parent 5657bc9e55
commit 63ebc28a18
6 changed files with 13 additions and 4 deletions

View File

@ -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

View File

@ -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 )

View File

@ -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

View File

@ -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;
}

View File

@ -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::CInstPictProps>& CInstPictures::GetTable ( const bool bReGenerateTable )

View File

@ -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 );