ipsservices/ipssosplugin/src/ipsplgsmtpoperation.cpp
changeset 4 e7aa27f58ae1
parent 0 8466d47a6819
child 8 e1b6206813b4
equal deleted inserted replaced
3:a4d6f1ea0416 4:e7aa27f58ae1
    92     {
    92     {
    93     FUNC_LOG;
    93     FUNC_LOG;
    94     iSelection = new (ELeave) CMsvEntrySelection();
    94     iSelection = new (ELeave) CMsvEntrySelection();
    95     CActiveScheduler::Add( this );
    95     CActiveScheduler::Add( this );
    96     }
    96     }
    97     
    97 
       
    98 // ---------------------------------------------------------------------------
       
    99 // ---------------------------------------------------------------------------
       
   100 //
       
   101 void CIpsPlgSmtpOperation::CompleteObserver( TInt aStatus /*= KErrNone*/ )
       
   102     {
       
   103     FUNC_LOG;
       
   104 
       
   105     TRequestStatus* status = &iObserverRequestStatus;
       
   106     if ( status && status->Int() == KRequestPending )
       
   107         {
       
   108         User::RequestComplete( status, aStatus );
       
   109         }
       
   110     }
       
   111 
       
   112 // ---------------------------------------------------------------------------
       
   113 // ---------------------------------------------------------------------------
       
   114 //
       
   115 void CIpsPlgSmtpOperation::CompleteThis()
       
   116     {
       
   117     FUNC_LOG;
       
   118 
       
   119     TRequestStatus* status = &iStatus;
       
   120     User::RequestComplete( status, KErrNone );
       
   121     }
       
   122 
    98 // ---------------------------------------------------------------------------
   123 // ---------------------------------------------------------------------------
    99 // ---------------------------------------------------------------------------
   124 // ---------------------------------------------------------------------------
   100 //
   125 //
   101 void CIpsPlgSmtpOperation::RunL()
   126 void CIpsPlgSmtpOperation::RunL()
   102     {
   127     {
   113     else if ( iState == ESending )
   138     else if ( iState == ESending )
   114         {
   139         {
   115         TImSmtpProgress prog;
   140         TImSmtpProgress prog;
   116         TPckg<TImSmtpProgress> param(prog);
   141         TPckg<TImSmtpProgress> param(prog);
   117         param.Copy( iOperation->FinalProgress() ); 
   142         param.Copy( iOperation->FinalProgress() ); 
   118         
   143 
   119         TRequestStatus* status = &iObserverRequestStatus;
   144         CompleteObserver( prog.Error() );
   120         User::RequestComplete( status, prog.Error() );
   145         }
   121         }    
       
   122     }
   146     }
   123     
   147     
   124 // ---------------------------------------------------------------------------
   148 // ---------------------------------------------------------------------------
   125 // ---------------------------------------------------------------------------
   149 // ---------------------------------------------------------------------------
   126 //    
   150 //    
   130     
   154     
   131     if ( iOperation )
   155     if ( iOperation )
   132         {
   156         {
   133         iOperation->Cancel();
   157         iOperation->Cancel();
   134         }
   158         }
   135     TRequestStatus* status = &iObserverRequestStatus;
   159 
   136     User::RequestComplete(status, KErrCancel);
   160     CompleteObserver( KErrCancel );
   137     }
   161     }
   138 
   162 
   139 // ---------------------------------------------------------------------------
   163 // ---------------------------------------------------------------------------
   140 // ---------------------------------------------------------------------------
   164 // ---------------------------------------------------------------------------
   141 //   
   165 //   
   269     CleanupStack::PopAndDestroy( childs );
   293     CleanupStack::PopAndDestroy( childs );
   270     if (retValue > 0)
   294     if (retValue > 0)
   271         {
   295         {
   272         CallSendL();
   296         CallSendL();
   273         }
   297         }
       
   298     else
       
   299         {
       
   300         // nothing to do, finish operation
       
   301         CompleteObserver( KErrNone );
       
   302         }
       
   303 
   274     return retValue;
   304     return retValue;
   275     }
   305     }
   276 
   306 
   277 // ---------------------------------------------------------------------------
   307 // ---------------------------------------------------------------------------
   278 // ---------------------------------------------------------------------------
   308 // ---------------------------------------------------------------------------