emailservices/emailframework/commonlib/src/CFSMailBox.cpp
branchRCL_3
changeset 17 67369d1b217f
parent 16 b5fbb9b25d57
child 18 6b8f3b30d0ec
equal deleted inserted replaced
16:b5fbb9b25d57 17:67369d1b217f
    19 #include <bamdesca.h>
    19 #include <bamdesca.h>
    20 
    20 
    21 
    21 
    22 #include "cfsmailplugin.h"
    22 #include "cfsmailplugin.h"
    23 #include "cmrcalendarinfoimpl.h"
    23 #include "cmrcalendarinfoimpl.h"
       
    24 #include "emailextensionuids.hrh"
    24 
    25 
    25 #include "cfsmailbox.h"
    26 #include "cfsmailbox.h"
    26 #include "cfsmailrequestobserver.h"
    27 #include "cfsmailrequestobserver.h"
    27 
    28 
    28 #include "cmailboxstateext.h"
    29 #include "cmailboxstateext.h"
   842     FUNC_LOG;
   843     FUNC_LOG;
   843     // MR UI needs KMailboxExtMrCalInfo to not be released until CFSMailBox 
   844     // MR UI needs KMailboxExtMrCalInfo to not be released until CFSMailBox 
   844     // exists. It is released in desctrucor
   845     // exists. It is released in desctrucor
   845     if( aExtension->Uid() != KMailboxExtMrCalInfo )
   846     if( aExtension->Uid() != KMailboxExtMrCalInfo )
   846         {
   847         {
   847         // no specialized behaviour, call base class
   848         if( aExtension->Uid() == KEmailSettingExtensionUid )
   848         CExtendableEmail::ReleaseExtension( aExtension );
   849             {
       
   850             // check that plugin supports requested extension.
       
   851             if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) )
       
   852                 {
       
   853                 // remove extension from plugin
       
   854                  plugin->ReleaseExtension(aExtension);            
       
   855                 }
       
   856             }
       
   857         else
       
   858             {
       
   859             // no specialized behaviour, call base class
       
   860             CExtendableEmail::ReleaseExtension( aExtension );
       
   861             }
   849         }
   862         }
   850     else
   863     else
   851         {
   864         {
   852         if( !aExtension->DecRef() )
   865         if( !aExtension->DecRef() )
   853             {
   866             {
   872             CleanupStack::PushL( extension );
   885             CleanupStack::PushL( extension );
   873             iExtensions.AddL( extension );
   886             iExtensions.AddL( extension );
   874             CleanupStack::Pop(); // calInfo
   887             CleanupStack::Pop(); // calInfo
   875             }
   888             }
   876         }    
   889         }    
   877     else if ( aInterfaceUid == KEmailMailboxStateExtensionUid )
   890     else if ( aInterfaceUid == KEmailMailboxStateExtensionUid ||
       
   891               aInterfaceUid == KEmailSettingExtensionUid )
   878         {
   892         {
   879         if ( !extension )
   893         if ( !extension )
   880             {
   894             {
   881             // check that plugin supports requested extension.
   895             // check that plugin supports requested extension.
   882             if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) )
   896             if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) )