895 accounts->LoadPopIapSettingsL( account, *apPrefs ); |
895 accounts->LoadPopIapSettingsL( account, *apPrefs ); |
896 } |
896 } |
897 CleanupStack::PopAndDestroy( accounts ); // accounts |
897 CleanupStack::PopAndDestroy( accounts ); // accounts |
898 |
898 |
899 // Check ap preferences |
899 // Check ap preferences |
900 TImIAPChoice iapChoice = apPrefs->IAPPreference( KMailSettingsIapPreferenceNumber ); |
900 TInt iapId; |
901 TInt iapId = iapChoice.iIAP; |
901 if ( apPrefs->NumberOfIAPs()>0 ) |
|
902 { |
|
903 TImIAPChoice iapChoice = apPrefs->IAPPreference( KMailSettingsIapPreferenceNumber ); |
|
904 iapId = iapChoice.iIAP; |
|
905 } |
|
906 else if( apPrefs->SNAPDefined() ) |
|
907 { |
|
908 iapId = apPrefs->SNAPPreference(); |
|
909 } |
|
910 else |
|
911 { |
|
912 iapId = 0; |
|
913 } |
|
914 |
902 |
915 |
903 // if iapId is 0, assume default connection |
916 // if iapId is 0, assume default connection |
904 // else the iapId points to the actual iap |
917 // else the iapId points to the actual iap |
905 if( iapId == 0 ) |
918 if( iapId == 0 ) |
906 { |
919 { |
907 // Default Connection is in use |
920 // Default Connection is in use |
908 TCmDefConnValue defConSetting; |
921 TCmDefConnValue defConSetting; |
909 iCmManager.ReadDefConnL( defConSetting ); |
922 iCmManager.ReadDefConnL( defConSetting ); |
910 if( defConSetting.iType == ECmDefConnAlwaysAsk || |
923 if( defConSetting.iType == ECmDefConnAlwaysAsk || |
911 defConSetting.iType == ECmDefConnAskOnce ) |
924 defConSetting.iType == ECmDefConnAskOnce ) |
912 { |
925 { |
913 // always ask not supported in always online plugin |
926 // always ask not supported in always online plugin |
914 User::Leave( KErrNotSupported ); |
927 User::Leave( KErrNotSupported ); |
915 } |
928 } |
916 else |
929 else |
917 { |
930 { |
918 iapId = defConSetting.iId; |
931 iapId = defConSetting.iId; |