sipplugins/sippsipsettingsui/src/gssipmodel.cpp
branchRCL_3
changeset 6 43c4dec3cb1f
parent 5 532ef74cdfa0
child 19 b5e99d8877c7
equal deleted inserted replaced
5:532ef74cdfa0 6:43c4dec3cb1f
    45 //
    45 //
    46 CGSSIPModel::CGSSIPModel() 
    46 CGSSIPModel::CGSSIPModel() 
    47     {
    47     {
    48     __GSLOGSTRING("CGSSIPModel::CGSSIPModel" )
    48     __GSLOGSTRING("CGSSIPModel::CGSSIPModel" )
    49     iQuitAfterSave = EFalse;
    49     iQuitAfterSave = EFalse;
    50     iIsRegistering = EFalse;
       
    51     }
    50     }
    52 
    51 
    53 // -----------------------------------------------------------------------------
    52 // -----------------------------------------------------------------------------
    54 // CGSSIPModel::ConstructL
    53 // CGSSIPModel::ConstructL
    55 // Symbian 2nd phase constructor can leave.
    54 // Symbian 2nd phase constructor can leave.
   122     TBool moveToNextView = ETrue;
   121     TBool moveToNextView = ETrue;
   123 
   122 
   124     CSIPManagedProfile* profile = 
   123     CSIPManagedProfile* profile = 
   125         static_cast<CSIPManagedProfile*>( iProfiles->At( aIndex ) );
   124         static_cast<CSIPManagedProfile*>( iProfiles->At( aIndex ) );
   126 
   125 
   127     if ( iEngine->IsInUseL( *profile ) || iIsRegistering )
   126     if ( iEngine->IsInUseL( *profile ) )
   128         {
   127         {
   129         HBufC* errorTxt = StringLoader::LoadLC( R_QTN_SIP_ERROR_PROFILE_USED );
   128         HBufC* errorTxt = StringLoader::LoadLC( R_QTN_SIP_ERROR_PROFILE_USED );
   130         CAknErrorNote* note = new ( ELeave ) CAknErrorNote( ETrue );
   129         CAknErrorNote* note = new ( ELeave ) CAknErrorNote( ETrue );
   131         note->ExecuteLD( errorTxt->Des() );
   130         note->ExecuteLD( errorTxt->Des() );
   132         CleanupStack::PopAndDestroy( errorTxt );        
   131         CleanupStack::PopAndDestroy( errorTxt );        
   431 //
   430 //
   432 TBool CGSSIPModel::ErrorInRegistration( TInt aIndex )
   431 TBool CGSSIPModel::ErrorInRegistration( TInt aIndex )
   433     {    
   432     {    
   434     __GSLOGSTRING("CGSSIPModel::ErrorInRegistration" )
   433     __GSLOGSTRING("CGSSIPModel::ErrorInRegistration" )
   435     __GSLOGSTRING1("CGSSIPModel::ErrorInRegistration aIndex: %d", aIndex)
   434     __GSLOGSTRING1("CGSSIPModel::ErrorInRegistration aIndex: %d", aIndex)
   436     
       
   437     if(iEngine->LastRegistrationError( 
       
   438             *( iProfiles->At( aIndex ) ) ) != KErrNone)
       
   439     	{
       
   440             iIsRegistering = EFalse;
       
   441     	}
       
   442     return ( iEngine->LastRegistrationError( 
   435     return ( iEngine->LastRegistrationError( 
   443         *( iProfiles->At( aIndex ) ) ) != KErrNone );
   436         *( iProfiles->At( aIndex ) ) ) != KErrNone );
   444     }
   437     }
   445 
   438 
   446 // -----------------------------------------------------------------------------
   439 // -----------------------------------------------------------------------------
   462         case EProfileUpdated:	
   455         case EProfileUpdated:	
   463             TRAP_IGNORE( ProfileUpdatedL( aSIPProfileId ) )
   456             TRAP_IGNORE( ProfileUpdatedL( aSIPProfileId ) )
   464             break;
   457             break;
   465         case EProfileRegistered:						
   458         case EProfileRegistered:						
   466         case EProfileDeregistered:
   459         case EProfileDeregistered:
   467         	{
       
   468             iIsRegistering = EFalse;
       
   469             ProfileRegistrationStatusChanged( aSIPProfileId );
   460             ProfileRegistrationStatusChanged( aSIPProfileId );
   470             break;
   461             break;
   471         	}
       
   472         case EProfileDestroyed:
   462         case EProfileDestroyed:
   473             ProfileDestroyed( aSIPProfileId );
   463             ProfileDestroyed( aSIPProfileId );
   474             break;
   464             break;
   475         default:
   465         default:
   476             // Do nothing.
   466             // Do nothing.
   758         TInt j( 0 );
   748         TInt j( 0 );
   759         while ( profilePointerArray.Count() > 0 )
   749         while ( profilePointerArray.Count() > 0 )
   760             {
   750             {
   761             CSIPManagedProfile* profile = 
   751             CSIPManagedProfile* profile = 
   762                 static_cast<CSIPManagedProfile*>( profilePointerArray[j] );
   752                 static_cast<CSIPManagedProfile*>( profilePointerArray[j] );
   763              iIsRegistering = EFalse;
       
   764             
       
   765             iProfiles->AppendL( profile );
   753             iProfiles->AppendL( profile );
   766             profilePointerArray.Remove( j );
   754             profilePointerArray.Remove( j );
   767             }                    
   755             }                    
   768         profilePointerArray.Reset();    
   756         profilePointerArray.Reset();    
   769         }
   757         }
   952         {
   940         {
   953         profile = Profile( iProfileData.iID );
   941         profile = Profile( iProfileData.iID );
   954         }
   942         }
   955     
   943     
   956     GSSIPProfileUtil::CopyProfileAttributesL( profile, iProfileData );
   944     GSSIPProfileUtil::CopyProfileAttributesL( profile, iProfileData );
   957     if(iProfileData.iRegistrationMode == EGSAlwaysOn)
       
   958     	{
       
   959         iIsRegistering = ETrue;
       
   960     	}
       
   961     GSSIPProfileUtil::CopyServerAttributesL( 
   945     GSSIPProfileUtil::CopyServerAttributesL( 
   962         profile, KSIPOutboundProxy, iProfileData.iProxy );
   946         profile, KSIPOutboundProxy, iProfileData.iProxy );
   963     GSSIPProfileUtil::CopyServerAttributesL( 
   947     GSSIPProfileUtil::CopyServerAttributesL( 
   964         profile, KSIPRegistrar, iProfileData.iRegistrar );
   948         profile, KSIPRegistrar, iProfileData.iRegistrar );
   965     
   949