diff -r dcf0eedfc1a3 -r d189ee25cf9d ipsservices/ipssosplugin/src/ipsplgimap4moveremoteop.cpp --- a/ipsservices/ipssosplugin/src/ipsplgimap4moveremoteop.cpp Thu Aug 19 09:38:05 2010 +0300 +++ b/ipsservices/ipssosplugin/src/ipsplgimap4moveremoteop.cpp Tue Aug 31 15:04:17 2010 +0300 @@ -16,67 +16,68 @@ * */ - #include "emailtrace.h" #include "ipsplgheaders.h" -const TInt KMoveRemoteOpPriority = CActive::EPriorityStandard; +// priority parameter has been removed // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- +// TImImap4GetMailInfo& -> TMsvId&, aFunctionId removed +// MFSMailRequestObserver& changed to pointer CIpsPlgImap4MoveRemoteOp* CIpsPlgImap4MoveRemoteOp::NewL( CMsvSession& aMsvSession, TRequestStatus& aObserverRequestStatus, - TInt aFunctionId, TMsvId aService, CIpsPlgTimerOperation& aActivityTimer, - const TImImap4GetMailInfo& aGetMailInfo, - const CMsvEntrySelection& aSel, + const TMsvId& aDestinationFolderId, + const CMsvEntrySelection& aSelection, TFSMailMsgId aFSMailBoxId, - MFSMailRequestObserver& aFSOperationObserver, + MFSMailRequestObserver* aFSOperationObserver, TInt aFSRequestId ) { FUNC_LOG; CIpsPlgImap4MoveRemoteOp* op = new (ELeave) CIpsPlgImap4MoveRemoteOp( aMsvSession, aObserverRequestStatus, - aFunctionId, aService, aActivityTimer, - aGetMailInfo, + aDestinationFolderId, aFSMailBoxId, aFSOperationObserver, aFSRequestId ); CleanupStack::PushL( op ); - op->ConstructL( aSel ); + op->ConstructL( aSelection ); CleanupStack::Pop( op ); return op; } // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- +// TImImap4GetMailInfo& -> TMsvId&, aFunctionId removed, priority param removed +// MFSMailRequestObserver& changed to pointer CIpsPlgImap4MoveRemoteOp::CIpsPlgImap4MoveRemoteOp( CMsvSession& aMsvSession, TRequestStatus& aObserverRequestStatus, - TInt aFunctionId, TMsvId aService, CIpsPlgTimerOperation& aActivityTimer, - const TImImap4GetMailInfo& aGetMailInfo, + const TMsvId& aDestinationFolderId, TFSMailMsgId aFSMailBoxId, - MFSMailRequestObserver& aFSOperationObserver, + MFSMailRequestObserver* aFSOperationObserver, TInt aFSRequestId ) : CIpsPlgOnlineOperation( - aMsvSession, - KMoveRemoteOpPriority, - aObserverRequestStatus, - aActivityTimer, - aFSMailBoxId, - aFSOperationObserver, - aFSRequestId ), - iFunctionId(aFunctionId), - iGetMailInfo(aGetMailInfo) + aMsvSession, + aObserverRequestStatus, + aActivityTimer, + aFSMailBoxId, + aFSOperationObserver, + aFSRequestId ), +// + iState( EIdle ), + iDestinationFolderId( aDestinationFolderId ) +// { FUNC_LOG; iService = aService; @@ -88,6 +89,9 @@ { FUNC_LOG; delete iRemoteSel; +// + delete iMoveErrorProgress; +// } // ---------------------------------------------------------------------------- @@ -108,21 +112,20 @@ iState = EConnecting; iStatus = KRequestPending; + // priority parameter has been removed CIpsPlgImap4ConnectOp* connOp = CIpsPlgImap4ConnectOp::NewL( iMsvSession, - KMoveRemoteOpPriority, iStatus, iService, *iActivityTimer, iFSMailboxId, - iFSOperationObserver, - iFSRequestId, + NULL, // no operationobserver for suboperation + 0, // no requestId needed NULL, // event handler not needed whin plain connect - ETrue, - EFalse ); + ETrue ); // do only connect - delete iOperation; - iOperation = connOp; + delete iSubOperation; + iSubOperation = connOp; SetActive(); } @@ -203,8 +206,8 @@ { case EConnecting: { - TBool connected = STATIC_CAST(CIpsPlgImap4ConnectOp*, iOperation)->Connected(); - if( !connected ) + // Connected() usage + if ( !Connected() ) { CompleteObserver( KErrCouldNotConnect ); return; @@ -227,9 +230,9 @@ break; case ERemoteMsgs: // Remote move complete. - if( err != KErrNone && iOperation ) + if( err != KErrNone && iSubOperation ) { - iMoveErrorProgress = iOperation->ProgressL().AllocL(); + iMoveErrorProgress = iSubOperation->ProgressL().AllocL(); } iState = EIdle; // to be considered @@ -266,10 +269,10 @@ err = iMsvSession.GetEntry( id, service, tEntry ); if( KErrNone == err ) { - iRemoteSel->AppendL( id ); - } + iRemoteSel->AppendL( id ); } } + } // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- @@ -291,41 +294,40 @@ // followed by any messages if( iRemoteSel->Count() > 1 ) { - // Switch operations. - delete iOperation; - iOperation = NULL; + // deletion of iSubOperation is done inside InvokeClientMtmAsyncFunctionL // Filters are not used when performing 'move' operation, use normal // getmail info instead - TPckg param( iGetMailInfo ); - InvokeClientMtmAsyncFunctionL( iFunctionId, *iRemoteSel, iService, param ); + // + TPckgBuf paramBuf; + TImImap4GetMailInfo& mailInfo = paramBuf(); + mailInfo.iMaxEmailSize = KMaxTInt32; + mailInfo.iGetMailBodyParts = EGetImap4EmailBodyTextAndAttachments; + mailInfo.iDestinationFolder = iDestinationFolderId; + +// Parameters changed + InvokeClientMtmAsyncFunctionL( KIMAP4MTMMoveMailSelectionWhenAlreadyConnected, *iRemoteSel, paramBuf ); +// SetActive(); } else { - SetActive(); - CompleteThis(); - } + // SetActive(); moved inside CompleteThis(); + CompleteThis(); + } } +// removed CIpsPlgImap4MoveRemoteOp::GetEngineProgress( const TDesC8& aProgress ) + +// new func to this op // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- -TInt CIpsPlgImap4MoveRemoteOp::GetEngineProgress( const TDesC8& aProgress ) +TIpsOpType CIpsPlgImap4MoveRemoteOp::IpsOpType() const { FUNC_LOG; - if( !aProgress.Length() ) - { - return KErrNone; - } - else - { - TPckgBuf paramPack; - paramPack.Copy( aProgress ); - const TImap4GenericProgress& progress = paramPack().iGenericProgress; - - return progress.iErrorCode; - } + return EIpsOpTypeMoveRemoteOp; } +// // class CIpsPlgImap4MoveRemoteOpObserver //