diff -r 011f79704660 -r cdd802add233 emailuis/nmframeworkadapter/src/nmfwamessagefetchingoperation.cpp --- a/emailuis/nmframeworkadapter/src/nmfwamessagefetchingoperation.cpp Fri Jun 11 16:23:29 2010 +0100 +++ b/emailuis/nmframeworkadapter/src/nmfwamessagefetchingoperation.cpp Thu Jul 22 16:30:28 2010 +0100 @@ -29,16 +29,20 @@ mRequestId(0) { + NM_FUNCTION; } NmFwaMessageFetchingOperation::~NmFwaMessageFetchingOperation() { + NM_FUNCTION; + doCancelOperation(); - NMLOG("NmFwaMessageFetchingOperation::~NmFwaMessageFetchingOperation --->"); } void NmFwaMessageFetchingOperation::doRunAsyncOperation() { + NM_FUNCTION; + const TFSMailMsgId mailboxId(mMailboxId.pluginId32(), mMailboxId.id32()); const TFSMailMsgId folderId(mFolderId.pluginId32(), mFolderId.id32()); const TFSMailMsgId messageId(mMessageId.pluginId32(), mMessageId.id32()); @@ -62,9 +66,27 @@ } } +/*! + * Complete the operation + */ +void NmFwaMessageFetchingOperation::doCompleteOperation() +{ + NM_FUNCTION; + + mRequestId = NmNotFoundError; +} + +/*! + Cancels the async operation. \sa NmOperation + */ void NmFwaMessageFetchingOperation::doCancelOperation() { - TRAP_IGNORE(mMailClient.CancelL(mRequestId)); + NM_FUNCTION; + + if (mRequestId >= 0) { + TRAP_IGNORE(mMailClient.CancelL(mRequestId)); + mRequestId = NmNotFoundError; + } } /*! @@ -75,6 +97,8 @@ */ void NmFwaMessageFetchingOperation::RequestResponseL(TFSProgress aEvent, TInt aRequestId) { + NM_FUNCTION; + if (aRequestId == mRequestId) { if (aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestComplete ) { completeOperation(NmNoError);