diff -r ecc8def7944a -r 2dc6caa42ec3 ipsservices/ipssosplugin/src/ipsplgcreatemessageoperation.cpp --- a/ipsservices/ipssosplugin/src/ipsplgcreatemessageoperation.cpp Mon May 03 12:23:15 2010 +0300 +++ b/ipsservices/ipssosplugin/src/ipsplgcreatemessageoperation.cpp Fri May 14 15:41:10 2010 +0300 @@ -18,11 +18,10 @@ // // INCLUDE FILES - #include "emailtrace.h" #include "ipsplgheaders.h" -// LOCAL CONSTANTS AND MACROS +// removed // ================= MEMBER FUNCTIONS ======================= @@ -31,11 +30,12 @@ // ---------------------------------------------------------------------------- // // priority parameter has been removed +// iBlank removed +// aSmtpServiceId removed CIpsPlgCreateMessageOperation::CIpsPlgCreateMessageOperation( - CIpsPlgSmtpService* aSmtpService, + CIpsPlgSmtpService& aSmtpService, CMsvSession& aMsvSession, TRequestStatus& aObserverRequestStatus, - TMsvId aSmtpServiceId, TMsvPartList aPartList, TFSMailMsgId aMailBoxId, MFSMailRequestObserver& aOperationObserver, @@ -47,14 +47,13 @@ aRequestId, aMailBoxId), iSmtpService(aSmtpService), - iSmtpServiceId(aSmtpServiceId), iPartList(aPartList), iOperationObserver(aOperationObserver) { FUNC_LOG; CActiveScheduler::Add( this ); } - +// // ---------------------------------------------------------------------------- // CIpsPlgCreateMessageOperation::ConstructL // ---------------------------------------------------------------------------- @@ -70,11 +69,12 @@ // CIpsPlgCreateMessageOperation::NewL // ---------------------------------------------------------------------------- // +// aSmtpServiceId removed +// aSmtpService changed to reference CIpsPlgCreateMessageOperation* CIpsPlgCreateMessageOperation::NewL( - CIpsPlgSmtpService* aSmtpService, + CIpsPlgSmtpService& aSmtpService, CMsvSession& aMsvSession, TRequestStatus& aObserverRequestStatus, - TMsvId aSmtpServiceId, TMsvPartList aPartList, TFSMailMsgId aMailBoxId, MFSMailRequestObserver& aOperationObserver, @@ -83,14 +83,14 @@ FUNC_LOG; CIpsPlgCreateMessageOperation* self = new (ELeave) CIpsPlgCreateMessageOperation( - aSmtpService, aMsvSession, aObserverRequestStatus, aSmtpServiceId, + aSmtpService, aMsvSession, aObserverRequestStatus, aPartList, aMailBoxId, aOperationObserver, aRequestId ); CleanupStack::PushL( self ); self->ConstructL(); CleanupStack::Pop( self ); return self; } - +// // ---------------------------------------------------------------------------- // CIpsPlgCreateMessageOperation::~CIpsPlgCreateMessageOperation // ---------------------------------------------------------------------------- @@ -134,16 +134,14 @@ { // new message creation has finished so make an FS type message CFSMailMessage* newMessage = NULL; + // removed trap, handled in RunError + TMsvId msgId; - TMsvId msgId = TMsvId(); - TRAPD( err, msgId = GetIdFromProgressL( iOperation->FinalProgress() ) ); + msgId = GetIdFromProgressL( iOperation->FinalProgress() ); - if( err == KErrNone ) - { - newMessage = iSmtpService->CreateFSMessageAndSetFlagsL( - msgId, KErrNotFound, iFSMailboxId.Id() ); - } - + newMessage = iSmtpService.CreateFSMessageAndSetFlagsL( + msgId, KErrNotFound, iFSMailboxId.Id() ); + // // relay the created message (observer takes ownership) SignalFSObserver( iStatus.Int(), newMessage ); } @@ -152,7 +150,7 @@ TRequestStatus* status = &iObserverRequestStatus; User::RequestComplete( status, iStatus.Int() ); } - +// // ---------------------------------------------------------------------------- // CIpsPlgCreateMessageOperation::RunError() // ---------------------------------------------------------------------------- @@ -166,7 +164,8 @@ User::RequestComplete( status, aError ); return KErrNone; // RunError must return KErrNone to active sheduler. } - +// +// function description updated // ---------------------------------------------------------------------------- // CIpsPlgCreateMessageOperation::GetIdFromProgressL // ---------------------------------------------------------------------------- @@ -174,7 +173,7 @@ TMsvId CIpsPlgCreateMessageOperation::GetIdFromProgressL( const TDesC8& aProg ) { FUNC_LOG; - // Taken from symbian os help example code + // comment removed // Create and initialise a temporary TPckg object that // can hold a message Id. TMsvId msgId; @@ -192,9 +191,9 @@ } return msgId; } - +// function description updated // ---------------------------------------------------------------------------- -// CIpsPlgCreateMessageOperation::ProgressL +// CIpsPlgCreateMessageOperation::SignalFSObserver // ---------------------------------------------------------------------------- // void CIpsPlgCreateMessageOperation::SignalFSObserver( @@ -232,8 +231,9 @@ return iOperation->ProgressL(); } } - + // return KNullDesC8; + // } // --------------------------------------------------------------------------- @@ -284,20 +284,28 @@ void CIpsPlgCreateMessageOperation::StartMessageCreationL() { FUNC_LOG; + // + TMsvId service; + TMsvEntry mboxEntry; + delete iOperation; iOperation = NULL; - + + User::LeaveIfError( + iMsvSession.GetEntry( iFSMailboxId.Id(), service, mboxEntry ) ); + // + // removed useless parameter // Start a new operation, execution continues in RunL // once the operation has finished. iOperation = CImEmailOperation::CreateNewL( iStatus, iMsvSession, KMsvDraftEntryId, - iSmtpServiceId, + mboxEntry.iRelatedId, // SMTP service id iPartList, KMsvEmailTypeListMHTMLMessage, - //0, KUidMsgTypeSMTP); + // }