videocollection/hgmyvideos/src/vcxhgmyvideosvideodataupdater.cpp
branchRCL_3
changeset 15 8f0df5c82986
parent 9 5294c000a26d
child 20 2d690156cf8f
equal deleted inserted replaced
14:55fa1ec415c6 15:8f0df5c82986
   257 // -----------------------------------------------------------------------------
   257 // -----------------------------------------------------------------------------
   258 // CVcxHgMyVideosVideoDataUpdater::AddItemToFetchArrayL()
   258 // CVcxHgMyVideosVideoDataUpdater::AddItemToFetchArrayL()
   259 // -----------------------------------------------------------------------------
   259 // -----------------------------------------------------------------------------
   260 //
   260 //
   261 void CVcxHgMyVideosVideoDataUpdater::AddItemToFetchArrayL( TMPXItemId aMPXItemId )
   261 void CVcxHgMyVideosVideoDataUpdater::AddItemToFetchArrayL( TMPXItemId aMPXItemId )
   262     {      
   262     {
   263     CVcxHgMyVideosVideoData* newItem = CVcxHgMyVideosVideoData::NewLC();
   263     CVcxHgMyVideosVideoData* newItem = CVcxHgMyVideosVideoData::NewLC();
   264     newItem->SetMPXItemId( aMPXItemId );
   264     newItem->SetMPXItemId( aMPXItemId );
   265     iFetchArray.AppendL( newItem );   
   265     iFetchArray.AppendL( newItem );   
   266     
   266     
   267     CleanupStack::Pop( newItem );
   267     CleanupStack::Pop( newItem );
   847             id = iModel.ThumbnailManager().PeekL( *source );
   847             id = iModel.ThumbnailManager().PeekL( *source );
   848             CleanupStack::PopAndDestroy( source );
   848             CleanupStack::PopAndDestroy( source );
   849             }
   849             }
   850         else
   850         else
   851             {
   851             {
   852             // Use shared file handle to minimize thumbnailserver overhead 
       
   853             RFs& fs = iModel.FileServerSessionL();
       
   854             RFile64 file;
       
   855             User::LeaveIfError( file.Open( fs, uri, EFileShareReadersOrWriters ));
       
   856             CleanupClosePushL( file );
       
   857             CThumbnailObjectSource* source = CThumbnailObjectSource::NewLC(
   852             CThumbnailObjectSource* source = CThumbnailObjectSource::NewLC(
   858                     file, mime );
   853                     uri, mime );
   859             id = iModel.ThumbnailManager().GetL( *source );
   854             id = iModel.ThumbnailManager().GetL( *source );
   860             CleanupStack::PopAndDestroy( source ); 
   855             CleanupStack::PopAndDestroy( source ); 
   861             CleanupStack::PopAndDestroy( &file );
       
   862             }
   856             }
   863         aItem.SetThumbnailConversionId( id );
   857         aItem.SetThumbnailConversionId( id );
   864 
   858 
   865         IPTVLOGSTRING4_LOW_LEVEL( 
   859         IPTVLOGSTRING4_LOW_LEVEL( 
   866                 "MPX My Videos UI # StartThumbnailL() called thumbID %d for %S (peek %d)",
   860                 "MPX My Videos UI # StartThumbnailL() called thumbID %d for %S (peek %d)",