imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailserver.cpp
branchRCL_3
changeset 14 ad31f4183ddc
parent 13 ffb2d5dd62e9
child 15 f0aa341a25bf
equal deleted inserted replaced
13:ffb2d5dd62e9 14:ad31f4183ddc
   222     // MDS session reconnect timer
   222     // MDS session reconnect timer
   223     iReconnect = CPeriodic::NewL(CActive::EPriorityIdle);
   223     iReconnect = CPeriodic::NewL(CActive::EPriorityIdle);
   224     
   224     
   225     // connect to MDS
   225     // connect to MDS
   226     iMdESession = CMdESession::NewL( *this );
   226     iMdESession = CMdESession::NewL( *this );
       
   227     iSessionError = EFalse;
   227     
   228     
   228     User::LeaveIfError( iFbsSession.Connect());
   229     User::LeaveIfError( iFbsSession.Connect());
   229     User::LeaveIfError( Start( KThumbnailServerName ));
   230     User::LeaveIfError( Start( KThumbnailServerName ));
   230     User::LeaveIfError( iFs.Connect());
   231     User::LeaveIfError( iFs.Connect());
   231     iProcessor = CThumbnailTaskProcessor::NewL();
   232     iProcessor = CThumbnailTaskProcessor::NewL();
   327 // -----------------------------------------------------------------------------
   328 // -----------------------------------------------------------------------------
   328 //
   329 //
   329 void CThumbnailServer::HandleSessionError( CMdESession& /*aSession*/, TInt aError )
   330 void CThumbnailServer::HandleSessionError( CMdESession& /*aSession*/, TInt aError )
   330     {
   331     {
   331     TN_DEBUG2( "CThumbnailServer::HandleSessionError == %d", aError );
   332     TN_DEBUG2( "CThumbnailServer::HandleSessionError == %d", aError );
   332     if (aError != KErrNone && !iShutdown)
   333     if (aError != KErrNone && !iShutdown && !iSessionError)
   333         {
   334         {
       
   335         iSessionError = ETrue;
       
   336     
   334         if (!iReconnect->IsActive())
   337         if (!iReconnect->IsActive())
   335             {
   338             {
   336             iReconnect->Start( KMdEReconnect, KMdEReconnect, 
   339             iReconnect->Start( KMdEReconnect, KMdEReconnect, 
   337                                TCallBack(ReconnectCallBack, this));
   340                                TCallBack(ReconnectCallBack, this));
   338             
   341             
   423 
   426 
   424     // const pointer to a non-const object
   427     // const pointer to a non-const object
   425     const TThumbnailBitmapRef* ref = bpiter.NextValue();
   428     const TThumbnailBitmapRef* ref = bpiter.NextValue();
   426 
   429 
   427     while ( ref )
   430     while ( ref )
   428         {
   431         {        
   429         
       
   430         TN_DEBUG2( "CThumbnailServer::DropSession() - ref->iSession = 0x%08x", ref->iSession );
       
   431         
       
   432         if ( ref->iSession == aSession )
   432         if ( ref->iSession == aSession )
   433             {            
   433             {
       
   434             TN_DEBUG2( "CThumbnailServer::DropSession() - ref->iSession = 0x%08x", ref->iSession );
       
   435         
   434             delete ref->iBitmap;            
   436             delete ref->iBitmap;            
   435             bpiter.RemoveCurrent();
   437             bpiter.RemoveCurrent();
   436                         
   438                         
   437             TN_DEBUG2( "CThumbnailServer::DropSession() - deleted bitmap, left=%d", 
   439             TN_DEBUG2( "CThumbnailServer::DropSession() - deleted bitmap, left=%d", iBitmapPool.Count());
   438                                 iBitmapPool.Count());
       
   439             }
   440             }
   440         ref = bpiter.NextValue();
   441         ref = bpiter.NextValue();
   441         
   442         
   442         }
   443         }
   443 
   444 
  1318         }
  1319         }
  1319     else if ( ext.CompareF( K3gpExt ) == 0 )
  1320     else if ( ext.CompareF( K3gpExt ) == 0 )
  1320         {
  1321         {
  1321         aMimeType = TDataType( KVideo3gppMime );
  1322         aMimeType = TDataType( KVideo3gppMime );
  1322         } 
  1323         } 
       
  1324     else if ( ext.CompareF( K3gppExt ) == 0 )
       
  1325         {
       
  1326         aMimeType = TDataType( KVideo3gppMime );
       
  1327         }
  1323     else if ( ext.CompareF( KAmrExt ) == 0 )
  1328     else if ( ext.CompareF( KAmrExt ) == 0 )
  1324         {
  1329         {
  1325         aMimeType = TDataType( KAudioAmrMime );
  1330         aMimeType = TDataType( KAudioAmrMime );
  1326         }
  1331         }
  1327     else if ( ext.CompareF( KWmvExt ) == 0 )
  1332     else if ( ext.CompareF( KWmvExt ) == 0 )
  1626         self->iMdESession = NULL;
  1631         self->iMdESession = NULL;
  1627         }
  1632         }
  1628     
  1633     
  1629     // reconnect to MDS
  1634     // reconnect to MDS
  1630     TRAP_IGNORE( self->iMdESession = CMdESession::NewL( *self ) );
  1635     TRAP_IGNORE( self->iMdESession = CMdESession::NewL( *self ) );
       
  1636     self->iSessionError = EFalse;
  1631     
  1637     
  1632     TN_DEBUG1( "CThumbAGDaemon::ReconnectCallBack() - done");
  1638     TN_DEBUG1( "CThumbAGDaemon::ReconnectCallBack() - done");
  1633     
  1639     
  1634     return KErrNone;
  1640     return KErrNone;
  1635     }
  1641     }