voipplugins/voipadapters/cpvoipadapter/src/CWPVoIPItem.cpp
branchRCL_3
changeset 33 2989b291cac7
parent 28 d38647835c2e
--- a/voipplugins/voipadapters/cpvoipadapter/src/CWPVoIPItem.cpp	Wed Sep 15 12:01:56 2010 +0300
+++ b/voipplugins/voipadapters/cpvoipadapter/src/CWPVoIPItem.cpp	Wed Oct 13 14:20:32 2010 +0300
@@ -18,7 +18,7 @@
 
 // INCLUDE FILES
 #include <e32std.h>
-#include    <wpvoipadapter.rsg>
+#include    <WPVoIPAdapter.rsg>
 #include    <charconv.h>
 #include    <in_sock.h>                // TInetAddr, TSockAddr
 #include    <crcseprofileentry.h>
@@ -73,11 +73,6 @@
 const TUint32 KIMLaunchUid          = 0x200255D0;
 const TInt    KIMSettingsId         = 1;
 
-// Bearer related constants
-const TUint32 KBearerNotSpecified = 0;
-const TUint32 KBearerWlanOnly = 1;
-const TUint32 KBearerCellularOnly = 2;
-
 // Following lines are for enabling debug prints.
 #ifdef _DEBUG
 #define DBG_PRINT(p) RDebug::Print(_L(p))
@@ -882,22 +877,9 @@
             priorityArray.Append( iCodecs[codecIndex]->iPriorityIndex );
             }
         priorityArray.Sort();
-        
-        //delete possible duplicate priority index
-        for ( TInt index = 0; index < priorityArray.Count()-1; ++index )
-            {
-            TInt tmpIndex = index + 1; 
-            while ( tmpIndex < priorityArray.Count() &&
-                    priorityArray[tmpIndex] == priorityArray[index] )
-                {
-                priorityArray.Remove( tmpIndex );
-                }
-            }
-
         RPointerArray<CWPVoIPCodec> tmpArray;
 
-        TInt numberOfPriority = priorityArray.Count();
-        for ( TInt priorityIndex = 0; priorityIndex < numberOfPriority; 
+        for ( TInt priorityIndex = 0; priorityIndex < numberOfCodecs; 
             priorityIndex++ )
             {
             for ( TInt codecIndex = 0; codecIndex < numberOfCodecs; 
@@ -1010,6 +992,13 @@
         cRCSEProfileEntry->iVoIPPluginUID = iVoIPPluginUid;
         }
 
+    // AllowVoIPOverWCDMA
+    if ( KNotSet != iAllowVoIPOverWCDMA )
+        {
+        cRCSEProfileEntry->iAllowVoIPoverWCDMA = 
+            static_cast<VoIPProfileEntry::TOnOff>( iAllowVoIPOverWCDMA );
+        }
+
     // VoIPDigits
     if ( KNotSet != iVoIPDigits )
         {
@@ -1580,7 +1569,6 @@
         CleanupStack::PushL( sipManagedProf ); // CS:4
         sipManagedProf->SetParameter( KSIPSnapId, iSnapId );
         sipManagedProf->SetParameter( KSIPAccessPointId, (TUint32)0 );
-        DBG_PRINT2( "CWPVoIPItem::SavingFinalizedL - SNAP ID (1): %d", iSnapId );
         sipReg->SaveL( *sipManagedProf );
         CleanupStack::PopAndDestroy( sipManagedProf ); // CS:3
         CleanupStack::Pop( sipProf ); // CS:2
@@ -1730,7 +1718,6 @@
                 // Update sip profile to use default snap
                 sipManagedProf->SetParameter( KSIPAccessPointId, (TUint32)0 );
                 sipManagedProf->SetParameter( KSIPSnapId, iSnapId );
-                DBG_PRINT2( "CWPVoIPItem::SavingFinalizedL - SNAP ID (2): %d", iSnapId );
                 sipReg->SaveL( *sipManagedProf );
                 }
             }
@@ -1740,7 +1727,6 @@
         sipProf = NULL;
         // sipReg, sipObs
         CleanupStack::PopAndDestroy( 2, sipObs ); // CS:0
-        sipReg = NULL;
         }
 
     if ( iSnapIdSet )
@@ -1786,51 +1772,6 @@
     DBG_PRINT( "CWPVoIPItem::SavingFinalizedL - \
         Service provider entry updated" );
 
-    DBG_PRINT2( "CWPVoIPItem::SavingFinalizedL - \
-        set allow VoIP over wcdma iAlowVoIPOverWCDMA=%d", iAllowVoIPOverWCDMA );
-    
-    //***********************
-    // Allow VoIP over WCDMA
-    //***********************
-    CSIPProfileRegistryObserver* sipObs = 
-        CSIPProfileRegistryObserver::NewLC(); // CS:1
-    CSIPManagedProfileRegistry* sipReg =
-        CSIPManagedProfileRegistry::NewLC( *sipObs ); // CS:2
-    CSIPProfile* sipProf = NULL;
-    sipProf = sipReg->ProfileL( iSipId );
-    CleanupStack::PushL( sipProf ); // CS:3
-    CSIPManagedProfile* sipManagedProf = 
-        static_cast<CSIPManagedProfile*>( sipProf );
-    CleanupStack::PushL( sipManagedProf ); // CS:4
-        
-    if ( iAllowVoIPOverWCDMA == 1 )
-        {
-        DBG_PRINT( "CWPVoIPItem::SavingFinalizedL - \
-          set bearer not specified" );
-    
-        // If VoIP is allowed over wcdma set bearer type to sip as 
-        // not specified.
-        sipManagedProf->SetParameter( KBearerType, KBearerNotSpecified );
-        }
-    else
-        {
-        DBG_PRINT( "CWPVoIPItem::SavingFinalizedL - \
-            set bearer setting wlan only" );
-    
-        // If not allowed set bearer type to sip as wlan only
-        sipManagedProf->SetParameter( KBearerType, KBearerWlanOnly );
-        }
-    
-    sipReg->SaveL( *sipManagedProf );   
-    CleanupStack::PopAndDestroy( sipManagedProf ); // CS:3
-    CleanupStack::Pop( sipProf ); // CS:2
-    sipProf = NULL;
-    // sipReg, sipObs
-    CleanupStack::PopAndDestroy( 2, sipObs ); // CS:0
-    
-    DBG_PRINT( "CWPVoIPItem::SavingFinalizedL - \
-      bearer settings set" );
-
     // property, spEntry spSettings, cRCSEProfileEntry, cRCSEProfileRegistry
     CleanupStack::PopAndDestroy( 5, cRCSEProfileRegistry ); // CS:0
     iSipIdSet = EFalse;