Hi guys
well i have developed an application that return the number of call entries of each missed/dialed/received. when i call delete history, it delete all call and return total calls deleted. but the case is that if i got three times miss call from a same number, it return me 1 when ask for number of calls but it return 3 when i delete that call. can some one help me why it is not counting duplicate calls on simple traversing.
code is as below
Thanx in advance.
void CCallLogReader :: RunL()
{
if( iStatus != KErrCancel )
switch( iState )
{
case EWaitingChange: // new event
GetLatestL();
break;
case EReadingLog: // start reading log events from last to first
if( iRecentLogView->CountL() > 0 )
{
iState = EReadingLogItems;
if( iRecentLogView->LastL( iStatus ) ) // to last event
{
SetActive();
}
else
{
ReadPreviousL();
}
}
else
{
ReadPreviousL();
}
break;
case EReadingLogItems: // reading event
if( iStatus == KErrNone && iRecentLogView )
{
if(iIsDelete)
{
iCount++;
iState = EReadingLog;
iLogClient->DeleteEvent(iRecentLogView->Event().Id(), iStatus);
SetActive();
}
else
{
iState = EFindingDuplicates;
if (iRecentLogView->DuplicatesL(*iDuplicateView, iStatus))
{
SetActive();
}
else
{
iCount++;
if( iRecentLogView->PreviousL( iStatus ) ) // to last event
{
iState = EReadingLogItems;
SetActive();
}
else
{
ReadPreviousL();
}
}
}
}
break;
case EFindingDuplicates:
if( iStatus == KErrNone && iRecentLogView && iDuplicateView && iDuplicateView->CountL() > 0 )
{
iState = EReadingDupeItems;
if( iDuplicateView->LastL( iStatus ) ) // to last event
{
SetActive();
}
else
{
iCount++;
iStatus = EReadingLogItems;
if( iRecentLogView->PreviousL( iStatus ) ) // to last event
{
SetActive();
}
else
{
ReadPreviousL();
}
}
}
break;
case EReadingDupeItems:
if( iStatus == KErrNone && iDuplicateView )
{
iDupeCount++;
if( iDuplicateView->PreviousL( iStatus ) ) // try to read prev. event
{
iCount++;
SetActive();
}
else
{
iCount++;
iStatus = EReadingLogItems;
if( iRecentLogView->PreviousL( iStatus ) ) // to last event
{
SetActive();
}
else
{
ReadPreviousL();
}
}
}
break;
default:
break;
}
}
void CCallLogReader :: ReadPreviousL()
{
if(iRequestID == 1)
{
iNoOfIncomingCalls = iCount;
StartL();
}
else if(iRequestID == 2)
{
iNoOfOutgoingCalls = iCount;
StartL();
}
else if(iRequestID == 3)
{
iNoOfMissCalls = iCount;
iRequestID = 4;
StartL();
}
}
void CCallLogReader :: GetLatestL()
{
iState = EReadingLog;
iRecentLogView->Cancel();
if( iRecentLogView->SetRecentListL( iTLogRecentList, iStatus ) )
{
SetActive();
}
else
{
StartL();
}
}



