ipsservices/ipssosplugin/src/ipsplgimap4plugin.cpp
branchRCL_3
changeset 24 d189ee25cf9d
parent 16 b5fbb9b25d57
child 25 3533d4323edc
--- a/ipsservices/ipssosplugin/src/ipsplgimap4plugin.cpp	Thu Aug 19 09:38:05 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgimap4plugin.cpp	Tue Aug 31 15:04:17 2010 +0300
@@ -15,13 +15,10 @@
 *
 */
 
-
-
 #include "emailtrace.h"
 #include "ipsplgheaders.h"
-#include <baseplugincommonutils.h>     // CleanupResetAndDestroyPushL
 
-const TInt KConnectOpPriority = CActive::EPriorityStandard;
+// <qmail> priority const has been removed
 
 // ---------------------------------------------------------------------------
 // CIpsPlgImap4Plugin::CIpsPlgImap4Plugin()
@@ -34,7 +31,6 @@
     // none
     }
 
-
 // ---------------------------------------------------------------------------
 // CIpsPlgImap4Plugin::ConstructL()
 // ---------------------------------------------------------------------------
@@ -45,7 +41,6 @@
     BaseConstructL();
     }
 
-
 // ---------------------------------------------------------------------------
 // CIpsPlgImap4Plugin::NewL()
 // ---------------------------------------------------------------------------
@@ -58,7 +53,6 @@
     return self;
     }
 
-
 // ---------------------------------------------------------------------------
 // CIpsPlgImap4Plugin::NewLC()
 // ---------------------------------------------------------------------------
@@ -147,7 +141,8 @@
 void CIpsPlgImap4Plugin::RefreshNowL(
     const TFSMailMsgId& aMailBoxId,
     MFSMailRequestObserver& aOperationObserver,
-    TInt aRequestId )
+    TInt aRequestId,
+    const TBool /*aSilentConnection*/ )
     {
     FUNC_LOG;
     
@@ -156,14 +151,14 @@
     CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewL( *this );
     CleanupStack::PushL( watcher );
     
+    // <qmail> priority parameter has been removed
     CIpsPlgBaseOperation* op = CIpsPlgImap4ConnectOp::NewL(
     		*iSession,
-    		KConnectOpPriority, 
     		watcher->iStatus, 
     		service,
     		ActivityTimerL( aMailBoxId ),
           	aMailBoxId, 
-          	aOperationObserver,
+          	&aOperationObserver,
           	aRequestId,
           	iEventHandler );
     
@@ -300,16 +295,16 @@
     info.iAttachmentSizeLimit = 0;
     info.iDestinationFolder = aFolderId.Id();
     
+    // <qmail> priority parameter has been removed
     CIpsPlgBaseOperation* op = CIpsPlgImap4PopulateOp::NewL( 
         *iSession, 
         watcher->iStatus,
-        CActive::EPriorityStandard,
         aMailBoxId.Id(),
         ActivityTimerL( aMailBoxId ),
         info,
         *sel,
         aMailBoxId, 
-        aObserver,
+        &aObserver,
         aRequestId,
         iEventHandler, 
         EFalse ); // do not filter mail selection
@@ -356,12 +351,8 @@
             {
             sel->AppendL( aMessageIds[i].Id() );
             }
-
-        TPckgBuf<TImImap4GetMailInfo> optionsBuf;
-        TImImap4GetMailInfo& options = optionsBuf();
-        options.iMaxEmailSize = KMaxTInt32;
-        options.iGetMailBodyParts = EGetImap4EmailHeaders;
-        options.iDestinationFolder = aDestinationFolderId.Id();
+    	
+		// <qmail> TImImap4GetMailInfo options not needed
 
         CIpsPlgImap4MoveRemoteOpObserver* observer =
             CIpsPlgImap4MoveRemoteOpObserver::NewL( *iSession, *iEventHandler,
@@ -369,16 +360,16 @@
         watcher->SetRequestObserver( observer );
 
         // Synchronous operation
-        CIpsPlgBaseOperation* op = CIpsPlgImap4MoveRemoteOp::NewL(
+        // <qmail> following constructor's parameters have changed
+    	CIpsPlgBaseOperation* op = CIpsPlgImap4MoveRemoteOp::NewL(
             *iSession, 
             watcher->iStatus,
-            KIMAP4MTMMoveMailSelectionWhenAlreadyConnected,
             service,
             ActivityTimerL( aMailBoxId ),
-            options,
+            aDestinationFolderId.Id(),
             *sel,
             aMailBoxId,
-            *observer, // async not supported
+            NULL, // no observer, async not supported
             0 ); // async not supported
 
         watcher->SetOperation( op );
@@ -442,17 +433,17 @@
         options.iGetMailBodyParts = EGetImap4EmailBodyTextAndAttachments;
         options.iDestinationFolder = aDestinationFolderId.Id();
 
-        CIpsPlgBaseOperation* op = CIpsPlgImap4MoveRemoteOp::NewL(
+		// <qmail> following constructor's parameters have changed
+    	CIpsPlgBaseOperation* op = CIpsPlgImap4MoveRemoteOp::NewL(
             *iSession, 
             watcher->iStatus,
-            KIMAP4MTMMoveMailSelectionWhenAlreadyConnected,
             service,
             ActivityTimerL( aMailBoxId ),
-            options,
+            aDestinationFolderId.Id(),
             *sel,
             aMailBoxId,
-            aOperationObserver,
-            aRequestId ); 
+            &aOperationObserver, // async not supported
+            0 ); // async not supported
 
         watcher->SetOperation( op );
         CleanupStack::PopAndDestroy( sel );
@@ -533,21 +524,23 @@
             }
         
         }
-    
-    TPckgBuf<TImImap4GetMailInfo> optionsBuf;
-    TImImap4GetMailInfo& options = optionsBuf();
-    options.iMaxEmailSize = KMaxTInt32;
-    options.iGetMailBodyParts = EGetImap4EmailAttachments;
-    options.iDestinationFolder = 0; // not used
-    
+       
+	// <qmail> TImImap4GetMailInfo options removed
     CIpsPlgBaseOperation* op = CIpsPlgImap4FetchAttachmentOp::NewL( 
-        *iSession, watcher->iStatus, KIMAP4MTMPopulate, aMailBoxId.Id(),
-        ActivityTimerL( aMailBoxId ), options, *sel, aMailBoxId,
-        aOperationObserver, aRequestId );
+        *iSession, 
+        watcher->iStatus,
+        aMailBoxId.Id(),
+        ActivityTimerL( aMailBoxId ), 
+        sel, // ownership is transferred
+        aMailBoxId,
+        &aOperationObserver,
+        aRequestId );
     
     watcher->SetOperation( op );
