meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrattachmentcommandhandler.cpp
branchRCL_3
changeset 17 67369d1b217f
parent 16 b5fbb9b25d57
--- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrattachmentcommandhandler.cpp	Tue May 11 15:57:15 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrattachmentcommandhandler.cpp	Tue May 25 12:23:16 2010 +0300
@@ -468,21 +468,23 @@
             HandleAttachmentCommandInternalL(
                     EESMRViewerSaveAttachment, attachmentIndex );
 
-            if ( EESMRViewerSaveAllAttachments == iCommandInProgress &&
-                 iAttachmentInfo->AttachmentCount() )
+            if ( EESMRViewerSaveAllAttachments == iCommandInProgress )
                 {
                 iCommandInProgress = 0;
 
-                // There are more attachments to be downloaded --> Download next
-                SaveNextRemoteAttachmentL();
+                if ( iAttachmentInfo->AttachmentCount() > 0 )
+                    {
+                    // There are more attachments to be downloaded --> Download next
+                    SaveNextRemoteAttachmentL();
+                    }
+                else
+                    {
+                    // All remote attachments have been saved. Show info note.
+                    ShowInfoNoteL( iEntry.AttachmentCountL() );
+                    }
                 }
             else
                 {
-                if ( !iAttachmentInfo->AttachmentCount() )
-                    {
-                    // All remote attachments have been saved. Show info note. 
-                    ShowInfoNoteL( iEntry.AttachmentCountL() );
-                    }
                 iCommandInProgress = 0;
                 }
             }
@@ -555,7 +557,7 @@
         if ( error != KErrCancel )
             {
             User::LeaveIfError( error );
-            
+
             if ( aCommandId == EESMRViewerSaveAttachment
                  && iCommandInProgress != EESMRViewerSaveAllAttachments )
                 {
@@ -833,13 +835,13 @@
         User::LeaveIfError( error );
 
         // Proceed with remote attachments
-        if ( iAttachmentInfo->AttachmentCount() > 0 )
+        if ( iAttachmentInfo && iAttachmentInfo->AttachmentCount() > 0 )
             {
             SaveNextRemoteAttachmentL();
             }
         else // Show Save all info note
             {
-            ShowInfoNoteL( iEntry.AttachmentCountL() ); 
+            ShowInfoNoteL( iEntry.AttachmentCountL() );
             }
         }
     }
@@ -852,7 +854,7 @@
     {
     __ASSERT_DEBUG( iAttachmentInfo->AttachmentCount() > 0,
                     Panic( EMRAttachmentCommandHandlerRemoteAttachmentNotFound ) );
-    
+
     // Save first remote attachment of attachment info
     RPointerArray<MCalRemoteAttachment> attachmentArray;
     CleanupClosePushL( attachmentArray );