ipsservices/ipssosplugin/src/ipsplgdisconnectop.cpp
changeset 23 2dc6caa42ec3
parent 20 ecc8def7944a
child 56 15bc1d5d6267
equal deleted inserted replaced
20:ecc8def7944a 23:2dc6caa42ec3
    21 // <qmail> remove priority const
    21 // <qmail> remove priority const
    22 
    22 
    23 // ----------------------------------------------------------------------------
    23 // ----------------------------------------------------------------------------
    24 // CIpsPlgDisconnectOp::NewL()
    24 // CIpsPlgDisconnectOp::NewL()
    25 // ----------------------------------------------------------------------------
    25 // ----------------------------------------------------------------------------
    26 //
    26 // <qmail> aDoRemoveAfterDisconnect parameter removed
       
    27 // <qmail> MFSMailRequestObserver& changed to pointer
    27 CIpsPlgDisconnectOp* CIpsPlgDisconnectOp::NewL(
    28 CIpsPlgDisconnectOp* CIpsPlgDisconnectOp::NewL(
    28     CMsvSession& aMsvSession,
    29     CMsvSession& aMsvSession,
    29     TRequestStatus& aObserverRequestStatus,
    30     TRequestStatus& aObserverRequestStatus,
    30     TMsvId aService,
    31     TMsvId aService,
    31     CIpsPlgTimerOperation& aActivityTimer,
    32     CIpsPlgTimerOperation& aActivityTimer,
    32     TFSMailMsgId aFSMailBoxId,
    33     TFSMailMsgId aFSMailBoxId,
    33     MFSMailRequestObserver* aFSOperationObserver,
    34     MFSMailRequestObserver* aFSOperationObserver,
    34     TInt aFSRequestId )
    35     TInt aFSRequestId )
    35     {
    36     {
    36     FUNC_LOG;
    37     FUNC_LOG;
    37     // <qmail> aDoRemoveAfterDisconnect removed
    38 // <qmail> aDoRemoveAfterDisconnect removed
    38     CIpsPlgDisconnectOp* op = new(ELeave) CIpsPlgDisconnectOp(
    39     CIpsPlgDisconnectOp* op = new(ELeave) CIpsPlgDisconnectOp(
    39         aMsvSession,
    40         aMsvSession,
    40         aObserverRequestStatus,
    41         aObserverRequestStatus,
    41         aService,
    42         aService,
    42         aActivityTimer,
    43         aActivityTimer,
   128 // ----------------------------------------------------------------------------
   129 // ----------------------------------------------------------------------------
   129 //
   130 //
   130 void CIpsPlgDisconnectOp::DoRunL()
   131 void CIpsPlgDisconnectOp::DoRunL()
   131     {
   132     {
   132     FUNC_LOG;
   133     FUNC_LOG;
       
   134 // <qmail>
   133     if( Connected() )
   135     if( Connected() )
   134         {        
   136         {        
   135         DoDisconnectL();
   137         DoDisconnectL();
       
   138 // </qmail>
   136         }
   139         }
   137     else
   140     else
   138         {                
   141         {                
   139         // <qmail> iDoRemoveAfterDisconnect feature from this op has been removed
   142         // <qmail> iDoRemoveAfterDisconnect feature from this op has been removed
   140         CompleteObserver( KErrNone );
   143         CompleteObserver( KErrNone );
   142     }
   145     }
   143 
   146 
   144 // ----------------------------------------------------------------------------
   147 // ----------------------------------------------------------------------------
   145 // CIpsPlgDisconnectOp::CIpsPlgDisconnectOp()
   148 // CIpsPlgDisconnectOp::CIpsPlgDisconnectOp()
   146 // ----------------------------------------------------------------------------
   149 // ----------------------------------------------------------------------------
   147 //
   150 // <qmail> aDoRemoveAfterDisconnect removed
       
   151 // <qmail> MFSMailRequestObserver& changed to pointer
   148 CIpsPlgDisconnectOp::CIpsPlgDisconnectOp(
   152 CIpsPlgDisconnectOp::CIpsPlgDisconnectOp(
   149     CMsvSession& aMsvSession,
   153     CMsvSession& aMsvSession,
   150     TRequestStatus& aObserverRequestStatus,
   154     TRequestStatus& aObserverRequestStatus,
   151     TMsvId aServiceId,
   155     TMsvId aServiceId,
   152     CIpsPlgTimerOperation& aActivityTimer,
   156     CIpsPlgTimerOperation& aActivityTimer,
   170 // ----------------------------------------------------------------------------
   174 // ----------------------------------------------------------------------------
   171 //
   175 //
   172 void CIpsPlgDisconnectOp::ConstructL()
   176 void CIpsPlgDisconnectOp::ConstructL()
   173     {    
   177     {    
   174     FUNC_LOG;
   178     FUNC_LOG;
       
   179 // <qmail> iDisconnected removed
   175     TMsvId service;
   180     TMsvId service;
       
   181     
   176     iMsvSession.GetEntry( iService, service, iTEntry );
   182     iMsvSession.GetEntry( iService, service, iTEntry );
   177     
   183     
   178     if ( iTEntry.iType.iUid == KUidMsvServiceEntryValue )
   184     if ( iTEntry.iType.iUid == KUidMsvServiceEntryValue )
   179         {
   185         {
   180         BaseConstructL( iTEntry.iMtm );
   186         BaseConstructL( iTEntry.iMtm );
   181         }
   187         }
   182     else
   188     else
   183         {
   189         {
       
   190         //should we panic with own codes?
   184         User::Leave( KErrNotSupported );
   191         User::Leave( KErrNotSupported );
   185         }
   192         }
   186     
   193     
   187     // <qmail> SetActive(); moved inside CompleteThis();
   194     // <qmail> SetActive(); moved inside CompleteThis();
   188     CompleteThis();
   195     CompleteThis();
   193 // ----------------------------------------------------------------------------
   200 // ----------------------------------------------------------------------------
   194 //
   201 //
   195 void CIpsPlgDisconnectOp::DoDisconnectL()
   202 void CIpsPlgDisconnectOp::DoDisconnectL()
   196     {
   203     {
   197     FUNC_LOG;
   204     FUNC_LOG;
       
   205     iStatus = KRequestPending;
       
   206     
   198     TInt cmd = (iTEntry.iMtm == KUidMsgTypePOP3) ? KPOP3MTMDisconnect : KIMAP4MTMDisconnect;
   207     TInt cmd = (iTEntry.iMtm == KUidMsgTypePOP3) ? KPOP3MTMDisconnect : KIMAP4MTMDisconnect;
   199     InvokeClientMtmAsyncFunctionL( cmd, iService ); // <qmail> 1 param removed
   208     InvokeClientMtmAsyncFunctionL( cmd, iService ); // <qmail> 1 param removed
   200     SetActive();
   209     SetActive();
   201     }
   210     }
   202 
   211 
   214     else
   223     else
   215         {
   224         {
   216         return EIpsOpTypeImap4Disconnect;
   225         return EIpsOpTypeImap4Disconnect;
   217         }
   226         }
   218     }
   227     }
       
   228 // </qmail>
       
   229