--- a/email/pop3andsmtpmtm/servermtmutils/src/imutcon.cpp Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/servermtmutils/src/imutcon.cpp Tue Oct 19 11:30:16 2010 +0530
@@ -17,7 +17,9 @@
#include <commsdat.h>
#include <commsdattypesv1_1.h>
-#include <commdbconnpref.h>
+#include <connpref.h>
+#include <extendedconnpref.h>
+
#include <miut_err.h>
#include <es_enum.h> // For TConnectionInfo
#include <imutcon.h>
@@ -95,14 +97,36 @@
void CImConnect::ConnectWithSNAP()
{
- TConnSnapPref snapPref(iIAPPreferences.SNAPPreference());
- iConn.Start(snapPref, iStatus);
+ // Create connection preferences
+ TConnPrefList prefList;
+ TExtendedConnPref prefs;
+
+ prefs.SetSnapPurpose( CMManager::ESnapPurposeInternet );
+ if(iIsSilentConn)
+ {
+ prefs.SetNoteBehaviour( TExtendedConnPref::ENoteBehaviourConnSilent );
+ }
+ prefs.SetSnapId(iIAPPreferences.SNAPPreference());
+ prefList.AppendL( &prefs );
+
+ // Start a connection with connection preferences
+ iConn.Start( prefList, iStatus );
}
void CImConnect::ConnectWithIAPListL()
{
TInt iapCount=iIAPPreferences.NumberOfIAPs();
+ // Create connection preferences
+ TConnPrefList prefList;
+ TExtendedConnPref prefs;
+ prefs.SetSnapPurpose( CMManager::ESnapPurposeInternet );
+ if(iIsSilentConn)
+ {
+ prefs.SetNoteBehaviour( TExtendedConnPref::ENoteBehaviourConnSilent );
+ }
+
+
if(iapCount==0)
{
#ifdef __IMSK_LOGGING
@@ -112,7 +136,9 @@
iTextSession->LogText(KImConDefault);
}
#endif
- iConn.Start(iStatus);
+ prefList.AppendL( &prefs );
+ // Start a connection with connection preferences
+ iConn.Start( prefList, iStatus );
}
else
{
@@ -141,32 +167,11 @@
}
#endif
- TInt rank=1;
-#ifdef __IMSK_SIMULATION
- for(TInt i=iIAPsToFail;i<iapCount;i++)
-#else
- for(TInt i=0;i<iapCount;i++)
-#endif
- {
- TCommDbConnPref pref;
- pref.SetDirection(ECommDbConnectionDirectionOutgoing);
-
- // legacy code which restricted the type of bearer
- pref.SetBearerSet(KCommDbBearerCSD | KCommDbBearerWcdma | KCommDbBearerLAN |
- KCommDbBearerVirtual | KCommDbBearerPAN | KCommDbBearerWLAN);
+ TImIAPChoice iapChoice = iIAPPreferences.IAPPreference(0);
- TImIAPChoice iapChoice = iIAPPreferences.IAPPreference(i);
-
- pref.SetIapId(iapChoice.iIAP);
- pref.SetDialogPreference(iapChoice.iDialogPref);
-
- User::LeaveIfError(iPrefs.SetPreference(rank, pref));
-
- rank++;
- }
-
- iPrefs.SetConnectionAttempts(rank-1);
- iConn.Start(iPrefs, iStatus);
+ prefs.SetIapId(iapChoice.iIAP);
+ prefList.AppendL( &prefs );
+ iConn.Start(prefList, iStatus);
}
}