--- a/mtpdataproviders/mtpimagedp/src/cmtpimagedpgetthumb.cpp Wed Sep 15 13:07:27 2010 +0300
+++ b/mtpdataproviders/mtpimagedp/src/cmtpimagedpgetthumb.cpp Wed Oct 13 15:29:02 2010 +0300
@@ -111,26 +111,21 @@
TEntry fileEntry;
User::LeaveIfError(iFramework.Fs().Entry(iObjectMeta->DesC(CMTPObjectMetaData::ESuid), fileEntry));
-
- CMTPImageDpThumbnailCreator* tnc = imgDp.ThumbnailManager();
- if(tnc != NULL)
+ imgDp.ThumbnailManager().GetThumbMgr()->SetFlagsL(CThumbnailManager::EDefaultFlags);
+ if(fileEntry.FileSize() > KFileSizeMax)
{
- tnc->GetThumbMgr()->SetFlagsL(CThumbnailManager::EDefaultFlags);
- if(fileEntry.FileSize() > KFileSizeMax)
- {
- __FLOG(_L8(">> CMTPImageDpGetThumb::ServiceL, fileEntry.FileSize() > KFileSizeMax"));
- tnc->GetThumbMgr()->SetFlagsL(CThumbnailManager::EDoNotCreate);
- }
-
- tnc->GetThumbnailL(iObjectMeta->DesC(CMTPObjectMetaData::ESuid), thumbnailData, err);
- imgDp.PropertyMgr().StoreThunmnail(iObjectMeta->Uint(CMTPObjectMetaData::EHandle), thumbnailData);
+ __FLOG(_L8(">> CMTPImageDpGetThumb::ServiceL, fileEntry.FileSize() > KFileSizeMax"));
+ imgDp.ThumbnailManager().GetThumbMgr()->SetFlagsL(CThumbnailManager::EDoNotCreate);
}
- //Transfer ownership of thumbnailData to Property Manager
+
+ imgDp.ThumbnailManager().GetThumbnailL(iObjectMeta->DesC(CMTPObjectMetaData::ESuid), thumbnailData, err);
+ User::LeaveIfError(err);
+ User::LeaveIfNull(thumbnailData);
+
+ //Transfer ownership of thumbnailData to Property Manager
+ imgDp.PropertyMgr().StoreThunmnail(iObjectMeta->Uint(CMTPObjectMetaData::EHandle), thumbnailData);
}
- if(thumbnailData != NULL)
- {
- iThumb->Write(*thumbnailData);
- }
+ iThumb->Write(*thumbnailData);
SendDataL(*iThumb);
__FLOG(_L8("<< CMTPImageDpGetThumb::ServiceL"));
}