convergedconnectionhandler/cchclientapi/src/cchuiconnectionhandler.cpp
branchRCL_3
changeset 11 6134b5029079
parent 9 bddb6d4447db
child 16 df4dfb214df5
equal deleted inserted replaced
10:ed1e38b404e5 11:6134b5029079
     1 /*
     1 /*
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
   429                destination.ConnectionMethodByIDL( connectionId );
   429                destination.ConnectionMethodByIDL( connectionId );
   430            CleanupClosePushL( connectionMethod );
   430            CleanupClosePushL( connectionMethod );
   431            if ( destination.Id() != aDestination.Id() )
   431            if ( destination.Id() != aDestination.Id() )
   432                {
   432                {
   433                CCHUIDEBUG( "Copy existing connection method to destination" );
   433                CCHUIDEBUG( "Copy existing connection method to destination" );
   434                iCmManagerExt.CopyConnectionMethodL(
   434                
   435                    aDestination, connectionMethod );
   435                aDestination.AddConnectionMethodL( 
       
   436                    connectionMethod.CreateCopyL() );
   436                }
   437                }
   437            TRAP_IGNORE( aDestination.ModifyPriorityL( 
   438            TRAP_IGNORE( aDestination.ModifyPriorityL( 
   438                connectionMethod, KCmHighestPriority ) );
   439                connectionMethod, KCmHighestPriority ) );
   439            aDestination.UpdateL();
   440            aDestination.UpdateL();
   440            
   441            
   647         iCmManagerExt.ConnectionMethodL( aSourceIap );       
   648         iCmManagerExt.ConnectionMethodL( aSourceIap );       
   648     CleanupClosePushL( sourceConn );
   649     CleanupClosePushL( sourceConn );
   649     
   650     
   650     TInt conMethodCount = targetSnap.ConnectionMethodCount();
   651     TInt conMethodCount = targetSnap.ConnectionMethodCount();
   651     TUint32 sourceIapId = sourceConn.GetIntAttributeL( CMManager::ECmIapId );
   652     TUint32 sourceIapId = sourceConn.GetIntAttributeL( CMManager::ECmIapId );
   652     TBool matchFound = false;
   653     TBool matchFound( EFalse );
   653     
   654     
   654     for ( TInt ndx = 0 ; ndx < conMethodCount && matchFound == 0; ndx ++ )
   655     for ( TInt ndx = 0 ; ndx < conMethodCount && matchFound == 0; ndx ++ )
   655         {
   656         {
   656         RCmConnectionMethodExt cm = targetSnap.ConnectionMethodL( ndx );
   657         RCmConnectionMethodExt cm = targetSnap.ConnectionMethodL( ndx );
   657         CleanupClosePushL( cm );
   658         CleanupClosePushL( cm );
   658         
   659         
   659         TUint32 targetIapId = cm.GetIntAttributeL( CMManager::ECmIapId );
   660         TUint32 targetIapId = cm.GetIntAttributeL( CMManager::ECmIapId );
   660         
   661         
   661         if( targetIapId == sourceIapId )
   662         if( targetIapId == sourceIapId )
   662             {
   663             {
   663             matchFound =true;
   664             matchFound = ETrue;
   664             }
   665             }
   665         CleanupStack::PopAndDestroy( &cm );
   666         CleanupStack::PopAndDestroy( &cm );
   666         }
   667         }
   667     if( !matchFound )
   668     if( !matchFound )
   668         {
   669         {
   669         CCHUIDEBUG( 
   670         CCHUIDEBUG( 
   670           "CopyIapToServiceSnapL - Get source connection ok -> copy connection");    
   671           "CopyIapToServiceSnapL - Get source connection ok -> add connection");
   671         
   672         
   672         iCmManagerExt.CopyConnectionMethodL( targetSnap, sourceConn );
   673         targetSnap.AddConnectionMethodL( sourceConn.CreateCopyL() );
   673         }
   674         }
   674     CleanupStack::PopAndDestroy( &sourceConn );
   675     CleanupStack::PopAndDestroy( &sourceConn );
   675     CleanupStack::PopAndDestroy( &targetSnap );      
   676     CleanupStack::PopAndDestroy( &targetSnap );      
   676     
   677     
   677     CCHUIDEBUG( "CCchUiConnectionHandler::CopyIapToServiceSnapL - OUT" );
   678     CCHUIDEBUG( "CCchUiConnectionHandler::CopyIapToServiceSnapL - OUT" );