imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailserver.cpp
changeset 22 a67f74060682
parent 19 b790c5b3d11f
child 25 cb86b71cae0a
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailserver.cpp	Fri May 14 16:10:12 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailserver.cpp	Thu May 27 13:11:20 2010 +0300
@@ -224,6 +224,7 @@
     
     // connect to MDS
     iMdESession = CMdESession::NewL( *this );
+    iSessionError = EFalse;
     
     User::LeaveIfError( iFbsSession.Connect());
     User::LeaveIfError( Start( KThumbnailServerName ));
@@ -329,8 +330,10 @@
 void CThumbnailServer::HandleSessionError( CMdESession& /*aSession*/, TInt aError )
     {
     TN_DEBUG2( "CThumbnailServer::HandleSessionError == %d", aError );
-    if (aError != KErrNone && !iShutdown)
+    if (aError != KErrNone && !iShutdown && !iSessionError)
         {
+        iSessionError = ETrue;
+    
         if (!iReconnect->IsActive())
             {
             iReconnect->Start( KMdEReconnect, KMdEReconnect, 
@@ -425,17 +428,15 @@
     const TThumbnailBitmapRef* ref = bpiter.NextValue();
 
     while ( ref )
-        {
+        {        
+        if ( ref->iSession == aSession )
+            {
+            TN_DEBUG2( "CThumbnailServer::DropSession() - ref->iSession = 0x%08x", ref->iSession );
         
-        TN_DEBUG2( "CThumbnailServer::DropSession() - ref->iSession = 0x%08x", ref->iSession );
-        
-        if ( ref->iSession == aSession )
-            {            
             delete ref->iBitmap;            
             bpiter.RemoveCurrent();
                         
-            TN_DEBUG2( "CThumbnailServer::DropSession() - deleted bitmap, left=%d", 
-                                iBitmapPool.Count());
+            TN_DEBUG2( "CThumbnailServer::DropSession() - deleted bitmap, left=%d", iBitmapPool.Count());
             }
         ref = bpiter.NextValue();
         
@@ -889,7 +890,6 @@
     CThumbnailStore** resPtr = iStores.Find( aDrive );
     CThumbnailStore* res = NULL;
 
-
     if ( resPtr )
         {
         res = * resPtr;
@@ -1321,6 +1321,10 @@
         {
         aMimeType = TDataType( KVideo3gppMime );
         } 
+    else if ( ext.CompareF( K3gppExt ) == 0 )
+        {
+        aMimeType = TDataType( KVideo3gppMime );
+        }
     else if ( ext.CompareF( KAmrExt ) == 0 )
         {
         aMimeType = TDataType( KAudioAmrMime );
@@ -1629,6 +1633,7 @@
     
     // reconnect to MDS
     TRAP_IGNORE( self->iMdESession = CMdESession::NewL( *self ) );
+    self->iSessionError = EFalse;
     
     TN_DEBUG1( "CThumbAGDaemon::ReconnectCallBack() - done");