fixed bug: #25 No client list in connection dialog for server which is full
This commit is contained in:
parent
5096e3208a
commit
600d5f6832
1 changed files with 17 additions and 3 deletions
|
@ -92,10 +92,18 @@ CConnectDlg::CConnectDlg ( const bool bNewShowCompleteRegList,
|
||||||
lvwServers->clear();
|
lvwServers->clear();
|
||||||
|
|
||||||
// add invisible columns which are used for sorting the list and storing
|
// add invisible columns which are used for sorting the list and storing
|
||||||
// the maximum number of clients
|
// the current/maximum number of clients
|
||||||
lvwServers->setColumnCount ( 6 );
|
// 0: server name
|
||||||
|
// 1: ping time
|
||||||
|
// 2: number of musicians (including additional strings like " (full)")
|
||||||
|
// 3: location
|
||||||
|
// 4: minimum ping time (invisible)
|
||||||
|
// 5: maximum number of clients (invisible)
|
||||||
|
// 6: number of musicians (just the number, invisible)
|
||||||
|
lvwServers->setColumnCount ( 7 );
|
||||||
lvwServers->hideColumn ( 4 );
|
lvwServers->hideColumn ( 4 );
|
||||||
lvwServers->hideColumn ( 5 );
|
lvwServers->hideColumn ( 5 );
|
||||||
|
lvwServers->hideColumn ( 6 );
|
||||||
|
|
||||||
// per default the root shall not be decorated (to save space)
|
// per default the root shall not be decorated (to save space)
|
||||||
lvwServers->setRootIsDecorated ( false );
|
lvwServers->setRootIsDecorated ( false );
|
||||||
|
@ -310,6 +318,9 @@ strLocation += ", " + vecServerInfo[iIdx].HostAddr.InetAddr.toString() +
|
||||||
// store the maximum number of clients
|
// store the maximum number of clients
|
||||||
pNewListViewItem->setText ( 5, QString().setNum ( vecServerInfo[iIdx].iMaxNumClients ) );
|
pNewListViewItem->setText ( 5, QString().setNum ( vecServerInfo[iIdx].iMaxNumClients ) );
|
||||||
|
|
||||||
|
// initialize the current number of connected clients
|
||||||
|
pNewListViewItem->setText ( 6, QString().setNum ( 0 ) );
|
||||||
|
|
||||||
// store host address
|
// store host address
|
||||||
pNewListViewItem->setData ( 0, Qt::UserRole,
|
pNewListViewItem->setData ( 0, Qt::UserRole,
|
||||||
CurHostAddress.toString() );
|
CurHostAddress.toString() );
|
||||||
|
@ -495,7 +506,7 @@ void CConnectDlg::OnTimerPing()
|
||||||
|
|
||||||
// check if the number of child list items matches the number of
|
// check if the number of child list items matches the number of
|
||||||
// connected clients, if not then request the client names
|
// connected clients, if not then request the client names
|
||||||
if ( lvwServers->topLevelItem ( iIdx )->text ( 2 ).toInt() !=
|
if ( lvwServers->topLevelItem ( iIdx )->text ( 6 ).toInt() !=
|
||||||
lvwServers->topLevelItem ( iIdx )->childCount() )
|
lvwServers->topLevelItem ( iIdx )->childCount() )
|
||||||
{
|
{
|
||||||
emit CreateCLServerListReqConnClientsListMes ( CurServerAddress );
|
emit CreateCLServerListReqConnClientsListMes ( CurServerAddress );
|
||||||
|
@ -554,6 +565,9 @@ void CConnectDlg::SetPingTimeAndNumClientsResult ( CHostAddress&
|
||||||
setText ( 2, QString().setNum ( iNumClients ) );
|
setText ( 2, QString().setNum ( iNumClients ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// update number of clients value (hidden)
|
||||||
|
pCurListViewItem->setText ( 6, QString().setNum ( iNumClients ) );
|
||||||
|
|
||||||
// a ping time was received, set item to visible (note that we have
|
// a ping time was received, set item to visible (note that we have
|
||||||
// to check if the item is hidden, otherwise we get a lot of CPU
|
// to check if the item is hidden, otherwise we get a lot of CPU
|
||||||
// usage by calling "setHidden(false)" even if the item was already
|
// usage by calling "setHidden(false)" even if the item was already
|
||||||
|
|
Loading…
Reference in a new issue