-    CleanupStack::PopAndDestroy( sel );
     iOperations.AppendL( watcher );
+// <qmail>
+    CleanupStack::Pop( sel );
+// </qmail>
     CleanupStack::Pop( watcher );
     }
 
@@ -585,13 +578,15 @@
     accounts->GetImapAccountL( aMailboxId.Id(), imapAcc );
     accounts->LoadImapSettingsL( imapAcc, *settings );
     TImImap4GetPartialMailInfo info;
-    CIpsSetDataApi::ConstructImapPartialFetchInfo( info, *settings );
+// <qmail> Get TImImap4GetPartialMailInfo based on settings
+    CIpsPlgImap4ConnectOp::ConstructImapPartialFetchInfo( info, *settings );
     CleanupStack::PopAndDestroy( 2, settings );
-    
+
     if ( info.iTotalSizeLimit == KIpsSetDataHeadersOnly )
         {
         return;
         }
+// </qmail>
     
     TPckgBuf<TImImap4GetPartialMailInfo> package(info);
     
@@ -603,17 +598,17 @@
     sel->AppendL( aMailboxId.Id() );
     sel->AppendL( aNewId );
     
+    // <qmail> priority parameter has been removed
     CIpsPlgBaseOperation* op = CIpsPlgImap4PopulateOp::NewL( 
         *iSession, 
         watcher->iStatus,
-        KIMAP4MTMPopulateMailSelectionWhenAlreadyConnected,
         aMailboxId.Id(),
         ActivityTimerL( aMailboxId ),
         info,
         *sel,
         aMailboxId, 
-        *this,
-        KErrNotFound,
+        NULL, // no operation observer
+        0,    // no use for requestId
         iEventHandler,
         EFalse ); // do not block entry changed and created events