split country names by upper case latters by inserting a space

This commit is contained in:
Volker Fischer 2020-04-12 14:54:28 +02:00
parent 1fd00130ab
commit 8fd59dd93f
2 changed files with 29 additions and 5 deletions

View file

@ -3,7 +3,8 @@
3.4.8git
TODO split country names by upper case latters by inserting a space
* refresh server list if the Central Server address type is changed
TODO fix UpdateCurLevel() for new 64 samples frame size
@ -16,10 +17,10 @@ TODO for different frame sizes (64/128) the start value of 6 for the jitter buff
TODO offer the Jamulus ASIO settingspanel in case of an ASIO ERROR to fix, e.g., incorrect sample rate (https://sourceforge.net/p/llcon/discussion/533517/thread/777663cf94/#035f)
TODO client: larger sound card buffers are managed by conversion buffer, not in processintern for loop (note iSndCrdFrameSizeFactor!)
TODO should LHostAddr be QHostAddress instead of CHostAddress?
maybe let the use select all possible sound card buffer sizes, this should solve Ticket #53
TODO store Central Server jamulus.server start scripts on the Repo (one for Central Server, one for Central Server North America)
TODO should LHostAddr be QHostAddress instead of CHostAddress? See https://github.com/corrados/jamulus/pull/48#issuecomment-612594981

View file

@ -115,6 +115,12 @@ CConnectDlg::CConnectDlg ( const bool bNewShowCompleteRegList,
// make sure the connect button has the focus
butConnect->setFocus();
// for "show all servers" mode make sort by click on header possible
if ( bShowCompleteRegList )
{
lvwServers->setSortingEnabled ( true );
}
#ifdef ANDROID
// for the android version maximize the window
setWindowState ( Qt::WindowMaximized );
@ -288,7 +294,7 @@ void CConnectDlg::SetServerList ( const CHostAddress& InetAddr,
// in case of all servers shown, add the registration number at the beginning
if ( bShowCompleteRegList )
{
pNewListViewItem->setText ( 0, QString ( "%1: " ).arg ( 1 + iIdx ) + pNewListViewItem->text ( 0 ) );
pNewListViewItem->setText ( 0, QString ( "%1: " ).arg ( 1 + iIdx, 3 ) + pNewListViewItem->text ( 0 ) );
}
// show server name in bold font if it is a permanent server
@ -309,9 +315,26 @@ void CConnectDlg::SetServerList ( const CHostAddress& InetAddr,
{
strLocation += ", ";
}
if ( vecServerInfo[iIdx].eCountry != QLocale::AnyCountry )
{
strLocation += QLocale::countryToString ( vecServerInfo[iIdx].eCountry );
QString strCountryToString = QLocale::countryToString ( vecServerInfo[iIdx].eCountry );
// Qt countryToString does not use spaces in between country name
// parts but they use upper case letters which we can detect and
// insert spaces as a post processing
if ( !strCountryToString.contains ( " " ) )
{
QRegularExpressionMatchIterator reMatchIt = QRegularExpression ( "[A-Z][^A-Z]*" ).globalMatch ( strCountryToString );
QStringList slNames;
while ( reMatchIt.hasNext() )
{
slNames << reMatchIt.next().capturedTexts();
}
strCountryToString = slNames.join ( " " );
}
strLocation += strCountryToString;
}
pNewListViewItem->setText ( 3, strLocation );