imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailserver.cpp
branchRCL_3
changeset 20 ffb2d5dd62e9
parent 16 85a88bc05e45
child 21 ad31f4183ddc
equal deleted inserted replaced
16:85a88bc05e45 20:ffb2d5dd62e9
   536         }
   536         }
   537     else
   537     else
   538         {
   538         {
   539         TN_DEBUG1( "CThumbnailServer::StoreThumbnailL() - file doesn't exists anymore, skip store!");
   539         TN_DEBUG1( "CThumbnailServer::StoreThumbnailL() - file doesn't exists anymore, skip store!");
   540         }
   540         }
       
   541     
   541     if( iFetchedChecker )    
   542     if( iFetchedChecker )    
   542         {
   543         {
   543         iFetchedChecker->SetFetchResult( aPath, KErrNone );
   544         iFetchedChecker->SetFetchResult( aPath, KErrNone );
   544         }
   545         }
   545     }
   546     }
   556     if( iFetchedChecker )
   557     if( iFetchedChecker )
   557         {
   558         {
   558         TInt err( iFetchedChecker->LastFetchResult( aPath ) );
   559         TInt err( iFetchedChecker->LastFetchResult( aPath ) );
   559         if ( err == KErrNone ) // To avoid useless sql gets that fails for sure
   560         if ( err == KErrNone ) // To avoid useless sql gets that fails for sure
   560             {
   561             {
       
   562             // custom sizes are not stored to db, skip fetching
       
   563             if ( aThumbnailSize == ECustomThumbnailSize )
       
   564                 {
       
   565                 User::Leave( KErrNotFound );
       
   566                 }
       
   567         
   561             TRAP( err, StoreForPathL( aPath )->FetchThumbnailL( aPath, aThumbnail, aData, aThumbnailSize, aOriginalSize) );
   568             TRAP( err, StoreForPathL( aPath )->FetchThumbnailL( aPath, aThumbnail, aData, aThumbnailSize, aOriginalSize) );
   562             if ( err != KErrNone )
   569             if ( err != KErrNone )
   563                 {
   570                 {
   564                 iFetchedChecker->SetFetchResult( aPath, err );
   571                 iFetchedChecker->SetFetchResult( aPath, err );
   565                 }
   572                 }
   566             }
   573             }
   567         User::LeaveIfError( err );
   574         User::LeaveIfError( err );
   568         }
   575         }
   569     else
   576     else
   570         {
   577         {
       
   578         // custom sizes are not stored to db, skip fetching
       
   579         if ( aThumbnailSize == ECustomThumbnailSize )
       
   580             {
       
   581             User::Leave( KErrNotFound );
       
   582             }
       
   583     
   571         StoreForPathL( aPath )->FetchThumbnailL( aPath, aThumbnail, aData, aThumbnailSize, aOriginalSize);
   584         StoreForPathL( aPath )->FetchThumbnailL( aPath, aThumbnail, aData, aThumbnailSize, aOriginalSize);
   572         }
   585         }
   573     }
   586     }
   574 
   587 
   575 
   588 
   873 CThumbnailStore* CThumbnailServer::StoreForDriveL( const TInt aDrive )
   886 CThumbnailStore* CThumbnailServer::StoreForDriveL( const TInt aDrive )
   874     {
   887     {
   875     TN_DEBUG2( "CThumbnailServer::StoreForDriveL() drive=%d", aDrive );
   888     TN_DEBUG2( "CThumbnailServer::StoreForDriveL() drive=%d", aDrive );
   876     CThumbnailStore** resPtr = iStores.Find( aDrive );
   889     CThumbnailStore** resPtr = iStores.Find( aDrive );
   877     CThumbnailStore* res = NULL;
   890     CThumbnailStore* res = NULL;
   878 
       
   879 
   891 
   880     if ( resPtr )
   892     if ( resPtr )
   881         {
   893         {
   882         res = * resPtr;
   894         res = * resPtr;
   883         }
   895         }