messagingapp/msgappfw/plugins/previewplugin/src/ccspreviewpluginhandler.cpp
changeset 43 35b64624a9e7
parent 34 84197e66a4bd
child 44 36f374c67aa8
--- a/messagingapp/msgappfw/plugins/previewplugin/src/ccspreviewpluginhandler.cpp	Fri Jun 11 13:35:48 2010 +0300
+++ b/messagingapp/msgappfw/plugins/previewplugin/src/ccspreviewpluginhandler.cpp	Wed Jun 23 18:09:17 2010 +0300
@@ -347,6 +347,7 @@
                 {
                     CUniObject *obj =
                             iUniDataModel->SmilModel(). GetObjectByIndex(i, j);
+                    CMsgMediaInfo *mediaInfo = obj->MediaInfo();
 
                     TPtrC8 mimetype = obj->MimeType();
                     TMsvAttachmentId attachId = obj->AttachmentId();
@@ -365,10 +366,26 @@
                             != KErrNotFound))
                     {
                         //get thumbnail for this image
-                        GetThumbNailL(attachId, mimetype, msgId);
                         isImageSet = ETrue;
-                        imagePath.Set(obj->MediaInfo()->FullFilePath());
+                        imagePath.Set(mediaInfo->FullFilePath());
                         msgProperty |= EPreviewImage;
+
+                        if (EFileProtNoProtection != mediaInfo->Protection())
+                        {
+                            msgProperty |= EPreviewProtectedImage;
+                        }
+                        if (mediaInfo->Corrupt())
+                        {
+                            msgProperty |= EPreviewCorruptedImage;
+                        }
+
+                        if (!(EPreviewProtectedImage & msgProperty) &&
+                            !(EPreviewCorruptedImage & msgProperty))
+                        {
+                            //Generate thumbnail for non protected,
+                            //non corrupted image.
+                            GetThumbNailL(attachId, mimetype, msgId);
+                        }
                     }
 
                     //audio content
@@ -377,15 +394,31 @@
                     {
                         isAudioSet = ETrue;
                         msgProperty |= EPreviewAudio;
+                        if (EFileProtNoProtection != mediaInfo->Protection())
+                        {
+                            msgProperty |= EPreviewProtectedAudio;
+                        }
+                        if (mediaInfo->Corrupt())
+                        {
+                            msgProperty |= EPreviewCorruptedAudio;
+                        }
                     }
 
                     //video content
                     if (!isVideoSet && (mimetype.Find(_L8("video"))
                             != KErrNotFound))
                     {
-                        videoPath.Set(obj->MediaInfo()->FullFilePath());
+                        videoPath.Set(mediaInfo->FullFilePath());
                         isVideoSet = ETrue;
                         msgProperty |= EPreviewVideo;
+                        if (EFileProtNoProtection != mediaInfo->Protection())
+                        {
+                            msgProperty |= EPreviewProtectedVideo;
+                        }
+                        if (mediaInfo->Corrupt())
+                        {
+                            msgProperty |= EPreviewCorruptedVideo;
+                        }
                     }
                 }
             }