equal
deleted
inserted
replaced
19 |
19 |
20 // INCLUDE FILES |
20 // INCLUDE FILES |
21 #include <centralrepository.h> |
21 #include <centralrepository.h> |
22 #include <msvids.h> |
22 #include <msvids.h> |
23 #include <msvapi.h> |
23 #include <msvapi.h> |
24 #include <messaginginternalcrkeys.h> |
24 #include <MessagingInternalCRKeys.h> |
25 |
25 |
26 // USERINCLUDE FILES |
26 // USERINCLUDE FILES |
27 #include "mmssettings.h" |
27 #include "mmssettings.h" |
28 #include "mmsconst.h" |
28 #include "mmsconst.h" |
29 #include "mmserrors.h" |
29 #include "mmserrors.h" |
136 iNotificationFolderId = KMsvNullIndexEntryId; |
136 iNotificationFolderId = KMsvNullIndexEntryId; |
137 iMMBoxFolderId = KMsvNullIndexEntryId; |
137 iMMBoxFolderId = KMsvNullIndexEntryId; |
138 iApplicationFolderId = KMsvNullIndexEntryId; |
138 iApplicationFolderId = KMsvNullIndexEntryId; |
139 iAccesspointArray.Reset(); |
139 iAccesspointArray.Reset(); |
140 iReceivingModeHome = EMmsReceivingAutomatic; |
140 iReceivingModeHome = EMmsReceivingAutomatic; |
141 iReceivingModeForeign = EMmsReceivingManual; |
141 iReceivingModeForeign = EMmsReceivingAutomatic; |
142 iAcceptPersonal = ETrue; |
142 iAcceptPersonal = ETrue; |
143 iAcceptAdvertisement = ETrue; |
143 iAcceptAdvertisement = ETrue; |
144 iAcceptInformational = ETrue; |
144 iAcceptInformational = ETrue; |
145 iAcceptAnonymous = ETrue; |
145 iAcceptAnonymous = ETrue; |
146 iDeliveryReportWanted = KMmsNo; |
146 iDeliveryReportWanted = KMmsNo; |
344 if ( retval == KErrNotFound ) |
344 if ( retval == KErrNotFound ) |
345 { |
345 { |
346 SaveSetting( KMmsEngineAccessPointCount, 0 ); |
346 SaveSetting( KMmsEngineAccessPointCount, 0 ); |
347 } |
347 } |
348 LOG2(_L("- Loading AP array of length %d"), arrayLength ); |
348 LOG2(_L("- Loading AP array of length %d"), arrayLength ); |
349 for( TInt index = 0; index < arrayLength; index++ ) |
349 for( TInt index = 0; index < arrayLength; ++index ) |
350 { |
350 { |
351 retval = iMmsRepository->Get( KMmsAccesspointArrayBase + index, value ) ; |
351 retval = iMmsRepository->Get( KMmsAccesspointArrayBase + index, value ) ; |
352 if ( retval == KErrNone ) |
352 if ( retval == KErrNone ) |
353 { |
353 { |
354 // If we are out of memory, appending the element may fail. |
354 // If we are out of memory, appending the element may fail. |
489 // Compare array lengths in CenRep and in memory |
489 // Compare array lengths in CenRep and in memory |
490 TInt origCRArrayCount = 0; |
490 TInt origCRArrayCount = 0; |
491 User::LeaveIfError( iMmsRepository->Get( KMmsEngineAccessPointCount, origCRArrayCount ) ); |
491 User::LeaveIfError( iMmsRepository->Get( KMmsEngineAccessPointCount, origCRArrayCount ) ); |
492 TInt localArrayCount = iAccesspointArray.Count(); |
492 TInt localArrayCount = iAccesspointArray.Count(); |
493 // If CenRep array is longer -> delete extra elements from it |
493 // If CenRep array is longer -> delete extra elements from it |
494 for( TInt index = localArrayCount; index < origCRArrayCount; index++ ) |
494 for( TInt index = localArrayCount; index < origCRArrayCount; ++index ) |
495 { |
495 { |
496 LOG(_L("- deleting extra element from CenRep")); |
496 LOG(_L("- deleting extra element from CenRep")); |
497 iMmsRepository->Delete( KMmsAccesspointArrayBase + index ); |
497 iMmsRepository->Delete( KMmsAccesspointArrayBase + index ); |
498 } |
498 } |
499 |
499 |
503 // Save new array length to CenRep |
503 // Save new array length to CenRep |
504 LOG2(_L("- saving AP array of length (%d)"), localArrayCount ); |
504 LOG2(_L("- saving AP array of length (%d)"), localArrayCount ); |
505 SaveSetting( KMmsEngineAccessPointCount, localArrayCount ); |
505 SaveSetting( KMmsEngineAccessPointCount, localArrayCount ); |
506 |
506 |
507 // Save the array itself |
507 // Save the array itself |
508 for( TInt index = 0; index < localArrayCount; index++ ) |
508 for( TInt index = 0; index < localArrayCount; ++index ) |
509 { |
509 { |
510 SaveSetting( KMmsAccesspointArrayBase + index, (TInt)iAccesspointArray[ index ] ); |
510 SaveSetting( KMmsAccesspointArrayBase + index, (TInt)iAccesspointArray[ index ] ); |
511 LOG3(_L("- saved array[%d] with value %d"), index, iAccesspointArray[ index ]); |
511 LOG3(_L("- saved array[%d] with value %d"), index, iAccesspointArray[ index ]); |
512 } |
512 } |
513 } |
513 } |
594 { |
594 { |
595 |
595 |
596 // Accesspoint array is checked by CMmsConnectionInitiator |
596 // Accesspoint array is checked by CMmsConnectionInitiator |
597 // All defined accesspoints should contain proper values in CommDb |
597 // All defined accesspoints should contain proper values in CommDb |
598 |
598 |
599 for( TInt index = 0; index < iAccesspointArray.Count(); index++ ) |
599 for( TInt index = 0; index < iAccesspointArray.Count(); ++index ) |
600 { |
600 { |
601 TUint32 ap = 0; |
601 TUint32 ap = 0; |
602 HBufC* serverUri = NULL; |
602 HBufC* serverUri = NULL; |
603 HBufC8* proxyAddress = NULL; |
603 HBufC8* proxyAddress = NULL; |
604 TBool proxyInUse = EFalse; |
604 TBool proxyInUse = EFalse; |
706 LOG(_L("- index too big, adjusting..")); |
706 LOG(_L("- index too big, adjusting..")); |
707 aIndex = count; |
707 aIndex = count; |
708 } |
708 } |
709 |
709 |
710 // If the same reference already exists, ignore adding and just return |
710 // If the same reference already exists, ignore adding and just return |
711 for(TInt index = 0; index < count; index++ ) |
711 for(TInt index = 0; index < count; ++index ) |
712 { |
712 { |
713 if( iAccesspointArray[ index ] == aAccessPointId ) |
713 if( iAccesspointArray[ index ] == aAccessPointId ) |
714 { |
714 { |
715 LOG(_L("- reference already in the array, not adding.")); |
715 LOG(_L("- reference already in the array, not adding.")); |
716 return; |
716 return; |