From 1fd3cc977f7f93410ba0b925019700522429fc4f Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Wed, 22 Jul 2020 18:07:37 +0200 Subject: [PATCH] bug fix: --showallservers ping column sort is alphabetic (#201) --- ChangeLog | 2 ++ src/connectdlg.cpp | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2e61f016..3bc33f98 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,8 +11,10 @@ - improve compact skin by using smaller font size if the name is too long +- bug fix: --showallservers ping column sort is alphabetic (#201) +TODO If network configuration of client changes (e.g. Wifi to LAN) we may get audio issues for a period of time #426 diff --git a/src/connectdlg.cpp b/src/connectdlg.cpp index cbe015f2..a348090a 100755 --- a/src/connectdlg.cpp +++ b/src/connectdlg.cpp @@ -756,8 +756,10 @@ void CConnectDlg::SetPingTimeAndNumClientsResult ( const CHostAddress& InetAddr, } else { + // prepend spaces so that we can sort correctly (fieldWidth of + // 4 is sufficient since the maximum width is ">500") (#201) pCurListViewItem-> - setText ( 1, QString().setNum ( iMinPingTime ) + " ms" ); + setText ( 1, QString ( "%1 ms" ).arg ( iMinPingTime, 4, 10, QLatin1Char ( ' ' ) ) ); } // update number of clients text