From 000bf50be823807e4064ade5f76cf87473ee4bfa Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Mon, 4 Jul 2011 15:27:02 +0000 Subject: [PATCH] show >500 ms in connect dialog if ping is too long --- src/connectdlg.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/connectdlg.cpp b/src/connectdlg.cpp index 340896c9..4a7adcaa 100755 --- a/src/connectdlg.cpp +++ b/src/connectdlg.cpp @@ -391,9 +391,17 @@ void CConnectDlg::SetPingTimeAndNumClientsResult ( CHostAddress& InetAddr, break; } - // update ping text - lvwServers->topLevelItem ( iIdx )-> - setText ( 1, QString().setNum ( iPingTime ) + " ms" ); + // update ping text, take special care if ping time exceeds a + // certain value + if ( iPingTime > 500 ) + { + lvwServers->topLevelItem ( iIdx )->setText ( 1, ">500 ms" ); + } + else + { + lvwServers->topLevelItem ( iIdx )-> + setText ( 1, QString().setNum ( iPingTime ) + " ms" ); + } // update number of clients text lvwServers->topLevelItem ( iIdx )->