bearermanagement/S60MCPR/src/s60mpmrequests.cpp
changeset 50 6a30cdd10231
parent 18 fcbbe021d614
child 73 70ee5458c95d
equal deleted inserted replaced
48:69385fa96b48 50:6a30cdd10231
   845     // Cancellation of the unsent requests is simple. Just remove it from the queue.
   845     // Cancellation of the unsent requests is simple. Just remove it from the queue.
   846     //
   846     //
   847     // Asynchronous cancellation adds message to MPMServer's IPC queue but since we
   847     // Asynchronous cancellation adds message to MPMServer's IPC queue but since we
   848     // queue all requests we can safely always call the SendCancelRequest()
   848     // queue all requests we can safely always call the SendCancelRequest()
   849     
   849     
       
   850     // Sanity check.
       
   851     S60MCPRLOGSTRING2( "S60MCPR::CMPMPolicyRequests<%x>::CancelRequest() %d", this, (TInt)aRequestCode )
       
   852     if ( iPolicyRequests.Count() == 0 )
       
   853         {
       
   854         S60MCPRLOGSTRING1( "S60MCPR::CMPMPolicyRequests<%x>::CancelRequest(): Error: Nothing to cancel!", this )
       
   855         return;
       
   856         }
   850     // If the cancelled request is the active one.
   857     // If the cancelled request is the active one.
   851     //
   858     else if ( iPolicyRequests[0].iRequestType == aRequestCode )
   852     S60MCPRLOGSTRING2( "S60MCPR::CMPMPolicyRequests<%x>::CancelRequest() %d", this, (TInt)aRequestCode )
       
   853     if ( iPolicyRequests[0].iRequestType == aRequestCode )
       
   854         {
   859         {
   855         // Cancel the query if active
   860         // Cancel the query if active
   856         //
   861         //
   857         if ( IsActive() )
   862         if ( IsActive() )
   858             {
   863             {
   875             // remove it.
   880             // remove it.
   876             iPolicyRequests.Remove(0);
   881             iPolicyRequests.Remove(0);
   877             }
   882             }
   878         }
   883         }
   879     // Else we need to find it from the queue
   884     // Else we need to find it from the queue
   880     //
       
   881     else 
   885     else 
   882         {
   886         {
   883         S60MCPRLOGSTRING1( "S60MCPR::CMPMPolicyRequests<%x>::CancelRequest() Cancelling pending request", this )
   887         S60MCPRLOGSTRING1( "S60MCPR::CMPMPolicyRequests<%x>::CancelRequest() Cancelling pending request", this )
   884         TInt count = iPolicyRequests.Count();
   888         TInt count = iPolicyRequests.Count();
   885         for (TInt i = 1; i < count; i++)
   889         for (TInt i = 1; i < count; i++)