×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Dec 2008
    Posts
    129

    Question Delete call logs/ recent calls

    Hi I m trying to remove all the recent call logs using the following code:
    But can only delete one log.
    After that my background exe crashes.
    I m trying it for s60 3rd MR.
    How can i remove all call logs one by one?

    CLogRemover::CLogRemover():CActive(CActive::EPriorityStandard)
    {
    CActiveScheduler::Add(this);
    }


    CLogRemover::~CLogRemover()
    {
    Cancel();
    delete iView;
    delete iFilter;
    delete iClient;
    iFsSession.Close();
    }


    CLogRemover* CLogRemover::NewL()
    {
    CLogRemover *self;
    self=new (ELeave) CLogRemover;
    CleanupStack::PushL(self);
    self->ConstructL();
    CleanupStack::Pop();
    return self;
    }

    void CLogRemover::ConstructL()
    {
    //open file server session
    User::LeaveIfError(iFsSession.Connect());

    iClient=CLogClient::NewL(iFsSession);
    iView=CLogViewEvent::NewL(*iClient);
    iFilter=CLogFilter::NewL();

    i=0;
    }

    void CLogRemover::ClearMissedLogL()
    {
    iFilter->SetEventType(KLogCallEventTypeUid);
    TBuf<64> direction;
    iClient->GetString(direction,R_LOG_RECENT); //R_LOG_DIR_MISSED
    iFilter->SetDirection(direction);

    AppendToDebugFileL(_L("\\data\\others\\ClearMissedLogL1.txt"),i);

    TBool eventInView = iView->SetFilterL(*iFilter,iStatus);
    if(eventInView)
    {
    SetActive();
    AppendToDebugFileL(_L("\\data\\others\\ClearMissedLogL2.txt"),i);
    }
    else
    {
    AppendToDebugFileL(_L("\\data\\others\\ClearMissedLogL3.txt"),i);
    User::Exit(0);
    }

    }

    void CLogRemover::RunL()
    {
    const CLogEvent& event1 = iView->Event();
    AppendToDebugFileL(_L("\\data\\others\\RunL1.txt"),i);
    iClient->DeleteEvent(event1.Id(), iStatus);
    AppendToDebugFileL(_L("\\data\\others\\RunL2.txt"),i);

    i++;

    ClearMissedLogL();
    AppendToDebugFileL(_L("\\data\\others\\RunL3.txt"),i);


    }

    void CLogRemover:oCancel()
    {
    if(IsActive())
    {
    iView->Cancel();
    iClient->Cancel();
    }
    }


    pls help
    Last edited by NRK; 2009-09-17 at 08:28.

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,175

    Re: Delete call logs/ recent calls

    What is the crash code ?, and can you point out the line it is crashing in ?

  3. #3
    Regular Contributor
    Join Date
    Dec 2008
    Posts
    129

    Re: Delete call logs/ recent calls

    hi symbianyucca,

    i dont know how to get the panic code.
    but it crashes on TBool eventInView = iView->SetFilterL(*iFilter,iStatus);
    which is marked red in the follwoing code.
    and the crash occurs on third call to this function.

  4. #4
    Super Contributor
    Join Date
    Nov 2004
    Posts
    1,009

    Re: Delete call logs/ recent calls

    Quote Originally Posted by NRK View Post
    hi symbianyucca,

    i dont know how to get the panic code.
    but it crashes on TBool eventInView = iView->SetFilterL(*iFilter,iStatus);
    which is marked red in the follwoing code.
    and the crash occurs on third call to this function.
    TRAPD(err,TBool eventInView = iView->SetFilterL(*iFilter,iStatus));

    if(err!=KErrNone)// this err will cntain your error code for panic.
    Regards,
    Shafali

  5. #5
    Registered User
    Join Date
    Jun 2007
    Location
    Mumbai, India
    Posts
    1,998

    Re: Delete call logs/ recent calls

    To check the panic code refer to the wiki article link below

  6. #6
    Regular Contributor
    Join Date
    Dec 2008
    Posts
    129

    Question Re: Delete call logs/ recent calls

    Thanks
    i did what shafali has said like:

    TRAPD(err,TBool eventInView = iView->SetFilterL(*iFilter,iStatus));
    AppendToDebugFileL(_L("\\data\\others\\ClearMissedErr.txt"),err);


    as i mentioned earlier third call to TRAPD(err,TBool eventInView = iView->SetFilterL(*iFilter,iStatus));
    causes crash.
    but in ClearMissedErr.txt only two values of err has written i.e 0 0
    and after executing the third call the value of err is not written in ClearMissedErr.txt

    pls help

  7. #7
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,175

    Re: Delete call logs/ recent calls

    TRAPs don't get panics, so you would need to get the actual panic description, so did you check the link that was given earlier ?

Similar Threads

  1. How do you make calls and receive incoming call event with the PC API ?
    By redware in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2010-05-04, 02:47
  2. Hidng Call Logs.
    By dinesh547 in forum Symbian
    Replies: 24
    Last Post: 2009-06-18, 09:54
  3. Detecting call status for conference calls.
    By rahultechie in forum Symbian
    Replies: 2
    Last Post: 2009-01-22, 07:09
  4. How Many Call Logs We Can Retrive
    By pavan in forum Symbian
    Replies: 2
    Last Post: 2006-11-20, 06:57
  5. can not successfully link any sample using .NET
    By lobotomat in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2002-08-20, 00:29

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×