ipsservices/ipssosaoplugin/src/IpsSosAOImapAgent.cpp
changeset 59 16ed8d08d0b1
parent 54 997a02608b3a
child 75 47d84de1c893
--- a/ipsservices/ipssosaoplugin/src/IpsSosAOImapAgent.cpp	Tue Jul 06 14:04:34 2010 +0300
+++ b/ipsservices/ipssosaoplugin/src/IpsSosAOImapAgent.cpp	Wed Aug 18 09:37:47 2010 +0300
@@ -16,29 +16,7 @@
 *
 */
 
-
-#include "emailtrace.h"
-#include <cemailaccounts.h>
-#include <imapcmds.h>
-#include <miutset.h>
-#include <impcmtm.h>
-#include <msvapi.h>
-#include <AlwaysOnlineManagerCommon.h>
-#include "CFSMailCommon.h"
-
-#include "IpsSosAOImapAgent.h"
-#include "IpsSosAOImapPopLogic.h"
-
-
-//<QMail>
-#include "IpsSosAOSettingsHandler.h"
-
-//<qmail> removed
-//</QMail>
-
-// from ipsplugin
-#include "ipsplgimap4populateop.h"
-#include "ipsplgcommon.h"
+#include "ipssosaopluginheaders.h"
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
@@ -207,6 +185,7 @@
          case EStateFetchOnHold:
              break;
          case EStateDisconnect:
+             NM_COMMENT("CIpsSosAOImapAgent: disconnecting");
              if ( !iDoNotDisconnect )
                  {
                  CancelAllAndDisconnectL();
@@ -218,6 +197,7 @@
                  }
              break;
          case EStateCompleted:
+             NM_COMMENT("CIpsSosAOImapAgent: completed");
              TRAP_IGNORE( iOpResponse.OperationCompletedL( iError ) );
              SignalSyncCompleted( iServiceId, iError );
              iError = KErrNone;
@@ -330,6 +310,7 @@
     LoadSettingsL( );
     if ( !IsConnected() )
         {
+        NM_COMMENT("CIpsSosAOImapAgent: starting sync");
         TPckg<MMsvImapConnectionObserver*> parameter(this);
         // connect and synchronise starts background sync or idle
         CMsvEntrySelection* sel = new ( ELeave ) CMsvEntrySelection();
@@ -345,10 +326,11 @@
         }
     else
         {
+        NM_COMMENT("CIpsSosAOImapAgent: already connected do not sync");
         // do not do anything if we are connected, especially do never
         // try to sync if sync is is already started (ex. from ips plugin)
         // that cause problems with imap flags etc.
-        iError = KErrNone;
+        iError = KErrCancel;
         iState = EStateCompleted;
         SetActiveAndCompleteThis();
         }