ipsservices/ipssossettings/src/ipssetdataapi.cpp
branchRCL_3
changeset 22 d620048b4810
parent 16 b5fbb9b25d57
equal deleted inserted replaced
20:efd4f1afd43e 22:d620048b4810
    43 #include "ipssetutilsconsts.h"
    43 #include "ipssetutilsconsts.h"
    44 #include "ipsplgcommon.h"
    44 #include "ipsplgcommon.h"
    45 #include "ipssetdataapi.h"
    45 #include "ipssetdataapi.h"
    46 #include "ipssetwizardadapter.h"
    46 #include "ipssetwizardadapter.h"
    47 
    47 
    48 #include "ipssetwizardsettingscenrepkeys.h" 
    48 #include "ipssetwizardsettingscenrepkeys.h"
       
    49 #include "freestyleemailcenrepkeys.h"
    49 #include "ipssetdatasignature.h"
    50 #include "ipssetdatasignature.h"
    50 
    51 
    51 const TInt KIpsDataApiMaxPassLen = 256;
    52 const TInt KIpsDataApiMaxPassLen = 256;
    52 const TInt KWizardDataPopIndicator = 0;
    53 const TInt KWizardDataPopIndicator = 0;
    53 const TInt KWizardDataImapIndicator = 1;
    54 const TInt KWizardDataImapIndicator = 1;
   441         {
   442         {
   442         //always reset the max account flag when a mailbox is deleted
   443         //always reset the max account flag when a mailbox is deleted
   443         TInt err3 = repository->Set(
   444         TInt err3 = repository->Set(
   444             ECRKMaxAccountsReached, EFalse );
   445             ECRKMaxAccountsReached, EFalse );
   445 
   446 
   446         if ( err3 != KErrNone )
   447        
   447             {
       
   448             }
       
   449         
       
   450         delete repository;
   448         delete repository;
   451         repository = NULL;
   449         repository = NULL;
   452         }
   450         }
   453     }
   451     }
   454     
   452     
   665 
   663 
   666     {
   664     {
   667     FUNC_LOG;
   665     FUNC_LOG;
   668     TInt sizeLimit = aImap4Settings.BodyTextSizeLimit();
   666     TInt sizeLimit = aImap4Settings.BodyTextSizeLimit();
   669     
   667     
       
   668 	
       
   669     CRepository* centRep = NULL;
       
   670     TRAP_IGNORE( centRep = CRepository::NewL( KFreestyleEmailCenRep ) );
       
   671     
       
   672     TInt limit( 0 );
       
   673     TInt err = centRep->Get( KFreestyleMaxBodySize , limit );
       
   674 	limit *= KKilo;
       
   675 	if ( limit == 0 || err )
       
   676         {
       
   677         limit = KMaxTInt;
       
   678         }
       
   679     
   670     if ( sizeLimit == KIpsSetDataHeadersOnly )
   680     if ( sizeLimit == KIpsSetDataHeadersOnly )
   671         {
   681         {
   672         aInfo.iTotalSizeLimit = KIpsSetDataHeadersOnly;
   682         aInfo.iTotalSizeLimit = KIpsSetDataHeadersOnly;
   673         }
   683         }
   674     else if ( sizeLimit == KIpsSetDataFullBodyAndAttas )
   684     else if ( sizeLimit == KIpsSetDataFullBodyAndAttas )
   675         {        
   685         {        
   676         aInfo.iTotalSizeLimit = KMaxTInt;
   686         aInfo.iTotalSizeLimit = KMaxTInt;
   677         aInfo.iAttachmentSizeLimit = KMaxTInt;
   687         aInfo.iAttachmentSizeLimit = KMaxTInt;
   678         aInfo.iBodyTextSizeLimit = KMaxTInt;
   688         aInfo.iBodyTextSizeLimit = limit;
   679         aInfo.iMaxEmailSize = KMaxTInt;
   689         aInfo.iMaxEmailSize = KMaxTInt;
   680         aInfo.iPartialMailOptions = ENoSizeLimits;
   690         aInfo.iPartialMailOptions = ENoSizeLimits;
   681         aInfo.iGetMailBodyParts = EGetImap4EmailBodyTextAndAttachments;
   691         aInfo.iGetMailBodyParts = EGetImap4EmailBodyTextAndAttachments;
   682         }
   692         }
   683     else if ( sizeLimit == KIpsSetDataFullBodyOnly )
   693     else if ( sizeLimit == KIpsSetDataFullBodyOnly )
   684         {
   694         {
   685         aInfo.iTotalSizeLimit = KMaxTInt; 
   695         aInfo.iTotalSizeLimit = KMaxTInt; 
   686         aInfo.iAttachmentSizeLimit = 0;
   696         aInfo.iAttachmentSizeLimit = 0;
   687         aInfo.iBodyTextSizeLimit = KMaxTInt;
   697         aInfo.iBodyTextSizeLimit = limit;
   688         aInfo.iMaxEmailSize = KMaxTInt;
   698         aInfo.iMaxEmailSize = KMaxTInt;
   689         aInfo.iPartialMailOptions = EBodyAlternativeText;
   699         aInfo.iPartialMailOptions = EBodyAlternativeText;
   690         aInfo.iGetMailBodyParts = EGetImap4EmailBodyAlternativeText;
   700         aInfo.iGetMailBodyParts = EGetImap4EmailBodyAlternativeText;
   691         }
   701         }
   692     else
   702     else
   693         {
   703         {
   694         aInfo.iTotalSizeLimit = sizeLimit*1024; 
   704         aInfo.iTotalSizeLimit = sizeLimit*1024; 
   695         // set zero when it not documentated does total size overrides these 
   705         // set zero when it not documentated does total size overrides these 
   696         aInfo.iAttachmentSizeLimit = 0;
   706         aInfo.iAttachmentSizeLimit = 0;
   697         aInfo.iMaxEmailSize = sizeLimit*1024;
   707         aInfo.iMaxEmailSize = sizeLimit*1024;
   698         aInfo.iBodyTextSizeLimit = sizeLimit*1024;
   708         aInfo.iBodyTextSizeLimit = Min(sizeLimit*1024, limit);
   699         aInfo.iPartialMailOptions = EBodyAlternativeText;
   709         aInfo.iPartialMailOptions = EBodyAlternativeText;
   700         aInfo.iGetMailBodyParts = EGetImap4EmailBodyAlternativeText;
   710         aInfo.iGetMailBodyParts = EGetImap4EmailBodyAlternativeText;
   701         }
   711         }
   702     }
   712     }
   703 
   713