phoneengine/loghandling/src/cpelogevent.cpp
branchRCL_3
changeset 3 8871b09be73b
parent 0 5f000ab63145
child 10 ba54057fe027
equal deleted inserted replaced
2:c84cf270c54f 3:8871b09be73b
   671         const CPELogInfo& aLogInfo )
   671         const CPELogInfo& aLogInfo )
   672     {
   672     {
   673     if ( KNullDesC() != aLogInfo.PhoneNumber() )
   673     if ( KNullDesC() != aLogInfo.PhoneNumber() )
   674         {
   674         {
   675         aEvent.SetNumber( aLogInfo.PhoneNumber() );
   675         aEvent.SetNumber( aLogInfo.PhoneNumber() );
       
   676        
       
   677         if ( CPELogInfo::EPEVoIPEvent == aLogInfo.EventType() )
       
   678             {
       
   679             TRAPD( error, RemoveTagFromDataFieldL( KLogsDataFldTag_URL ) );
       
   680             if( error )
       
   681                 {
       
   682                 TEFLOGSTRING2( KTAERROR, 
       
   683                     "LOG CPELogEvent::SetRemoteContact()>RemoveTagFromDataFieldL(), error=%d", error )
       
   684                 }
       
   685             }
   676         }
   686         }
   677     
   687     
   678     if ( KNullDesC() != aLogInfo.VoipAddress() )
   688     if ( KNullDesC() != aLogInfo.VoipAddress() )
   679         {
   689         {
   680         TRAPD( error, SetDataFieldL( KLogsDataFldTag_URL, aLogInfo.VoipAddress() ) );
   690         TRAPD( error, SetDataFieldL( KLogsDataFldTag_URL, aLogInfo.VoipAddress() ) );
   681         if ( error )
   691         if ( error )
   682             {
   692             {
   683             TEFLOGSTRING2( KTAERROR, 
   693             TEFLOGSTRING2( KTAERROR, 
   684                 "LOG CPELogEvent::SetLogEvent()>SetDataFieldL(), error=%d", error )
   694                 "LOG CPELogEvent::SetRemoteContact()>SetDataFieldL(), error=%d", error )
   685             }
   695             }
       
   696         aEvent.SetNumber( KNullDesC() );
       
   697         }
       
   698     }
       
   699 
       
   700 // -----------------------------------------------------------------------------
       
   701 // CPELogEvent::RemoveTagFromDataFieldL
       
   702 // -----------------------------------------------------------------------------
       
   703 //
       
   704 void CPELogEvent::RemoveTagFromDataFieldL( const TDesC8& aTag )
       
   705     {
       
   706     __ASSERT_ALWAYS( aTag.Length() != 0 ,
       
   707         User::Leave( KErrArgument ) );
       
   708 
       
   709     TInt index = iEvent->Data().Find( aTag );
       
   710     if ( KErrNotFound != index  )
       
   711         {
       
   712         HBufC8* eventData = iEvent->Data().AllocLC();
       
   713         TPtrC8 urlData = eventData->Mid( index );
       
   714         TInt otherTag = urlData.Find( KLogsDataFldNameDelimiter );
       
   715        
       
   716         const TInt dlLen = KLogsDataFldNameDelimiter().Length();
       
   717         if ( KErrNotFound == otherTag )
       
   718             {
       
   719             eventData->Des().Delete( index - dlLen, urlData.Length() + dlLen );
       
   720             }
       
   721         else
       
   722             {
       
   723             eventData->Des().Delete( index - dlLen, otherTag );
       
   724             }
       
   725         iEvent->SetDataL( *eventData );
       
   726 
       
   727         CleanupStack::PopAndDestroy( eventData );
   686         }
   728         }
   687     }
   729     }
   688 
   730 
   689 
   731 
   690 // ================= OTHER EXPORTED FUNCTIONS ===============================
   732 // ================= OTHER EXPORTED FUNCTIONS ===============================