locationrequestmgmt/networkrequesthandler/src/EPos_CPosDialogCtrl.cpp
branchRCL_3
changeset 28 cf8bf9651775
parent 18 54d74d217042
child 31 b6bc347ed8ca
equal deleted inserted replaced
18:54d74d217042 28:cf8bf9651775
    76     Cancel();
    76     Cancel();
    77     TInt count = iRequestQueue.Count();
    77     TInt count = iRequestQueue.Count();
    78     for (TInt i = 0; i < count; i++)
    78     for (TInt i = 0; i < count; i++)
    79         {
    79         {
    80         DoCompleteRequest(0, KErrServerTerminated);
    80         DoCompleteRequest(0, KErrServerTerminated);
    81         // Delete the pointer items
       
    82         delete iRequestQueue[i].iRequestInfo;
       
    83         }
    81         }
    84 
    82 
    85     iNotifier.Close();
    83     iNotifier.Close();
    86     iRequestQueue.Close();
    84     iRequestQueue.Close();
    87     }
    85     }
   277 //
   275 //
   278 void CPosDialogCtrl::DoCompleteRequest(
   276 void CPosDialogCtrl::DoCompleteRequest(
   279     TInt aIndex,
   277     TInt aIndex,
   280     TInt aCompletionCode)
   278     TInt aCompletionCode)
   281     {
   279     {
   282     TRequestStatus* status = iRequestQueue[aIndex].iStatus;
   280     TRequest request = iRequestQueue[aIndex];
   283     User::RequestComplete(status, aCompletionCode);
   281     if (request.iType == TPosQNInputData::ENotification)
       
   282         {
       
   283         delete request.iRequestInfo;
       
   284         }
       
   285     else
       
   286         {
       
   287         TRequestStatus* status = request.iStatus;
       
   288         User::RequestComplete(status, aCompletionCode);
       
   289         }
   284     iRequestQueue.Remove(aIndex);
   290     iRequestQueue.Remove(aIndex);
   285     iRequestQueue.Compress();
   291     iRequestQueue.Compress();
   286     }
   292     }
   287 
   293 
   288 // ---------------------------------------------------------
   294 // ---------------------------------------------------------
   363         buffer->Des().Append(*reqStackBuf);
   369         buffer->Des().Append(*reqStackBuf);
   364 
   370 
   365         delete reqStackBuf;
   371         delete reqStackBuf;
   366         reqStackBuf = NULL;
   372         reqStackBuf = NULL;
   367 
   373 
   368         if (data.iType == TPosQNInputData::ENotification) // We dont expect a resonse from a notfication
   374         iNotifier.StartNotifierAndGetResponse(
   369             {
   375             iStatus, KNotifierUid, nullPtr, nullPtr);
   370             iNotifier.StartNotifier(KNotifierUid, nullPtr, nullPtr);
   376         SetActive();
   371             
   377 
   372             // As we wont be getting a response remove from the notification list
       
   373             delete iRequestQueue[0].iRequestInfo;
       
   374             iRequestQueue.Remove(0);
       
   375             iRequestQueue.Compress();
       
   376             }
       
   377         else
       
   378             {
       
   379             iNotifier.StartNotifierAndGetResponse(
       
   380                     iStatus, KNotifierUid, nullPtr, nullPtr);
       
   381             SetActive();
       
   382             }
       
   383         
       
   384         err = iNotifier.UpdateNotifier(KNotifierUid, *buffer, nullPtr);
   378         err = iNotifier.UpdateNotifier(KNotifierUid, *buffer, nullPtr);
   385         if (err != KErrNone)
   379         if (err != KErrNone)
   386             {
   380             {
   387             Cancel();
   381             Cancel();
   388             }
   382             }