syncmlfw/dm/provisioningadapter/src/NSmlDmProvisioningAdapter.cpp
branchRCL_3
changeset 34 696f5dd11939
parent 0 b497e44ab2fc
child 61 b183ec05bd8c
equal deleted inserted replaced
30:2de6635c154b 34:696f5dd11939
    57 // CNSmlDmProvisioningAdapter::ConstructL
    57 // CNSmlDmProvisioningAdapter::ConstructL
    58 // Symbian 2nd phase constructor can leave.
    58 // Symbian 2nd phase constructor can leave.
    59 // -----------------------------------------------------------------------------
    59 // -----------------------------------------------------------------------------
    60 void CNSmlDmProvisioningAdapter::ConstructL()
    60 void CNSmlDmProvisioningAdapter::ConstructL()
    61 	{
    61 	{
       
    62     iLock = EFalse;
    62 	iSession.OpenL();
    63 	iSession.OpenL();
    63 	FeatureManager::InitializeLibL();
    64 	FeatureManager::InitializeLibL();
    64 	}
    65 	}
    65 
    66 
    66 // -----------------------------------------------------------------------------
    67 // -----------------------------------------------------------------------------
   215 		{
   216 		{
   216 		profile.OpenL(iSession, ProfileId , ESmlOpenReadWrite );	
   217 		profile.OpenL(iSession, ProfileId , ESmlOpenReadWrite );	
   217 		TInt isprofilelocked=profile.ProfileLocked(EFalse, EFalse);
   218 		TInt isprofilelocked=profile.ProfileLocked(EFalse, EFalse);
   218 		if (isprofilelocked == 1)
   219 		if (isprofilelocked == 1)
   219 		 {
   220 		 {
   220 		  
   221             profile.ProfileLocked(ETrue, EFalse);
   221       profile.Close(); 
   222             iLock = ETrue;	 	
   222       User::Leave(KErrAccessDenied); 	 	
       
   223 		 }
   223 		 }
   224 		
   224 		
   225 		}
   225 		}
   226 	else
   226 	else
   227 		{
   227 		{
   257 	    {	    
   257 	    {	    
   258 	    profile.SetPasswordL( iProfiles[aItem]->iPassword->Des() );    
   258 	    profile.SetPasswordL( iProfiles[aItem]->iPassword->Des() );    
   259 	    }
   259 	    }
   260 		    
   260 		    
   261 	// creates profile -> must be done before opening the connection
   261 	// creates profile -> must be done before opening the connection
       
   262 
       
   263 	
       
   264 	if(iLock)
       
   265 	    {
       
   266       profile.ProfileLocked(ETrue, ETrue);
       
   267       iLock = EFalse;
       
   268 	    }
       
   269 	    
   262 	profile.UpdateL();
   270 	profile.UpdateL();
   263 	
   271 	
   264 	RSyncMLConnection connection;
   272 	RSyncMLConnection connection;
   265 	connection.OpenL( profile, KUidNSmlMediumTypeInternet.iUid );
   273 	connection.OpenL( profile, KUidNSmlMediumTypeInternet.iUid );
   266 	CleanupClosePushL( connection );
   274 	CleanupClosePushL( connection );
   424 		}
   432 		}
   425 	    CleanupStack::PopAndDestroy(); //privateApi
   433 	    CleanupStack::PopAndDestroy(); //privateApi
   426 	    
   434 	    
   427 	    CleanupStack::PopAndDestroy(alertMessage);	    
   435 	    CleanupStack::PopAndDestroy(alertMessage);	    
   428 	    }
   436 	    }
   429 
   437 	    
   430 	CleanupStack::PopAndDestroy( &profile );
   438 	CleanupStack::PopAndDestroy( &profile );
   431 
   439 
   432 	_DBG_FILE("CNSmlDmProvisioningAdapter::SaveL(): end");
   440 	_DBG_FILE("CNSmlDmProvisioningAdapter::SaveL(): end");
   433 	}
   441 	}
   434 
   442