66 { |
67 { |
67 NM_FUNCTION; |
68 NM_FUNCTION; |
68 |
69 |
69 // get requesthandler pointer |
70 // get requesthandler pointer |
70 iRequestHandler = static_cast<CFSMailRequestHandler*>(Dll::Tls()); |
71 iRequestHandler = static_cast<CFSMailRequestHandler*>(Dll::Tls()); |
|
72 QT_TRYCATCH_LEAVING({ |
|
73 iMru = new EmailMRU(); |
|
74 }); |
71 } |
75 } |
72 |
76 |
73 // ----------------------------------------------------------------------------- |
77 // ----------------------------------------------------------------------------- |
74 // CFSMailBox::~CFSMailBox |
78 // CFSMailBox::~CFSMailBox |
75 // ----------------------------------------------------------------------------- |
79 // ----------------------------------------------------------------------------- |
76 EXPORT_C CFSMailBox::~CFSMailBox() |
80 EXPORT_C CFSMailBox::~CFSMailBox() |
77 { |
81 { |
78 NM_FUNCTION; |
82 NM_FUNCTION; |
79 // <qmail> Not using KMailboxExtMrCalInfo </qmail> |
83 // <qmail> Not using KMailboxExtMrCalInfo </qmail> |
80 iFolders.ResetAndDestroy(); |
84 iFolders.ResetAndDestroy(); |
|
85 QT_TRYCATCH_LEAVING({ |
|
86 delete iMru; |
|
87 }); |
81 } |
88 } |
82 |
89 |
83 // ----------------------------------------------------------------------------- |
90 // ----------------------------------------------------------------------------- |
84 // CFSMailBox::ConstructL |
91 // CFSMailBox::ConstructL |
85 // ----------------------------------------------------------------------------- |
92 // ----------------------------------------------------------------------------- |
443 |
452 |
444 CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ); |
453 CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ); |
445 |
454 |
446 if ( plugin ) |
455 if ( plugin ) |
447 { |
456 { |
448 // <qmail> Removed UpdateMrusL. </qmail> |
457 UpdateMrusL( aMessage.GetToRecipients(), |
|
458 aMessage.GetCCRecipients(), |
|
459 aMessage.GetBCCRecipients() ); |
|
460 |
449 |
461 |
450 // init asynchronous request |
462 // init asynchronous request |
451 request = iRequestHandler->InitAsyncRequestL( GetId().PluginId(), |
463 request = iRequestHandler->InitAsyncRequestL( GetId().PluginId(), |
452 aOperationObserver ); |
464 aOperationObserver ); |
453 |
465 |
661 } |
673 } |
662 return status; |
674 return status; |
663 } |
675 } |
664 |
676 |
665 // ----------------------------------------------------------------------------- |
677 // ----------------------------------------------------------------------------- |
|
678 // CFSMailBox::HasCapability |
|
679 // ----------------------------------------------------------------------------- |
|
680 EXPORT_C TBool CFSMailBox::HasCapability( const TFSMailBoxCapabilities aCapability ) const |
|
681 { |
|
682 NM_FUNCTION; |
|
683 |
|
684 TBool capability = EFalse; |
|
685 if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) ) |
|
686 { |
|
687 TRAPD( err,capability = plugin->MailboxHasCapabilityL( aCapability,GetId() )) ; |
|
688 if ( err != KErrNone ) |
|
689 { |
|
690 capability = EFalse; |
|
691 } |
|
692 } |
|
693 return capability; |
|
694 } |
|
695 |
|
696 // ----------------------------------------------------------------------------- |
|
697 |
|
698 // ----------------------------------------------------------------------------- |
|
699 // ----------------------------------------------------------------------------- |
|
700 // CFSMailBox::UpdateMrusL |
|
701 // ----------------------------------------------------------------------------- |
|
702 void CFSMailBox::UpdateMrusL( |
|
703 const RPointerArray<CFSMailAddress>& aRecipients, |
|
704 const RPointerArray<CFSMailAddress>& aCCRecipients, |
|
705 const RPointerArray<CFSMailAddress>& aBCCRecipients ) const |
|
706 { |
|
707 NM_FUNCTION; |
|
708 |
|
709 QT_TRYCATCH_LEAVING({ |
|
710 TUint count( aRecipients.Count() ); |
|
711 TUint indexer( 0 ); |
|
712 while ( indexer < count ) |
|
713 { |
|
714 TDesC& address(aRecipients[indexer]->GetEmailAddress() ); |
|
715 TDesC& name(aRecipients[indexer]->GetDisplayName() ); |
|
716 QString qaddress = QString::fromUtf16(address.Ptr(), address.Length()); |
|
717 QString qname = QString::fromUtf16(name.Ptr(), name.Length()); |
|
718 iMru->updateMRU(qname, qaddress); |
|
719 indexer++; |
|
720 } |
|
721 |
|
722 count = aCCRecipients.Count(); |
|
723 indexer = 0 ; |
|
724 while ( indexer < count ) |
|
725 { |
|
726 TDesC& address(aCCRecipients[indexer]->GetEmailAddress() ); |
|
727 TDesC& name(aCCRecipients[indexer]->GetDisplayName() ); |
|
728 QString qaddress = QString::fromUtf16(address.Ptr(), address.Length()); |
|
729 QString qname = QString::fromUtf16(name.Ptr(), name.Length()); |
|
730 iMru->updateMRU(qname, qaddress); |
|
731 indexer++; |
|
732 } |
|
733 |
|
734 count = aBCCRecipients.Count(); |
|
735 indexer = 0 ; |
|
736 while ( indexer < count ) |
|
737 { |
|
738 TDesC& address(aBCCRecipients[indexer]->GetEmailAddress() ); |
|
739 TDesC& name(aBCCRecipients[indexer]->GetDisplayName() ); |
|
740 QString qaddress = QString::fromUtf16(address.Ptr(), address.Length()); |
|
741 QString qname = QString::fromUtf16(name.Ptr(), name.Length()); |
|
742 iMru->updateMRU(qname, qaddress); |
|
743 indexer++; |
|
744 } |
|
745 |
|
746 }); |
|
747 |
|
748 } |
|
749 |
|
750 // ----------------------------------------------------------------------------- |
666 // CFSMailBox::ReleaseExtension |
751 // CFSMailBox::ReleaseExtension |
667 // ----------------------------------------------------------------------------- |
752 // ----------------------------------------------------------------------------- |
668 EXPORT_C void CFSMailBox::ReleaseExtension( CEmailExtension* aExtension ) |
753 EXPORT_C void CFSMailBox::ReleaseExtension( CEmailExtension* aExtension ) |
669 { |
754 { |
670 NM_FUNCTION; |
755 NM_FUNCTION; |