imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagdaemon.cpp
branchRCL_3
changeset 28 ff2fb7658ff7
parent 21 ad31f4183ddc
child 37 f759b6186ab5
equal deleted inserted replaced
24:f0aa341a25bf 28:ff2fb7658ff7
   118         iShutdown = EFalse;
   118         iShutdown = EFalse;
   119         
   119         
   120         // create processor
   120         // create processor
   121         if(iProcessor)
   121         if(iProcessor)
   122             {
   122             {
       
   123             iProcessor->Shutdown();
   123             delete iProcessor;
   124             delete iProcessor;
   124             iProcessor = NULL; 
   125             iProcessor = NULL; 
   125             }
   126             }
   126         
   127         
   127         iProcessor = CThumbAGProcessor::NewL(); 
   128         iProcessor = CThumbAGProcessor::NewL(); 
   177         iReconnect = NULL;
   178         iReconnect = NULL;
   178         }
   179         }
   179     
   180     
   180     if (iProcessor)
   181     if (iProcessor)
   181         {
   182         {
       
   183         iProcessor->Shutdown();
   182         delete iProcessor;
   184         delete iProcessor;
   183         iProcessor = NULL;
   185         iProcessor = NULL;
   184         }
   186         }
   185     
   187     
   186     if (iMdESession)
   188     if (iMdESession)
   279 // -----------------------------------------------------------------------------
   281 // -----------------------------------------------------------------------------
   280 //
   282 //
   281 void CThumbAGDaemon::HandleSessionError( CMdESession& /*aSession*/, TInt aError )
   283 void CThumbAGDaemon::HandleSessionError( CMdESession& /*aSession*/, TInt aError )
   282     {
   284     {
   283     TN_DEBUG2( "CThumbAGDaemon::HandleSessionError == %d", aError );
   285     TN_DEBUG2( "CThumbAGDaemon::HandleSessionError == %d", aError );
   284     if (aError != KErrNone && !iSessionError)
   286     if (aError != KErrNone && !iShutdown && !iSessionError)
   285         {
   287         {
   286         iSessionError = ETrue;
   288         iSessionError = ETrue;
   287     
   289     
   288         // kill processor right away, because it also has MdESession
   290         // kill processor right away, because it also has MdESession
   289         if(iProcessor)
   291         if(iProcessor)
   290             {
   292             {
       
   293 			iProcessor->Shutdown();
   291             delete iProcessor;
   294             delete iProcessor;
   292             iProcessor = NULL; 
   295             iProcessor = NULL; 
   293             }
   296             }
   294     
   297     
   295         if (!iShutdown)
   298         if (!iReconnect->IsActive())
   296             {
   299             {
   297             if (!iReconnect->IsActive())
   300             iReconnect->Start( KMdEReconnect, KMdEReconnect, 
   298                 {
   301                                TCallBack(ReconnectCallBack, this));
   299                 iReconnect->Start( KMdEReconnect, KMdEReconnect, 
   302             
   300                                    TCallBack(ReconnectCallBack, this));
   303             TN_DEBUG1( "CThumbAGDaemon::HandleSessionError() - reconnect timer started" );
   301                 
       
   302                 TN_DEBUG1( "CThumbAGDaemon::HandleSessionError() - reconnect timer started" );
       
   303                 }
       
   304             }
   304             }
   305 
   305 
   306         }   
   306         }   
   307     }
   307     }
   308 
   308 
   316         TObserverNotificationType aType,
   316         TObserverNotificationType aType,
   317         const RArray<TItemId>& aObjectIdArray,
   317         const RArray<TItemId>& aObjectIdArray,
   318         const RPointerArray<HBufC>& aObjectUriArray)
   318         const RPointerArray<HBufC>& aObjectUriArray)
   319     {
   319     {
   320     TN_DEBUG1( "CThumbAGDaemon::HandleUriObjectNotification() - begin" );
   320     TN_DEBUG1( "CThumbAGDaemon::HandleUriObjectNotification() - begin" );
       
   321     
       
   322     if(!iProcessor || iShutdown)
       
   323         {
       
   324         return;
       
   325         }
   321     
   326     
   322     if(aType == ENotifyRemove)
   327     if(aType == ENotifyRemove)
   323         {
   328         {
   324         TN_DEBUG1( "CThumbAGDaemon::HandleUriObjectNotification() - removed");
   329         TN_DEBUG1( "CThumbAGDaemon::HandleUriObjectNotification() - removed");
   325         TInt err(0);
   330         TInt err(0);