400 } |
400 } |
401 |
401 |
402 if(plugin != NULL) |
402 if(plugin != NULL) |
403 { |
403 { |
404 RPointerArray<CFSMailMessagePart> parts; |
404 RPointerArray<CFSMailMessagePart> parts; |
405 RArray<TFSMailMsgId> partIds; |
405 CleanupResetAndDestroyPushL( parts ); |
406 plugin->ChildPartsL(GetMailBoxId(),GetFolderId(),GetMessageId(),GetPartId(),parts); |
406 plugin->ChildPartsL(GetMailBoxId(),GetFolderId(),GetMessageId(),GetPartId(),parts); |
|
407 RArray<TFSMailMsgId> partIds; |
|
408 CleanupClosePushL( partIds ); |
|
409 partIds.ReserveL( 1 + parts.Count() ); |
407 for(TInt i=0;i<parts.Count();i++) |
410 for(TInt i=0;i<parts.Count();i++) |
408 { |
411 { |
409 partIds.Append(parts[i]->GetMessageId()); |
412 partIds.AppendL( parts[i]->GetMessageId() ); |
410 } |
413 } |
411 partIds.Append(GetPartId()); |
414 partIds.AppendL( GetPartId() ); |
412 plugin->RemovePartContentL(GetMailBoxId(), GetFolderId(), GetMessageId(), partIds); |
415 plugin->RemovePartContentL(GetMailBoxId(), GetFolderId(), GetMessageId(), partIds); |
413 parts.ResetAndDestroy(); |
416 CleanupStack::PopAndDestroy( &partIds ); |
414 partIds.Reset(); |
417 CleanupStack::PopAndDestroy( &parts ); |
415 } |
418 } |
416 } |
419 } |
417 |
420 |
418 // ----------------------------------------------------------------------------- |
421 // ----------------------------------------------------------------------------- |
419 // CFSMailMessagePart::RemoveDownLoadedAttachmentsL |
422 // CFSMailMessagePart::RemoveDownLoadedAttachmentsL |
430 |
433 |
431 if(plugin != NULL) |
434 if(plugin != NULL) |
432 { |
435 { |
433 // get attachment list |
436 // get attachment list |
434 RPointerArray<CFSMailMessagePart> attachments; |
437 RPointerArray<CFSMailMessagePart> attachments; |
435 attachments.Reset(); |
438 CleanupResetAndDestroyPushL( attachments ); |
436 DoAttachmentListL(attachments); |
439 DoAttachmentListL(attachments); |
437 |
440 |
438 // copy attachment part ids |
441 // copy attachment part ids |
439 RArray<TFSMailMsgId> ids; |
442 RArray<TFSMailMsgId> ids; |
440 ids.Reset(); |
443 CleanupClosePushL( ids ); |
441 for(TInt i=0;i<attachments.Count();i++) |
444 for(TInt i=0;i<attachments.Count();i++) |
442 { |
445 { |
443 ids.Append(attachments[i]->GetPartId()); |
446 ids.Append(attachments[i]->GetPartId()); |
444 } |
447 } |
445 |
448 |
448 { |
451 { |
449 TRAP_IGNORE(plugin->RemovePartContentL(GetMailBoxId(), GetFolderId(), GetMessageId(), ids)); |
452 TRAP_IGNORE(plugin->RemovePartContentL(GetMailBoxId(), GetFolderId(), GetMessageId(), ids)); |
450 } |
453 } |
451 |
454 |
452 // clean tables |
455 // clean tables |
453 attachments.ResetAndDestroy(); |
456 CleanupStack::PopAndDestroy( &ids ); |
454 ids.Reset(); |
457 CleanupStack::PopAndDestroy( &attachments ); |
455 } |
458 } |
456 } |
459 } |
457 |
460 |
458 // ----------------------------------------------------------------------------- |
461 // ----------------------------------------------------------------------------- |
459 // CFSMailMessagePart::GetContentFileL |
462 // CFSMailMessagePart::GetContentFileL |