emailuis/nmframeworkadapter/src/nmfwamessagefetchingoperation.cpp
changeset 23 2dc6caa42ec3
parent 20 ecc8def7944a
child 27 9ba4404ef423
equal deleted inserted replaced
20:ecc8def7944a 23:2dc6caa42ec3
    13  *
    13  *
    14  * Description:
    14  * Description:
    15  *
    15  *
    16  */
    16  */
    17 
    17 
    18 #include "nmfwamessagefetchingoperation.h"
       
    19 #include "nmframeworkadapterheaders.h"
    18 #include "nmframeworkadapterheaders.h"
    20 
    19 
    21 NmFwaMessageFetchingOperation::NmFwaMessageFetchingOperation(
    20 NmFwaMessageFetchingOperation::NmFwaMessageFetchingOperation(
    22     const NmId &mailboxId,
    21     const NmId &mailboxId,
    23     const NmId &folderId,
    22     const NmId &folderId,
    24     const NmId &messageId,
    23     const NmId &messageId,
    25     CFSMailClient &mailClient,
    24     CFSMailClient &mailClient) 
    26     QObject *parent) :
    25       : mMailboxId(mailboxId),
    27         NmOperation(parent),
       
    28         mMailboxId(mailboxId),
       
    29         mFolderId(folderId),
    26         mFolderId(folderId),
    30         mMessageId(messageId),
    27         mMessageId(messageId),
    31         mMailClient(mailClient),
    28         mMailClient(mailClient),
    32         mRequestId(0)
    29         mRequestId(0)
    33 
    30 
    35 }
    32 }
    36 
    33 
    37 NmFwaMessageFetchingOperation::~NmFwaMessageFetchingOperation()
    34 NmFwaMessageFetchingOperation::~NmFwaMessageFetchingOperation()
    38 {
    35 {
    39     doCancelOperation();
    36     doCancelOperation();
       
    37     NMLOG("NmFwaMessageFetchingOperation::~NmFwaMessageFetchingOperation --->");
    40 }
    38 }
    41 
    39 
    42 void NmFwaMessageFetchingOperation::doRunAsyncOperation()
    40 void NmFwaMessageFetchingOperation::doRunAsyncOperation()
    43 {
    41 {
    44     const TFSMailMsgId mailboxId(mMailboxId.pluginId32(), mMailboxId.id32());
    42     const TFSMailMsgId mailboxId(mMailboxId.pluginId32(), mMailboxId.id32());
    80     if (aRequestId == mRequestId) {
    78     if (aRequestId == mRequestId) {
    81         if (aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestComplete ) {
    79         if (aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestComplete ) {
    82             completeOperation(NmNoError);
    80             completeOperation(NmNoError);
    83         }
    81         }
    84         else if (aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestCancelled) {
    82         else if (aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestCancelled) {
    85             operationCancelled();
    83             completeOperation(NmCancelError); 
    86         }
    84         }
    87     }
    85     }
    88 }
    86 }