201029
authorhgs
Fri, 23 Jul 2010 10:35:38 +0300
changeset 33 221be23823c5
parent 31 d429f823a6b7
child 34 1c05ae5a7e41
201029
imagehandling_plat/thumbnailmanager_api/inc/thumbnailmanager.h
imagehandling_plat/thumbnailmanager_api/tsrc/conf/ThumbnailManagerTest.cfg
imagehandlingutilities/thumbnailmanager/inc/thumbnailmanagerconstants.h
imagehandlingutilities/thumbnailmanager/plugins/audio/src/thumbnailaudioprovider.cpp
imagehandlingutilities/thumbnailmanager/plugins/image/src/thumbnailimageprovider.cpp
imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagcameraobserver.cpp
imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagdaemon.cpp
imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagimageobserver.cpp
imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagprocessor.cpp
imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnaildataimpl.cpp
imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailrequestactive.cpp
imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailrequestqueue.cpp
imagehandlingutilities/thumbnailmanager/thumbnailserver/inc/thumbnailserver.h
imagehandlingutilities/thumbnailmanager/thumbnailserver/inc/thumbnailsql.h
imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailcenrep.cpp
imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailfetchedchecker.cpp
imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailgeneratetask.cpp
imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailmdsquerytask.cpp
imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailscaletask.cpp
imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailserver.cpp
imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailserversession.cpp
imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailstore.cpp
imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailtaskprocessor.cpp
imagehandlingutilities/thumbnailmanager/thumbnailserver/src/tmgetimei.cpp
imagehandlingutilities/thumbnailmanager/tmiadrestart/src/tmiadrestart.cpp
--- a/imagehandling_plat/thumbnailmanager_api/inc/thumbnailmanager.h	Thu Jul 08 15:45:05 2010 +0300
+++ b/imagehandling_plat/thumbnailmanager_api/inc/thumbnailmanager.h	Fri Jul 23 10:35:38 2010 +0300
@@ -44,12 +44,12 @@
 EAudioGridThumbnailSize,
 EAudioListThumbnailSize,
 EAudioFullScreenThumbnailSize,
+EGridThumbnailSize,
+EListThumbnailSize,
+EFullScreenThumbnailSize,
 EContactGridThumbnailSize,
 EContactListThumbnailSize,
 EContactFullScreenThumbnailSize,
