emailuis/emailui/src/FreestyleEmailUiAttachmentsListModel.cpp
branchRCL_3
changeset 11 0396474f30f5
parent 8 e1b6206813b4
child 20 efd4f1afd43e
--- a/emailuis/emailui/src/FreestyleEmailUiAttachmentsListModel.cpp	Fri Mar 12 15:41:14 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiAttachmentsListModel.cpp	Mon Mar 15 12:39:10 2010 +0200
@@ -465,6 +465,18 @@
     return msgFound;
     }
 
+TBool CFSEmailUiAttachmentsListModel::IsThereAnyNonMessageAttachments() const
+    {
+    FUNC_LOG;
+    TBool msgFound = EFalse;
+    TInt attCount = iAttachments.Count();
+    for ( TInt i = 0 ; i < attCount && !msgFound ; i++ )
+        {
+        msgFound = !IsMessage( iAttachments[i] );
+        }
+    return msgFound;
+    }
+
 void CFSEmailUiAttachmentsListModel::UpdateListL( CFSMailMessage* aEmbeddedMessage )
 	{
     FUNC_LOG;
@@ -593,10 +605,15 @@
 	TBool retVal = EFalse;
 	TInt attCount = iAttachments.Count();
     TInt savedCount( 0 );
+    const CFSMailBox* mailbox( iAppUi.GetActiveMailbox() );
 	for ( TInt i = 0; i < attCount; i++ )
 		{
-		TBool downloadStarted = SaveAttachmentL( iAttachments[i], aFileName, savedCount );
-		retVal = downloadStarted || retVal;
+        if ( !IsMessage( iAttachments[i] ) || 
+                ( mailbox && mailbox->HasCapability( EFSMboxCapaSupportsSavingOfEmbeddedMessages ) ) )
+            {
+            TBool downloadStarted = SaveAttachmentL( iAttachments[i], aFileName, savedCount );
+            retVal = downloadStarted || retVal;
+            }
 		}
 	if ( savedCount )
 	    {