code style changes

This commit is contained in:
Volker Fischer 2012-05-11 15:10:13 +00:00
parent ddfa045419
commit e32d80b9db

View file

@ -59,8 +59,7 @@ CServerListManager::CServerListManager ( const quint16 iNPortNum,
// init server list entry (server info for this server) with defaults, per // init server list entry (server info for this server) with defaults, per
// definition the client substitudes the IP address of the central server // definition the client substitudes the IP address of the central server
// itself for his server list // itself for his server list
CServerListEntry ThisServerListEntry ( CServerListEntry ThisServerListEntry ( CHostAddress(),
CHostAddress(),
iPortNumber, iPortNumber,
"", "",
"", "",
@ -107,8 +106,7 @@ CServerListManager::CServerListManager ( const quint16 iNPortNum,
( iNumPredefinedServers <= MAX_NUM_SERVERS_IN_SERVER_LIST ) ) ( iNumPredefinedServers <= MAX_NUM_SERVERS_IN_SERVER_LIST ) )
{ {
// create a new server list entry // create a new server list entry
CServerListEntry NewServerListEntry ( CServerListEntry NewServerListEntry ( CHostAddress(),
CHostAddress(),
0, // port number not used 0, // port number not used
"", "",
"", "",
@ -136,8 +134,8 @@ CServerListManager::CServerListManager ( const quint16 iNPortNum,
if ( ( iCountry >= 0 ) && ( iCountry <= QLocale::LastCountry ) ) if ( ( iCountry >= 0 ) && ( iCountry <= QLocale::LastCountry ) )
{ {
NewServerListEntry.eCountry = static_cast<QLocale::Country> ( NewServerListEntry.eCountry =
iCountry ); static_cast<QLocale::Country> ( iCountry );
} }
// add the new server to the server list // add the new server to the server list
@ -146,6 +144,7 @@ CServerListManager::CServerListManager ( const quint16 iNPortNum,
// we have used four items and have created one predefined server // we have used four items and have created one predefined server
// (adjust counters) // (adjust counters)
iCurUsedServInfoSplitItems += 4; iCurUsedServInfoSplitItems += 4;
iNumPredefinedServers++; iNumPredefinedServers++;
} }
@ -269,6 +268,7 @@ void CServerListManager::CentralServerRegisterServer ( const CHostAddress& In
// a server. The very first list entry must not be checked since // a server. The very first list entry must not be checked since
// this is per definition the central server (i.e., this server) // this is per definition the central server (i.e., this server)
int iSelIdx = ciInvalidIdx; // initialize with an illegal value int iSelIdx = ciInvalidIdx; // initialize with an illegal value
for ( int iIdx = 1; iIdx < iCurServerListSize; iIdx++ ) for ( int iIdx = 1; iIdx < iCurServerListSize; iIdx++ )
{ {
if ( ServerList[iIdx].HostAddr == InetAddr ) if ( ServerList[iIdx].HostAddr == InetAddr )
@ -285,6 +285,8 @@ void CServerListManager::CentralServerRegisterServer ( const CHostAddress& In
if ( iSelIdx == ciInvalidIdx ) if ( iSelIdx == ciInvalidIdx )
{ {
// create a new server list entry and init with received data // create a new server list entry and init with received data
// (note that the "update registration" is called in the
// constructor of the server list entry)
ServerList.append ( CServerListEntry ( InetAddr, ServerInfo ) ); ServerList.append ( CServerListEntry ( InetAddr, ServerInfo ) );
} }
else else
@ -349,7 +351,7 @@ void CServerListManager::CentralServerQueryServerList ( const CHostAddress& Inet
// copy the list (we have to copy it since the message requires // copy the list (we have to copy it since the message requires
// a vector but the list is actually stored in a QList object and // a vector but the list is actually stored in a QList object and
// not in a vector object // not in a vector object)
for ( int iIdx = 0; iIdx < iCurServerListSize; iIdx++ ) for ( int iIdx = 0; iIdx < iCurServerListSize; iIdx++ )
{ {
// copy list item // copy list item
@ -416,6 +418,7 @@ void CServerListManager::SlaveServerRegisterServer ( const bool bIsRegister )
// it is an URL of a dynamic IP address, the IP address might have // it is an URL of a dynamic IP address, the IP address might have
// changed in the meanwhile. // changed in the meanwhile.
CHostAddress HostAddress; CHostAddress HostAddress;
if ( LlconNetwUtil().ParseNetworkAddress ( strCurCentrServAddr, if ( LlconNetwUtil().ParseNetworkAddress ( strCurCentrServAddr,
HostAddress ) ) HostAddress ) )
{ {