diff --git a/src/llconclientdlg.cpp b/src/llconclientdlg.cpp index 757d3b7d..e76af76f 100755 --- a/src/llconclientdlg.cpp +++ b/src/llconclientdlg.cpp @@ -853,8 +853,7 @@ void CLlconClientDlg::ConnectDisconnect ( const bool bDoStart, { // store new address at the top of the list, if the list was already // full, the last element is thrown out - pClient->vstrIPAddress.AddStringFiFoWithCompare ( strSelectedAddress, - MAX_NUM_SERVER_ADDR_ITEMS ); + pClient->vstrIPAddress.AddStringFiFoWithCompare ( strSelectedAddress ); } // everything was ok with the connection dialog, set flag diff --git a/src/util.h b/src/util.h index f3d72bdf..807894b5 100755 --- a/src/util.h +++ b/src/util.h @@ -112,8 +112,7 @@ public: void Enlarge ( const int iAddedSize ); void Add ( const TData& tI ) { Enlarge ( 1 ); pData[iVectorSize - 1] = tI; } - void AddStringFiFoWithCompare ( const QString strNewValue, - const int iMaxElements ); + void AddStringFiFoWithCompare ( const QString strNewValue ); inline int Size() const { return iVectorSize; } @@ -207,10 +206,9 @@ template void CVector::Reset ( const TData tResetVal ) } // note: this is only supported for string vectors -template void CVector::AddStringFiFoWithCompare ( const QString strNewValue, - const int iMaxElements ) +template void CVector::AddStringFiFoWithCompare ( const QString strNewValue ) { - CVector vstrTempList ( iMaxElements, "" ); + CVector vstrTempList ( iVectorSize, "" ); // store the new element in the current storage list at // the top, make sure we do not have more than allowed stored @@ -218,12 +216,12 @@ template void CVector::AddStringFiFoWithCompare ( const QStr vstrTempList[0] = strNewValue; int iTempListCnt = 1; - for ( int iIdx = 0; iIdx < iMaxElements; iIdx++ ) + for ( int iIdx = 0; iIdx < iVectorSize; iIdx++ ) { // only add old element if it is not the same as the // selected one if ( ( pData[iIdx].compare ( strNewValue ) ) && - ( iTempListCnt < iMaxElements ) ) + ( iTempListCnt < iVectorSize ) ) { vstrTempList[iTempListCnt] = pData[iIdx];