quicker update of musicians list in the server list table
This commit is contained in:
parent
12b89d8bf3
commit
54f9705001
2 changed files with 9 additions and 16 deletions
|
@ -6,6 +6,8 @@
|
||||||
|
|
||||||
- added vocal banjo/mandolin instrument icons created by atsampson (#283)
|
- added vocal banjo/mandolin instrument icons created by atsampson (#283)
|
||||||
|
|
||||||
|
- quicker update of musicians list in the server list table
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -130,11 +130,9 @@ CConnectDlg::CConnectDlg ( CClient* pNCliP,
|
||||||
// 3: location
|
// 3: location
|
||||||
// 4: minimum ping time (invisible)
|
// 4: minimum ping time (invisible)
|
||||||
// 5: maximum number of clients (invisible)
|
// 5: maximum number of clients (invisible)
|
||||||
// 6: number of musicians (just the number, invisible)
|
lvwServers->setColumnCount ( 6 );
|
||||||
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 );
|
||||||
|
@ -396,9 +394,6 @@ void CConnectDlg::SetServerList ( const CHostAddress& InetAddr,
|
||||||
// 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, CurHostAddress.toString() );
|
pNewListViewItem->setData ( 0, Qt::UserRole, CurHostAddress.toString() );
|
||||||
|
|
||||||
|
@ -690,14 +685,6 @@ void CConnectDlg::OnTimerPing()
|
||||||
#else
|
#else
|
||||||
emit CreateCLServerListPingMes ( CurServerAddress );
|
emit CreateCLServerListPingMes ( CurServerAddress );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// check if the number of child list items matches the number of
|
|
||||||
// connected clients, if not then request the client names
|
|
||||||
if ( lvwServers->topLevelItem ( iIdx )->text ( 6 ).toInt() !=
|
|
||||||
lvwServers->topLevelItem ( iIdx )->childCount() )
|
|
||||||
{
|
|
||||||
emit CreateCLServerListReqConnClientsListMes ( CurServerAddress );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -783,8 +770,12 @@ void CConnectDlg::SetPingTimeAndNumClientsResult ( const CHostAddress& InetAddr,
|
||||||
setText ( 2, QString().setNum ( iNumClients ) );
|
setText ( 2, QString().setNum ( iNumClients ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// update number of clients value (hidden)
|
// check if the number of child list items matches the number of
|
||||||
pCurListViewItem->setText ( 6, QString().setNum ( iNumClients ) );
|
// connected clients, if not then request the client names
|
||||||
|
if ( iNumClients != pCurListViewItem->childCount() )
|
||||||
|
{
|
||||||
|
emit CreateCLServerListReqConnClientsListMes ( InetAddr );
|
||||||
|
}
|
||||||
|
|
||||||
// this is the first time a ping time was received, set item to visible
|
// this is the first time a ping time was received, set item to visible
|
||||||
if ( bIsFirstPing )
|
if ( bIsFirstPing )
|
||||||
|
|
Loading…
Reference in a new issue