527 } |
527 } |
528 |
528 |
529 if(plugin != NULL) |
529 if(plugin != NULL) |
530 { |
530 { |
531 RPointerArray<CFSMailMessagePart> parts; |
531 RPointerArray<CFSMailMessagePart> parts; |
532 RArray<TFSMailMsgId> partIds; |
532 CleanupResetAndDestroyPushL( parts ); |
533 plugin->ChildPartsL(GetMailBoxId(),GetFolderId(),GetMessageId(),GetPartId(),parts); |
533 plugin->ChildPartsL(GetMailBoxId(),GetFolderId(),GetMessageId(),GetPartId(),parts); |
|
534 RArray<TFSMailMsgId> partIds; |
|
535 CleanupClosePushL( partIds ); |
|
536 partIds.ReserveL( 1 + parts.Count() ); |
534 for(TInt i=0;i<parts.Count();i++) |
537 for(TInt i=0;i<parts.Count();i++) |
535 { |
538 { |
536 partIds.Append(parts[i]->GetMessageId()); |
539 partIds.AppendL( parts[i]->GetMessageId() ); |
537 } |
540 } |
538 partIds.Append(GetPartId()); |
541 partIds.AppendL( GetPartId() ); |
539 plugin->RemovePartContentL(GetMailBoxId(), GetFolderId(), GetMessageId(), partIds); |
542 plugin->RemovePartContentL(GetMailBoxId(), GetFolderId(), GetMessageId(), partIds); |
540 parts.ResetAndDestroy(); |
543 CleanupStack::PopAndDestroy( &partIds ); |
541 partIds.Reset(); |
544 CleanupStack::PopAndDestroy( &parts ); |
542 } |
545 } |
543 } |
546 } |
544 |
547 |
545 // ----------------------------------------------------------------------------- |
548 // ----------------------------------------------------------------------------- |
546 // CFSMailMessagePart::RemoveDownLoadedAttachmentsL |
549 // CFSMailMessagePart::RemoveDownLoadedAttachmentsL |
557 |
560 |
558 if(plugin != NULL) |
561 if(plugin != NULL) |
559 { |
562 { |
560 // get attachment list |
563 // get attachment list |
561 RPointerArray<CFSMailMessagePart> attachments; |
564 RPointerArray<CFSMailMessagePart> attachments; |
562 attachments.Reset(); |
565 CleanupResetAndDestroyPushL( attachments ); |
563 DoAttachmentListL(attachments); |
566 DoAttachmentListL(attachments); |
564 |
567 |
565 // copy attachment part ids |
568 // copy attachment part ids |
566 RArray<TFSMailMsgId> ids; |
569 RArray<TFSMailMsgId> ids; |
567 ids.Reset(); |
570 CleanupClosePushL( ids ); |
568 for(TInt i=0;i<attachments.Count();i++) |
571 for(TInt i=0;i<attachments.Count();i++) |
569 { |
572 { |
570 ids.Append(attachments[i]->GetPartId()); |
573 ids.Append(attachments[i]->GetPartId()); |
571 } |
574 } |
572 |
575 |
575 { |
578 { |
576 TRAP_IGNORE(plugin->RemovePartContentL(GetMailBoxId(), GetFolderId(), GetMessageId(), ids)); |
579 TRAP_IGNORE(plugin->RemovePartContentL(GetMailBoxId(), GetFolderId(), GetMessageId(), ids)); |
577 } |
580 } |
578 |
581 |
579 // clean tables |
582 // clean tables |
580 attachments.ResetAndDestroy(); |
583 CleanupStack::PopAndDestroy( &ids ); |
581 ids.Reset(); |
584 CleanupStack::PopAndDestroy( &attachments ); |
582 } |
585 } |
583 } |
586 } |
584 |
587 |
585 // ----------------------------------------------------------------------------- |
588 // ----------------------------------------------------------------------------- |
586 // CFSMailMessagePart::GetContentFileL |
589 // CFSMailMessagePart::GetContentFileL |