omadm/omadmextensions/adapters/syncmlds/src/NSmlDsSettingsAdapter.cpp
changeset 2 a5fecba4b1e4
parent 0 3ce708148e4d
equal deleted inserted replaced
1:4490afcb47b1 2:a5fecba4b1e4
   939 		_DBG_FILE("CNSmlDSSettingsAdapter::AddNodeObjectL(): EAlreadyExists end");
   939 		_DBG_FILE("CNSmlDSSettingsAdapter::AddNodeObjectL(): EAlreadyExists end");
   940 		return;
   940 		return;
   941 		}
   941 		}
   942 	else
   942 	else
   943 		{
   943 		{
       
   944 		if( aParentLUID.Length() > 0 )
       
   945 		{		
       
   946 			TInt ret = iCallBack->RemoveMappingL(KNSmlDSSettingsAdapterImplUid,
       
   947 						GetDynamicDSNodeUri( aURI ), ETrue );
       
   948 			if(ret)
       
   949 				{
       
   950 				iCallBack->SetStatusL( aStatusRef, CSmlDmAdapter::EError );
       
   951 				return;
       
   952 				}
       
   953 		}		
   944         //
   954         //
   945         //	Create new profile
   955         //	Create new profile
   946         //
   956         //
   947    	    TInt newPID = -1;
   957    	    TInt newPID = -1;
   948         TInt sRet = CreateNewProfileL( newPID );
   958         TInt sRet = CreateNewProfileL( newPID );
  3815     			}
  3825     			}
  3816 	    	
  3826 	    	
  3817          CleanupStack::PopAndDestroy( 1 );//profileIdArray
  3827          CleanupStack::PopAndDestroy( 1 );//profileIdArray
  3818         return profileID;
  3828         return profileID;
  3819 }
  3829 }
       
  3830 
       
  3831 //------------------------------------------------------------------------------
       
  3832 // TPtrC8 CUtils::GetDynamicDSNodeUri( const TDesC8& aURI )
       
  3833 // returns Syncml/DSAcc/xxx URI
       
  3834 //------------------------------------------------------------------------------
       
  3835 TPtrC8 CNSmlDSSettingsAdapter::GetDynamicDSNodeUri(const TDesC8& aURI)
       
  3836     {    
       
  3837     TInt i= 0;
       
  3838     TBuf8<50> DsAccRoot(KDSAcc1);
       
  3839     for ( i = aURI.Find( KDSAcc1 ) + DsAccRoot.Length() + 1 ; i < aURI.Length(); i++ )
       
  3840         {
       
  3841         if( aURI[i] == '/'  )            
       
  3842 			{            break;            
       
  3843 			}
       
  3844         }    
       
  3845 		
       
  3846     return aURI.Left( i );
       
  3847     }
       
  3848 	
  3820 // End of File
  3849 // End of File
  3821 
  3850