mobilemessaging/unieditor/model/src/UniObject.cpp
branchRCL_3
changeset 24 e00582ce7ecd
parent 0 72b543305e3a
--- a/mobilemessaging/unieditor/model/src/UniObject.cpp	Wed Apr 14 15:53:21 2010 +0300
+++ b/mobilemessaging/unieditor/model/src/UniObject.cpp	Tue Apr 27 16:33:37 2010 +0300
@@ -596,8 +596,8 @@
         SetAttachment( isAttachment );
         }
 
-    CMsvAttachment::TMsvAttachmentType type = aAttachment.Type();
-    if ( type == CMsvAttachment::EMsvLinkedFile )
+    iSaveType = aAttachment.Type();
+    if ( iSaveType == CMsvAttachment::EMsvLinkedFile )
         {
         iFileHandle = aManager.GetAttachmentFileL( iAttachmentId  );
         }
@@ -761,5 +761,32 @@
             }
         }
     }
-       
+
+// ---------------------------------------------------------
+// CUniObject::IsValid
+//
+// ---------------------------------------------------------
+//
+EXPORT_C TBool CUniObject::IsValid() const
+    {
+    TBool bFlag = ETrue;
+    if ( iSaveType == CMsvAttachment::EMsvLinkedFile )
+        {
+        TParsePtrC fileParse( iMediaInfo->FullFilePath() );
+        
+        RFile file;     
+        TInt err = file.Open( iFs, fileParse.FullName(), EFileShareAny );
+      
+        if(err == KErrNotReady)
+            {
+            bFlag = EFalse;
+            }
+        if(err == KErrNone)
+            {
+            file.Close();
+            }
+        }
+    return bFlag;
+    }
+
 // EOF