imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailrequestqueue.cpp
changeset 1 235a7fc86938
parent 0 2014ca87e772
child 19 b790c5b3d11f
equal deleted inserted replaced
0:2014ca87e772 1:235a7fc86938
   113         // activate selected
   113         // activate selected
   114         if ( selectedRequest )
   114         if ( selectedRequest )
   115            {
   115            {
   116            TN_DEBUG1( "CThumbnailRequestQueue::Process() - starting next request");
   116            TN_DEBUG1( "CThumbnailRequestQueue::Process() - starting next request");
   117                     
   117                     
       
   118            iActiveRequests++;
       
   119            
   118            TRAPD(err, selectedRequest->StartL());
   120            TRAPD(err, selectedRequest->StartL());
   119            if (err != KErrNone)
   121            if (err != KErrNone)
   120                {
   122                {
   121                iActiveRequests++;
   123                TN_DEBUG1( "CThumbnailRequestQueue::Process() - starting request failed");
       
   124                
       
   125                selectedRequest->StartError(err);
   122                }
   126                }
   123            }
   127            }
   124          else
   128          else
   125             {
   129             {
   126             break;
   130             break;
   137 // Adds new request to the queue.
   141 // Adds new request to the queue.
   138 // ---------------------------------------------------------------------------
   142 // ---------------------------------------------------------------------------
   139 //
   143 //
   140 void CThumbnailRequestQueue::AddRequestL( CThumbnailRequestActive* aRequest )
   144 void CThumbnailRequestQueue::AddRequestL( CThumbnailRequestActive* aRequest )
   141     {
   145     {
   142     TN_DEBUG3( "CThumbnailRequestQueue::AddRequestL() - requests: %d, active requests: %d",
       
   143                iRequests.Count(), iActiveRequests );
       
   144     
       
   145     RemoveCompleted(NULL);
   146     RemoveCompleted(NULL);
   146     iRequests.AppendL( aRequest );
   147     iRequests.AppendL( aRequest );
       
   148     
       
   149     TN_DEBUG3( "CThumbnailRequestQueue::AddRequestL() end - requests: %d, active requests: %d",
       
   150                iRequests.Count(), iActiveRequests );
   147     }
   151     }
   148 
   152 
   149 void CThumbnailRequestQueue::RemoveCompleted( CThumbnailRequestActive* aRequestAO)
   153 void CThumbnailRequestQueue::RemoveCompleted( CThumbnailRequestActive* aRequestAO)
   150     {
   154     {       
   151     TN_DEBUG3( "CThumbnailRequestQueue::RemoveCompleted() - begin - requests: %d, active requests: %d",
       
   152                iRequests.Count(), iActiveRequests );
       
   153             
       
   154     //process completed queue and remove finished tasks
   155     //process completed queue and remove finished tasks
   155     for ( TInt i = iRequests.Count() -1; i >= 0 && iRequests.Count(); i-- )
   156     for ( TInt i = iRequests.Count() -1; i >= 0 && iRequests.Count(); i-- )
   156          {
   157          {
   157          CThumbnailRequestActive* request = iRequests[i];
   158          CThumbnailRequestActive* request = iRequests[i];
   158          
   159          
   268         }
   269         }
   269     
   270     
   270     RemoveCompleted( aRequestAO );
   271     RemoveCompleted( aRequestAO );
   271     
   272     
   272     Process();
   273     Process();
   273     
       
   274     TN_DEBUG2( "CThumbnailRequestQueue::RequestComplete() end - active requests: %d", iActiveRequests );
       
   275     }
   274     }
   276 
   275 
   277 
   276 
   278 // End of file
   277 // End of file