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 } |