-EGridThumbnailSize,
-EListThumbnailSize,
-EFullScreenThumbnailSize,
 EThumbnailSizeCount //last item, don't remove
 } TThumbnailSize;
 /**
--- a/imagehandling_plat/thumbnailmanager_api/tsrc/conf/ThumbnailManagerTest.cfg	Thu Jul 08 15:45:05 2010 +0300
+++ b/imagehandling_plat/thumbnailmanager_api/tsrc/conf/ThumbnailManagerTest.cfg	Fri Jul 23 10:35:38 2010 +0300
@@ -85,12 +85,12 @@
 EAudioGridThumbnailSize 8
 EAudioListThumbnailSize 9
 EAudioFullScreenThumbnailSize 10
-EContactGridThumbnailSize 11
-EContactListThumbnailSize 12
-EContactFullScreenThumbnailSize 13
-EGridThumbnailSize = 14
-EListThumbnailSize = 15
-EFullScreenThumbnailSize = 16
+EGridThumbnailSize = 11
+EListThumbnailSize = 12
+EFullScreenThumbnailSize = 13
+EContactGridThumbnailSize = 14
+EContactListThumbnailSize = 15
+EContactFullScreenThumbnailSize = 16
 
 // Custom sizes
 KCustomSizeX 111
--- a/imagehandlingutilities/thumbnailmanager/inc/thumbnailmanagerconstants.h	Thu Jul 08 15:45:05 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/inc/thumbnailmanagerconstants.h	Fri Jul 23 10:35:38 2010 +0300
@@ -178,7 +178,11 @@
 _LIT8( KFlashVideoMime, "video/x-flv" ); _LIT( KFlashVideoExt, ".flv" );
 _LIT8( KMatroskaVideoMime, "video/x-matroska" ); _LIT( KMatroskaVideoExt, ".mkv" );
 _LIT8( KContactMime, "contact/x-vcard" ); _LIT( KContactExt, ".vcf" );
+
 _LIT( KNonEmbeddedArtExt, ".alb" );
+
+_LIT8( KAlbumArtMime, "audio/albumart" ); _LIT( KAlbumArtExt, ".maa" );
+
 _LIT( KImageMime, "image/*" );
 _LIT( KVideoMime, "video/*" );
 _LIT( KAudioMime, "audio/*" );
--- a/imagehandlingutilities/thumbnailmanager/plugins/audio/src/thumbnailaudioprovider.cpp	Thu Jul 08 15:45:05 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/plugins/audio/src/thumbnailaudioprovider.cpp	Fri Jul 23 10:35:38 2010 +0300
@@ -69,6 +69,7 @@
     {
     TN_DEBUG1( "CThumbnailAudioProvider::~CThumbnailAudioProvider()" );
     delete iImageDecoderv3;
+    iImageDecoderv3 = NULL;
     REComSession::DestroyedImplementation( iDtor_ID_Key );
     }
 
--- a/imagehandlingutilities/thumbnailmanager/plugins/image/src/thumbnailimageprovider.cpp	Thu Jul 08 15:45:05 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/plugins/image/src/thumbnailimageprovider.cpp	Fri Jul 23 10:35:38 2010 +0300
@@ -67,7 +67,9 @@
     {
     TN_DEBUG1( "CThumbnailImageProvider::~CThumbnailImageProvider()" );
     delete iImageDecoder;
+    iImageDecoder = NULL;
     delete iImageDecoderv2;
+    iImageDecoderv2 = NULL;
     REComSession::DestroyedImplementation( iDtor_ID_Key );
     }
 
--- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagcameraobserver.cpp	Thu Jul 08 15:45:05 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagcameraobserver.cpp	Fri Jul 23 10:35:38 2010 +0300
@@ -147,7 +147,10 @@
     iShutdown = ETrue;    
     
     delete iMDSShutdownObserver;
+    iMDSShutdownObserver = NULL;
+    
     delete iShutdownObserver;
+    iShutdownObserver = NULL;
     
     if(iReconnect)
         {
--- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagdaemon.cpp	Thu Jul 08 15:45:05 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagdaemon.cpp	Fri Jul 23 10:35:38 2010 +0300
@@ -194,7 +194,10 @@
     iAudioObserver = NULL;
     
     delete iMDSShutdownObserver;
+    iMDSShutdownObserver = NULL;
+    
     delete iShutdownObserver;
+    iShutdownObserver = NULL;
     
     if(iReconnect)
         {
@@ -267,6 +270,7 @@
        
         // comes here if server gets shut down
         delete server;
+        server = NULL;
         
         CleanupStack::PopAndDestroy( scheduler );
         }
@@ -538,6 +542,8 @@
     TInt ret = rep->Get( KEnableDaemon, val );
     
     delete rep;
+    rep = NULL;
+    
     TN_DEBUG3( "CThumbAGDaemon::DaemonEnabledL() - val == %d, ret == %d", val, ret );
     return val;
     }
@@ -579,6 +585,7 @@
         {
         TRAP( result, CThumbAGDaemon::ThreadFunctionL());
         delete cleanup;
+        cleanup = NULL;
         }
     
     if ( result != KErrNone )
--- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagimageobserver.cpp	Thu Jul 08 15:45:05 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagimageobserver.cpp	Fri Jul 23 10:35:38 2010 +0300
@@ -147,7 +147,10 @@
     iShutdown = ETrue;    
     
     delete iMDSShutdownObserver;
+    iMDSShutdownObserver = NULL;
+    
     delete iShutdownObserver;
+    iShutdownObserver = NULL;
     
     if(iReconnect)
         {
--- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagprocessor.cpp	Thu Jul 08 15:45:05 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagprocessor.cpp	Fri Jul 23 10:35:38 2010 +0300
@@ -1183,7 +1183,7 @@
         }
 #endif
 	
-  	if( iForceRun || iForegroundRun )
+  	if( (iForceRun || iForegroundRun ) && !iMountTimer->IsActive() )
       	{
         TN_DEBUG1( "void CThumbAGProcessor::RunL() skip idle detection!");
       	CancelTimeout();
@@ -1685,9 +1685,9 @@
         }
     
     //check if forced run needs to continue
-    if ( iModifyItemCount > 0 || iUnknownItemCount > 0 || iDeleteItemCount > 0 )
+    if ( (iModifyItemCount > 0 || iDeleteItemCount > 0 ||  iUnknownItemCount > 0) && !iMountTimer->IsActive())
         {
-        TN_DEBUG1( "CThumbAGProcessor::ActivateAO() -  iModifyItemCount > 0 || iUnknownItemCount > 0 || iDeleteItemCount > 0");
+        TN_DEBUG1( "CThumbAGProcessor::ActivateAO() -  forced run");
         SetForceRun( ETrue );
         }
     else
@@ -1696,7 +1696,7 @@
         SetForceRun( EFalse );
         }
     
-    if( !IsActive() && !iShutdown && ((iActiveCount == 0 && !iQueryActive) || iForceRun ))
+    if( !IsActive() && !iShutdown && ((iActiveCount < KMaxDaemonRequests && !iQueryActive) || iForceRun ))
         {
         TN_DEBUG1( "CThumbAGProcessor::ActivateAO() - Activated");
         SetActive();
@@ -2017,8 +2017,11 @@
     TN_DEBUG2( "CThumbAGProcessor::FormatNotification(%d)", aFormat );
     
     iFormatting = aFormat;
+    
     if(!aFormat)
         {
+        //force update
+        UpdatePSValues(EFalse, ETrue);
         ActivateAO();
         }
     }
@@ -2127,9 +2130,11 @@
                 }
             }
         
+        TN_DEBUG2( "CThumbAGProcessor::UpdatePSValues() iPreviousItemsLeft == %d", iPreviousItemsLeft);
+        
         if( itemsLeft != iPreviousItemsLeft)
             {
-            TN_DEBUG2( "CThumbAGProcessor::UpdatePSValues() update KItemsleft == %d", itemsLeft);
+            TN_DEBUG2( "CThumbAGProcessor::UpdatePSValues() Set KItemsleft == %d", itemsLeft);
             iPreviousItemsLeft = itemsLeft;
             TInt ret = RProperty::Set(KTAGDPSNotification, KItemsleft, itemsLeft );
             
--- a/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnaildataimpl.cpp	Thu Jul 08 15:45:05 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnaildataimpl.cpp	Fri Jul 23 10:35:38 2010 +0300
@@ -41,6 +41,7 @@
 CThumbnailDataImpl::~CThumbnailDataImpl()
     {
     delete iBitmap;
+    iBitmap = NULL;
     iClientData = NULL;
     }
 
--- a/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailrequestactive.cpp	Thu Jul 08 15:45:05 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailrequestactive.cpp	Fri Jul 23 10:35:38 2010 +0300
@@ -47,6 +47,7 @@
         {
         iTimer->Cancel();
         }
+    
     delete iTimer;
     iTimer = NULL;
     
@@ -633,7 +634,7 @@
                     }
 	            }
 #endif
-	        TN_DEBUG2( "CThumbnaiRequestActive::HandleError() - iObserver.ThumbnailReady %d", iParams.iRequestId );
+	        TN_DEBUG3( "CThumbnaiRequestActive::HandleError() - iObserver.ThumbnailReady req=%d err=%d", iParams.iRequestId, iError );
 	        iObserver.ThumbnailReady( iError, *iCallbackThumbnail, iParams.iRequestId );
 	            
             }
--- a/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailrequestqueue.cpp	Thu Jul 08 15:45:05 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailrequestqueue.cpp	Fri Jul 23 10:35:38 2010 +0300
@@ -163,6 +163,7 @@
              // delete completed task
              TN_DEBUG3( "CThumbnailRequestQueue::RemoveCompleted() - deleted id = %d (0x%08x)", request->RequestId(), request);
              delete request;
+             request = NULL;
              iRequests.Remove( i );
              }
          }
@@ -203,6 +204,7 @@
             else
                 {
                 delete request;
+                request = NULL;
                 iRequests.Remove( i );
                           
                 TN_DEBUG2( "CThumbnailRequestQueue::CancelRequest() - removed request ID: %d", aRequestId);
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/inc/thumbnailserver.h	Thu Jul 08 15:45:05 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/inc/thumbnailserver.h	Fri Jul 23 10:35:38 2010 +0300
@@ -63,7 +63,7 @@
 
     while ( item )
         {
-        delete * item;
+        delete *item;
         item = iter.NextValue();
         }
     aHashMap.Close();
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/inc/thumbnailsql.h	Thu Jul 08 15:45:05 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/inc/thumbnailsql.h	Fri Jul 23 10:35:38 2010 +0300
@@ -130,10 +130,6 @@
 _LIT8 ( KGetInfoRowID, "SELECT MAX (ThumbnailInfo.rowID) FROM ThumbnailInfo" );
 _LIT8 ( KGetDataRowID, "SELECT MAX (ThumbnailInfoData.rowID) FROM ThumbnailInfoData" );
 
-// counts
-_LIT8 ( KGetInfoCount, "SELECT COUNT(*) FROM ThumbnailInfo" );
-_LIT8 ( KGetInfoDataCount, "SELECT COUNT(*) FROM ThumbnailInfoData" );
-
 // flush 
 _LIT8( KThumbnailMoveFromTempInfoToMainTable, "INSERT INTO ThumbnailInfo SELECT * FROM TempThumbnailInfo;");
 _LIT8( KThumbnailMoveFromTempDataToMainTable, "INSERT INTO ThumbnailInfoData SELECT * FROM TempThumbnailInfoData;");
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailcenrep.cpp	Thu Jul 08 15:45:05 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailcenrep.cpp	Fri Jul 23 10:35:38 2010 +0300
@@ -113,7 +113,9 @@
     {
     iPersistentSizes.Close();
     delete iAutoCreate;
+    iAutoCreate = NULL;
     delete iRepository;
+    iRepository = NULL;
     }
 
 // ---------------------------------------------------------------------------
@@ -210,23 +212,52 @@
     iPersistentSizes.AppendL( TThumbnailPersistentSize( EAudioFullScreenThumbnailSize, TSize( xSize, ySize ),
                               flags, static_cast <TDisplayMode> (raw_mode), format, autoCreate, TThumbnailPersistentSize::EFullscreen ));     
 
-    User::LeaveIfError( iRepository->Get( KSizeContactGridWidth, xSize ));
-    User::LeaveIfError( iRepository->Get( KSizeContactGridHeight, ySize ));
-    User::LeaveIfError( iRepository->Get( KAutoCreateContactGrid, autoCreate ));
+// Contact TN, set default values if not found
+    if(iRepository->Get( KSizeContactGridWidth, xSize ) != KErrNone)
+        {
+        xSize = 54;
+        }
+    if( iRepository->Get( KSizeContactGridHeight, ySize ) != KErrNone)
+        {
+        ySize = 54;
+        }
+    
+    if( iRepository->Get( KAutoCreateContactGrid, autoCreate ) != KErrNone)
+    {
+        autoCreate = 1;
+    }
 
     iPersistentSizes.AppendL( TThumbnailPersistentSize( EContactGridThumbnailSize, TSize( xSize, ySize ),
             KGridAndListThumbnailCropped, static_cast <TDisplayMode> (raw_mode), format, autoCreate, TThumbnailPersistentSize::EGrid ));
     
-    User::LeaveIfError( iRepository->Get( KSizeContactListWidth, xSize ));
-    User::LeaveIfError( iRepository->Get( KSizeContactListHeight, ySize ));
-    User::LeaveIfError( iRepository->Get( KAutoCreateContactList, autoCreate ));
+    if(  iRepository->Get( KSizeContactListWidth, xSize ) != KErrNone)
+        {
+        xSize = 64;
+        }
+    if(  iRepository->Get( KSizeContactListHeight, ySize ) != KErrNone)
+        {
+        ySize = 64;
+        }
+    if(  iRepository->Get( KAutoCreateContactList, autoCreate ) != KErrNone)
+        {
+        autoCreate = 1;
+        }
 
     iPersistentSizes.AppendL( TThumbnailPersistentSize( EContactListThumbnailSize, TSize( xSize, ySize ),
             KGridAndListThumbnailCropped, static_cast <TDisplayMode> (raw_mode), format, autoCreate, TThumbnailPersistentSize::EList ));
     
-    User::LeaveIfError( iRepository->Get( KSizeContactFullscreenWidth, xSize ));
-    User::LeaveIfError( iRepository->Get( KSizeContactFullscreenHeight, ySize ));
-    User::LeaveIfError( iRepository->Get( KAutoCreateContactFullscreen, autoCreate ));
+    if( iRepository->Get( KSizeContactFullscreenWidth, xSize ) != KErrNone)
+        {
+        xSize = 250;
+        }
+    if( iRepository->Get( KSizeContactFullscreenHeight, ySize ) != KErrNone)
+        {
+        ySize = 250;
+        }
+    if( iRepository->Get( KAutoCreateContactFullscreen, autoCreate) != KErrNone)
+        {
+        autoCreate = 1;
+        }
     
     iPersistentSizes.AppendL( TThumbnailPersistentSize( EContactFullScreenThumbnailSize, TSize( xSize, ySize ),
                               flags, static_cast <TDisplayMode> (raw_mode), format, autoCreate, TThumbnailPersistentSize::EFullscreen ));     
@@ -243,9 +274,19 @@
     User::LeaveIfError( iRepository->Get( KAutoCreateAudioGrid, iAutoCreate->iAudioGrid ));
     User::LeaveIfError( iRepository->Get( KAutoCreateAudioList, iAutoCreate->iAudioList ));
     User::LeaveIfError( iRepository->Get( KAutoCreateAudioFullscreen, iAutoCreate->iAudioFullscreen ));    
-    User::LeaveIfError( iRepository->Get( KAutoCreateContactGrid, iAutoCreate->iContactGrid ));
-    User::LeaveIfError( iRepository->Get( KAutoCreateContactList, iAutoCreate->iContactList ));
-    User::LeaveIfError( iRepository->Get( KAutoCreateContactFullscreen, iAutoCreate->iContactFullscreen )); 
+    
+    if( iRepository->Get( KAutoCreateContactGrid, iAutoCreate->iContactGrid ) != KErrNone )
+        {
+        iAutoCreate->iContactGrid = 1;
+        }
+    if( iRepository->Get( KAutoCreateContactList, iAutoCreate->iContactList ) != KErrNone )
+        {
+        iAutoCreate->iContactList = 1;
+        }
+    if( iRepository->Get( KAutoCreateContactFullscreen, iAutoCreate->iContactFullscreen ) != KErrNone )
+        {
+        iAutoCreate->iContactFullscreen = 1;
+        }
     }
 
 // ---------------------------------------------------------------------------
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailfetchedchecker.cpp	Thu Jul 08 15:45:05 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailfetchedchecker.cpp	Fri Jul 23 10:35:38 2010 +0300
@@ -62,9 +62,8 @@
         if ( ret != KErrNotFound )
             {
             TN_DEBUG1( "CThumbnailFetchedChecker::LastFetchResult() -> error found");
+            delete entry;
             entry = NULL;
-            delete entry;
-
             return iNotFetched[ ret ]->iError;
             }
         }
@@ -94,6 +93,7 @@
                 {
                 TN_DEBUG2( "CThumbnailFetchedChecker::LastFetchResult() -> Remove successful results from store %d",  iNotFetched.Count() );
                 delete iNotFetched[ i ];
+                iNotFetched[ i ] = NULL;
                 iNotFetched.Remove( i );
                 }
             }
@@ -155,6 +155,7 @@
             {
             TN_DEBUG1( "CThumbnailFetchedChecker::DeleteFetchResult() -> Deteled URI from fetched list" );	
             delete iNotFetched[ ret ];
+            iNotFetched[ ret ] = NULL;
             iNotFetched.Remove( ret );
             }
         }
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailgeneratetask.cpp	Thu Jul 08 15:45:05 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailgeneratetask.cpp	Fri Jul 23 10:35:38 2010 +0300
@@ -95,6 +95,7 @@
         {
         iMissingSizes->Reset();
         delete iMissingSizes;
+        iMissingSizes = NULL;
         }
 		
     if ( iBitmapHandle )
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailmdsquerytask.cpp	Thu Jul 08 15:45:05 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailmdsquerytask.cpp	Fri Jul 23 10:35:38 2010 +0300
@@ -55,6 +55,7 @@
         {
         iQuery->Cancel();
         delete iQuery;
+        iQuery = NULL;
         }
     }
 
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailscaletask.cpp	Thu Jul 08 15:45:05 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailscaletask.cpp	Fri Jul 23 10:35:38 2010 +0300
@@ -121,6 +121,7 @@
 
     // Scaled bitmap is owned by us, delete now
     delete iScaledBitmap;
+    iScaledBitmap = NULL;
     }
 
 
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailserver.cpp	Thu Jul 08 15:45:05 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailserver.cpp	Fri Jul 23 10:35:38 2010 +0300
@@ -416,6 +416,7 @@
             "CThumbnailServer::ThreadFunctionL() -- CActiveScheduler::Start() out" );
         // Comes here if server gets shut down
         delete server;
+        server = NULL;
         CleanupStack::PopAndDestroy( scheduler );
         }
     }
@@ -443,7 +444,10 @@
         iSessionCount );
     iSessionCount--;
     
-    iProcessor->RemoveTasks(aSession);
+    if(iProcessor)
+        {
+        iProcessor->RemoveTasks(aSession);
+        }
     
     TN_DEBUG2( "CThumbnailServer::DropSession() aSession = 0x%08x", aSession );        
     
@@ -459,7 +463,7 @@
             {
             TN_DEBUG2( "CThumbnailServer::DropSession() - ref->iSession = 0x%08x", ref->iSession );
         
-            delete ref->iBitmap;            
+            delete ref->iBitmap;
             bpiter.RemoveCurrent();
                         
             TN_DEBUG2( "CThumbnailServer::DropSession() - deleted bitmap, left=%d", iBitmapPool.Count());
@@ -852,7 +856,7 @@
         if ( ref->iSession == aRequestId.iSession && 
              ref->iRequestId == aRequestId.iRequestId )
             {            
-            delete ref->iBitmap;            
+            delete ref->iBitmap;
             bpiter.RemoveCurrent();                        
                         
             TN_DEBUG2( "CThumbnailServer::DequeTask() - deleted bitmap, left=%d", 
@@ -1071,6 +1075,7 @@
     if (store)
         {
         delete *store;
+        *store = NULL;
         iStores.Remove( aDrive );
         }
     }
@@ -1159,7 +1164,7 @@
           // If drive-list entry is zero, drive is not available
             continue;
            }
-            
+
         TInt err = iFs.Volume(volumeInfo, drive);
         TInt err_drive = iFs.Drive(driveInfo, drive);    
         
@@ -1466,6 +1471,10 @@
         {
         aMimeType = TDataType( KContactMime );
         } 
+    else if ( ext.CompareF( KAlbumArtExt ) == 0 )
+        {
+        aMimeType = TDataType( KAlbumArtMime );
+        }
     else
         {
         aMimeType = TDataType( KNullDesC8 );
@@ -1582,7 +1591,8 @@
          mimeType.CompareF( KRealVideoMime ) == 0 ||
          mimeType.CompareF( KFlashVideoMime ) == 0 ||
          mimeType.CompareF( KMatroskaVideoMime ) == 0 ||
-         mimeType.CompareF( KContactMime ) == 0 )
+         mimeType.CompareF( KContactMime ) == 0 ||
+         mimeType.CompareF( KAlbumArtMime ) == 0 )
         {
         return ETrue;
         }
@@ -1616,6 +1626,7 @@
             "CThumbnailServer::E32Main() -- thread function out, result=%d",
             result );
         delete cleanup;
+        cleanup = NULL;
         }
     if ( result != KErrNone )
         {
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailserversession.cpp	Thu Jul 08 15:45:05 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailserversession.cpp	Fri Jul 23 10:35:38 2010 +0300
@@ -907,6 +907,8 @@
             // all thumbs already exist
             CleanupStack::PopAndDestroy( missingSizes );
             delete missingSizes;
+            missingSizes = NULL;
+            
             if( aFile )
                {
                aFile->Close();
@@ -1038,6 +1040,8 @@
             // all thumbs already exist
             CleanupStack::PopAndDestroy( missingSizes );
             delete missingSizes;
+            missingSizes = NULL;
+            
             if ( aBuffer)
                {
                delete aBuffer;
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailstore.cpp	Thu Jul 08 15:45:05 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailstore.cpp	Fri Jul 23 10:35:38 2010 +0300
@@ -555,9 +555,7 @@
     TInt column = 0;   
     TInt rowStatus = 0;
     TInt64 inforows = -1;
-    TInt64 infocount = -1;
     TInt64 datarows = -1;
-    TInt64 datacount = -1;
     
     TInt ret = stmt.Prepare( iDatabase, KGetInfoRowID );
     if(ret < 0)
@@ -583,32 +581,7 @@
 #endif
         return KErrNotSupported;
         }
-    
-    ret = stmt.Prepare( iDatabase, KGetInfoCount );
-    if(ret < 0)
-        {
-        stmt.Close();
-        TN_DEBUG1( "CThumbnailStore::CheckRowIDs() KGetInfoCount failed %d");
-        return KErrNotSupported;
-        }
-    rowStatus = stmt.Next();
-                
-    if ( rowStatus == KSqlAtRow)    
-        {        
-        infocount = stmt.ColumnInt64( column );  
-        }
-                
-    stmt.Close();
-    
-    if(rowStatus < 0)
-        {
-#ifdef _DEBUG
-        TPtrC errorMsg2 = iDatabase.LastErrorMessage();
-        TN_DEBUG2( "RThumbnailTransaction::ResetThumbnailIDs() lastError %S, ret = %d" , &errorMsg2);
-#endif
-        return KErrNotSupported;
-        }
-            
+              
     ret = stmt.Prepare( iDatabase, KGetDataRowID );
     if(ret < 0)
         {
@@ -634,37 +607,10 @@
         return KErrNotSupported;
         }
     
-    ret = stmt.Prepare( iDatabase, KGetInfoDataCount );
-    if(ret < 0)
-        {
-        stmt.Close();
-        TN_DEBUG1( "CThumbnailStore::CheckRowIDs() KGetInfoDataCount failed %d");
-        return KErrNotSupported;
-        }
-    rowStatus = stmt.Next();
-                
-    if ( rowStatus == KSqlAtRow)    
-        {        
-        datacount = stmt.ColumnInt64( column );  
-        }
-                
-    stmt.Close();
-    
-    if(rowStatus < 0)
-        {
-#ifdef _DEBUG
-        TPtrC errorMsg2 = iDatabase.LastErrorMessage();
-        TN_DEBUG2( "RThumbnailTransaction::ResetThumbnailIDs() lastError %S, ret = %d" , &errorMsg2);
-#endif
-        return KErrNotSupported;
-        }
-    
     TN_DEBUG2( "CThumbnailStore::CheckRowIDsL() - inforows %Ld", inforows );
-    TN_DEBUG2( "CThumbnailStore::CheckRowIDsL() - infocount %Ld", infocount );
     TN_DEBUG2( "CThumbnailStore::CheckRowIDsL() - datarows %Ld", datarows );
-    TN_DEBUG2( "CThumbnailStore::CheckRowIDsL() - datacount %Ld", datacount );
             
-    if( inforows != datarows || datacount != infocount)
+    if( inforows != datarows )
         {
         TN_DEBUG1( "CThumbnailStore::CheckRowIDsL() - tables out of sync" );
         return KErrNotSupported;
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailtaskprocessor.cpp	Thu Jul 08 15:45:05 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailtaskprocessor.cpp	Fri Jul 23 10:35:38 2010 +0300
@@ -105,7 +105,7 @@
        iPeriodicTimer->Cancel();
        }
     delete iPeriodicTimer;
-    
+    iPeriodicTimer = NULL;
     }
 
 
@@ -155,6 +155,7 @@
                 {
                 // Remove task from queue
                 delete task;
+                task = NULL;
                 iTasks.Remove( i );
                 
                 TN_DEBUG2( "CThumbnailTaskProcessor::RemoveTask() - removed request ID: %d", aRequestId.iRequestId);
@@ -164,6 +165,7 @@
                 // Task is already running, canceled first
                 task->Cancel();
                 delete task;
+                task = NULL;
                 iTasks.Remove( i );
                 cancel = ETrue;
                 
@@ -207,6 +209,7 @@
     for ( TInt i = iTasks.Count(); --i >= 0; )
         {
         CThumbnailTask* task = iTasks[i];
+        
         if ( task->RequestId().iSession == aSession)
             {
             if ( task->State() != CThumbnailTask::ERunning )
@@ -215,6 +218,7 @@
                 
                 // Remove task from queue
                 delete task;
+                task = NULL;
                 iTasks.Remove( i );
                 
                 TN_DEBUG2( "CThumbnailTaskProcessor::RemoveTasks() - removed request ID: %d", id);
@@ -228,6 +232,7 @@
                 // Task is already running, canceled first
                 task->Cancel();
                 delete task;
+                task = NULL;
                 iTasks.Remove( i );
                 cancel = ETrue;
                 
@@ -266,6 +271,7 @@
             
             // Remove task from queue
             delete task;
+            task = NULL;
             iTasks.Remove( i );
             
             TN_DEBUG2( "CThumbnailTaskProcessor::RemoveTasks() - removed request ID: %d", id);
@@ -279,6 +285,7 @@
             // Task is already running, canceled first
             task->Cancel();
             delete task;
+            task = NULL;
             iTasks.Remove( i );
             cancel = ETrue;
             
@@ -342,6 +349,7 @@
             {
             // Delete completed task
             delete task;
+            task = NULL;
             iTasks.Remove( i );
             }
         else
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/tmgetimei.cpp	Thu Jul 08 15:45:05 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/tmgetimei.cpp	Fri Jul 23 10:35:38 2010 +0300
@@ -45,6 +45,7 @@
     Cancel();
 
     delete iTelephony;
+    iTelephony = NULL;
     }
 
 TBuf<KImeiBufferSize> CTMGetImei::GetIMEI()
--- a/imagehandlingutilities/thumbnailmanager/tmiadrestart/src/tmiadrestart.cpp	Thu Jul 08 15:45:05 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/tmiadrestart/src/tmiadrestart.cpp	Fri Jul 23 10:35:38 2010 +0300
@@ -150,6 +150,7 @@
     TRAP(err, MainL());
 
     delete cleanup;
+    cleanup = NULL;
     __UHEAP_MARKEND;
     return err;
     }