mtpdataproviders/mtpimagedp/src/cmtpimagedpgetthumb.cpp
changeset 41 2c19c7cf5550
parent 17 aabe5387f5ce
child 43 4a793f564d72
child 47 63cf70d3ecd8
equal deleted inserted replaced
37:d9d8313203af 41:2c19c7cf5550
   109         {
   109         {
   110         __FLOG(_L8("CMTPImageDpGetThumb::ServiceL-  fail to query thumbnail from cache"));
   110         __FLOG(_L8("CMTPImageDpGetThumb::ServiceL-  fail to query thumbnail from cache"));
   111         TEntry fileEntry;
   111         TEntry fileEntry;
   112         
   112         
   113         User::LeaveIfError(iFramework.Fs().Entry(iObjectMeta->DesC(CMTPObjectMetaData::ESuid), fileEntry));
   113         User::LeaveIfError(iFramework.Fs().Entry(iObjectMeta->DesC(CMTPObjectMetaData::ESuid), fileEntry));
   114         imgDp.ThumbnailManager().GetThumbMgr()->SetFlagsL(CThumbnailManager::EDefaultFlags);
   114         
   115         if(fileEntry.FileSize() > KFileSizeMax)
   115         CMTPImageDpThumbnailCreator* tnc = imgDp.ThumbnailManager();
       
   116         if(tnc != NULL)
   116             {
   117             {
   117             __FLOG(_L8(">> CMTPImageDpGetThumb::ServiceL, fileEntry.FileSize() > KFileSizeMax"));
   118             tnc->GetThumbMgr()->SetFlagsL(CThumbnailManager::EDefaultFlags);
   118             imgDp.ThumbnailManager().GetThumbMgr()->SetFlagsL(CThumbnailManager::EDoNotCreate);
   119             if(fileEntry.FileSize() > KFileSizeMax)
       
   120                 {
       
   121                 __FLOG(_L8(">> CMTPImageDpGetThumb::ServiceL, fileEntry.FileSize() > KFileSizeMax"));
       
   122                 tnc->GetThumbMgr()->SetFlagsL(CThumbnailManager::EDoNotCreate);
       
   123                 }
       
   124             
       
   125             tnc->GetThumbnailL(iObjectMeta->DesC(CMTPObjectMetaData::ESuid), thumbnailData, err);
       
   126             imgDp.PropertyMgr().StoreThunmnail(iObjectMeta->Uint(CMTPObjectMetaData::EHandle), thumbnailData);
   119             }
   127             }
   120         
   128         //Transfer ownership of thumbnailData to Property Manager       
   121         imgDp.ThumbnailManager().GetThumbnailL(iObjectMeta->DesC(CMTPObjectMetaData::ESuid), thumbnailData, err);
       
   122         User::LeaveIfError(err);
       
   123         User::LeaveIfNull(thumbnailData);
       
   124         
       
   125         //Transfer ownership of thumbnailData to Property Manager
       
   126         imgDp.PropertyMgr().StoreThunmnail(iObjectMeta->Uint(CMTPObjectMetaData::EHandle), thumbnailData);
       
   127         }
   129         }
   128     iThumb->Write(*thumbnailData);
   130     if(thumbnailData != NULL)
       
   131         {
       
   132         iThumb->Write(*thumbnailData);
       
   133         }
   129     SendDataL(*iThumb);
   134     SendDataL(*iThumb);
   130     __FLOG(_L8("<< CMTPImageDpGetThumb::ServiceL"));
   135     __FLOG(_L8("<< CMTPImageDpGetThumb::ServiceL"));
   131     }
   136     }
   132 
   137 
   133 TBool CMTPImageDpGetThumb::DoHandleCompletingPhaseL()
   138 TBool CMTPImageDpGetThumb::DoHandleCompletingPhaseL()