mtpdataproviders/mtpimagedp/src/cmtpimagedpobjectpropertymgr.cpp
changeset 44 a5deb6b96675
parent 38 48c22c726cf9
child 47 63cf70d3ecd8
--- a/mtpdataproviders/mtpimagedp/src/cmtpimagedpobjectpropertymgr.cpp	Wed Aug 18 10:38:51 2010 +0300
+++ b/mtpdataproviders/mtpimagedp/src/cmtpimagedpobjectpropertymgr.cpp	Thu Sep 02 21:21:26 2010 +0300
@@ -454,21 +454,23 @@
          */
         TEntry fileEntry;
         TInt err = iFs.Entry(iObjectInfo->DesC(CMTPObjectMetaData::ESuid), fileEntry);
-        if (err == KErrNone)
+        CMTPImageDpThumbnailCreator* tnc = iDataProvider.ThumbnailManager();
+        if (err == KErrNone && tnc != NULL)
             {
+            
             if(fileEntry.FileSize() > KFileSizeMax || !alwaysCreate)
                 {
-                iDataProvider.ThumbnailManager().GetThumbMgr()->SetFlagsL(CThumbnailManager::EDoNotCreate);
+                tnc->GetThumbMgr()->SetFlagsL(CThumbnailManager::EDoNotCreate);
                 }
             else
                 {
-                iDataProvider.ThumbnailManager().GetThumbMgr()->SetFlagsL(CThumbnailManager::EDefaultFlags);
+                tnc->GetThumbMgr()->SetFlagsL(CThumbnailManager::EDefaultFlags);
                 }
             
             /**
              * trap the leave to avoid return general error when PC get object property list
              */
-            TRAP(err, iDataProvider.ThumbnailManager().GetThumbnailL(iObjectInfo->DesC(CMTPObjectMetaData::ESuid), iThumbnailCache.iThumbnailData, err));
+            TRAP(err, tnc->GetThumbnailL(iObjectInfo->DesC(CMTPObjectMetaData::ESuid), iThumbnailCache.iThumbnailData, err));
             if (err == KErrNone)
                 {
                 iThumbnailCache.iObjectHandle = iObjectInfo->Uint(CMTPObjectMetaData::EHandle);                        
@@ -484,6 +486,10 @@
                     }
                 }
             }
+        else
+            {
+            aValue = KThumbCompressedSize;
+            }
         }
         break;       
        
@@ -599,22 +605,23 @@
              */
             TEntry fileEntry;
             TInt err = iFs.Entry(iObjectInfo->DesC(CMTPObjectMetaData::ESuid), fileEntry);
-            if (err == KErrNone)
+            CMTPImageDpThumbnailCreator* tnc = iDataProvider.ThumbnailManager();
+            if (err == KErrNone && tnc != NULL)
                 {
                 
                 if(fileEntry.FileSize() > KFileSizeMax || !alwaysCreate)
                     {
-                    iDataProvider.ThumbnailManager().GetThumbMgr()->SetFlagsL(CThumbnailManager::EDoNotCreate);
+                    tnc->GetThumbMgr()->SetFlagsL(CThumbnailManager::EDoNotCreate);
                     }
                 else
                     {
-                    iDataProvider.ThumbnailManager().GetThumbMgr()->SetFlagsL(CThumbnailManager::EDefaultFlags);
+                    tnc->GetThumbMgr()->SetFlagsL(CThumbnailManager::EDefaultFlags);
                     }
                 
                 /**
                  * trap the leave to avoid return general error when PC get object property list
                  */
-                TRAP(err, iDataProvider.ThumbnailManager().GetThumbnailL(iObjectInfo->DesC(CMTPObjectMetaData::ESuid), iThumbnailCache.iThumbnailData, err));
+                TRAP(err, tnc->GetThumbnailL(iObjectInfo->DesC(CMTPObjectMetaData::ESuid), iThumbnailCache.iThumbnailData, err));
                 if (err == KErrNone)
                     {
                     iThumbnailCache.iObjectHandle = iObjectInfo->Uint(CMTPObjectMetaData::EHandle);