24 //#include <aplistitemlist.h> // CApListItemList |
24 //#include <aplistitemlist.h> // CApListItemList |
25 //#include <aplistitem.h> // CApListItem |
25 //#include <aplistitem.h> // CApListItem |
26 //</cmail> |
26 //</cmail> |
27 #include <centralrepository.h> // CRepository |
27 #include <centralrepository.h> // CRepository |
28 #include <AlwaysOnlineManagerClient.h> |
28 #include <AlwaysOnlineManagerClient.h> |
|
29 #include <cmdestination.h> |
29 |
30 |
30 #include "ipssetwizardadapter.h" |
31 #include "ipssetwizardadapter.h" |
31 #include "ipssetdatamanager.h" |
32 #include "ipssetdatamanager.h" |
32 #include "ipssetuiitemaccesspoint.h" |
33 #include "ipssetuiitemaccesspoint.h" |
33 #include "ipssetutils.h" |
34 #include "ipssetutils.h" |
412 //</cmail> |
413 //</cmail> |
413 aSetData.SetMailboxName( CheckMailboxNamesL( iMailboxName ) ); |
414 aSetData.SetMailboxName( CheckMailboxNamesL( iMailboxName ) ); |
414 aSetData.SetUserAuthentication( CIpsSetData::EUseIncoming ); |
415 aSetData.SetUserAuthentication( CIpsSetData::EUseIncoming ); |
415 |
416 |
416 iap = SetIAPByNameL( iRecomendedAP ); |
417 iap = SetIAPByNameL( iRecomendedAP ); |
417 aSetData.SetIapL( iap, iap ); |
418 |
|
419 TBool setIAP = ETrue; |
|
420 //if IAP isn't set by SettingWizard, we try to get the SNAP. |
|
421 if ( iap.iIAP <= 0 ) |
|
422 { |
|
423 //Use SNAP when we got it and it does contain access point. |
|
424 //For other situations as below, we set 'ask when need' or default IAP |
|
425 //1. defConnValue.iType == ECmDefConnAskOnce |
|
426 //2. Got SNAP, but it does not contain any acess point |
|
427 //3. Got default IAP when defConnValue.iType == ECmDefConnConnectionMethod |
|
428 iap.iDialogPref = ECommDbDialogPrefPrompt; |
|
429 iap.iIAP = 0; |
|
430 |
|
431 RCmManager cmmgr; |
|
432 cmmgr.OpenLC(); |
|
433 TCmDefConnValue defConnValue; |
|
434 cmmgr.ReadDefConnL( defConnValue ); |
|
435 //Check default connection is destination or connection method |
|
436 if ( defConnValue.iType == ECmDefConnDestination ) |
|
437 { |
|
438 //Get SNAP from cmmgr |
|
439 RCmDestination destination; |
|
440 CleanupClosePushL( destination ); |
|
441 destination = cmmgr.DestinationL( defConnValue.iId ); |
|
442 //check if SNAP has IAPs |
|
443 if ( destination.ConnectionMethodCount() > 0 ) |
|
444 { |
|
445 //if SNAP contain access point, we use SNAP |
|
446 CImIAPPreferences* iapPref = CImIAPPreferences::NewLC(); |
|
447 iapPref->SetSNAPL( defConnValue.iId ); |
|
448 |
|
449 aSetData.SetIapL( *iapPref, *iapPref ); |
|
450 CleanupStack::PopAndDestroy( iapPref ); |
|
451 |
|
452 setIAP = EFalse; |
|
453 } |
|
454 CleanupStack::PopAndDestroy( &destination ); |
|
455 } |
|
456 else if( defConnValue.iType == ECmDefConnConnectionMethod ) |
|
457 { |
|
458 iap.iDialogPref = ECommDbDialogPrefDoNotPrompt; |
|
459 iap.iIAP = defConnValue.iId; |
|
460 } |
|
461 CleanupStack::PopAndDestroy( &cmmgr ); |
|
462 } |
|
463 //If no valid IAP or destination, set zero. |
|
464 if ( setIAP ) |
|
465 { |
|
466 aSetData.SetIapL( iap, iap ); |
|
467 } |
418 // EIpsSetDataOutSecurityAuth |
468 // EIpsSetDataOutSecurityAuth |
419 // EIpsSetDataOutSecurityAuth |
469 // EIpsSetDataOutSecurityAuth |
420 } |
470 } |
421 |
471 |
422 // --------------------------------------------------------------------------- |
472 // --------------------------------------------------------------------------- |