phoneengine/loghandling/src/cpeloghandling.cpp
changeset 76 cfea66083b62
parent 37 ba76fc04e6c2
equal deleted inserted replaced
74:d1c62c765e48 76:cfea66083b62
    30 #include <talogger.h>
    30 #include <talogger.h>
    31 #include <logcli.h>
    31 #include <logcli.h>
    32 #include <pepanic.pan>
    32 #include <pepanic.pan>
    33 #include <mpephonemodelinternal.h>
    33 #include <mpephonemodelinternal.h>
    34 #include <mpedatastore.h>
    34 #include <mpedatastore.h>
       
    35 #include <hbtextresolversymbian.h>
    35 #include "cpeloginfo.h"
    36 #include "cpeloginfo.h"
    36 #include "cpelogextensionwrapper.h"
    37 #include "cpelogextensionwrapper.h"
    37 
    38 
    38 // EXTERNAL DATA STRUCTURES
    39 // EXTERNAL DATA STRUCTURES
    39 // None
    40 // None
    40 
    41 
    41 // EXTERNAL FUNCTION PROTOTYPES  
    42 // EXTERNAL FUNCTION PROTOTYPES  
    42 /// None
    43 /// None
    43 
    44 
    44 // CONSTANTS
    45 // CONSTANTS
    45 // None
    46 _LIT(KEmergencyText, "txt_phone_other_emergency_call");
       
    47 _LIT(KPhoneLocalisationFile, "telephone_");
       
    48 _LIT(KTsFilePath, "z:/resource/qt/translations/");
    46 
    49 
    47 // MACROS
    50 // MACROS
    48 // None
    51 // None
    49 
    52 
    50 // LOCAL CONSTANTS AND MACROS
    53 // LOCAL CONSTANTS AND MACROS
   115         ( 
   118         ( 
   116         MPEPhoneModelInternal& aModel,
   119         MPEPhoneModelInternal& aModel,
   117         RFs& aFsSession        
   120         RFs& aFsSession        
   118         ) : iModel( aModel ),
   121         ) : iModel( aModel ),
   119             iDataStore( *( aModel.DataStore( ) ) ),
   122             iDataStore( *( aModel.DataStore( ) ) ),
   120             iFsSession( aFsSession ),
   123             iFsSession( aFsSession )
   121             iLogEventUnderProcessing( NULL )
       
   122     {
   124     {
   123     TEFLOGSTRING( KTAOBJECT, "LOG CPELogHandling::CPELogHandling" );
   125     TEFLOGSTRING( KTAOBJECT, "LOG CPELogHandling::CPELogHandling" );
   124     }
   126     }
   125 
   127 
   126 // -----------------------------------------------------------------------------
   128 // -----------------------------------------------------------------------------
   207                     CleanupStack::Pop( buf );
   209                     CleanupStack::Pop( buf );
   208                     }
   210                     }
   209                 // default logging strategy is used if error happens while using extension
   211                 // default logging strategy is used if error happens while using extension
   210                 UpdateLogInfoWithExtensionDataL( aCallId, *logInfo ) );
   212                 UpdateLogInfoWithExtensionDataL( aCallId, *logInfo ) );
   211             
   213             
       
   214             if ( CPELogInfo::EPEEmergecyEvent == logInfo->EventType() )
       
   215                 {
       
   216                 SetEmergencyCallName( *logInfo );
       
   217                 }
       
   218             
   212             TRAP( errorCode, SaveCallInfoL( *logInfo ) );
   219             TRAP( errorCode, SaveCallInfoL( *logInfo ) );
   213             delete logInfo;
   220             delete logInfo;
   214             }
   221             }
   215         
   222         
   216         if( errorCode != KErrNone )
   223         if( errorCode != KErrNone )
   839         const TUid& aPluginUid ) const
   846         const TUid& aPluginUid ) const
   840     {
   847     {
   841     return CPELogExtensionWrapper::NewLC( aPluginUid );
   848     return CPELogExtensionWrapper::NewLC( aPluginUid );
   842     }
   849     }
   843 
   850 
       
   851 // -----------------------------------------------------------------------------
       
   852 // CPELogHandling::SetEmergencyCallName
       
   853 // -----------------------------------------------------------------------------
       
   854 //
       
   855 void CPELogHandling::SetEmergencyCallName( CPELogInfo& aLogInfo )
       
   856     {
       
   857     HBufC* emergencyText = NULL;
       
   858 
       
   859     if ( HbTextResolverSymbian::Init( KPhoneLocalisationFile, KTsFilePath) )
       
   860         {
       
   861         TRAP_IGNORE( emergencyText = 
       
   862                 HbTextResolverSymbian::LoadL(KEmergencyText) );
       
   863         }
       
   864     
       
   865     if ( emergencyText )
       
   866         {
       
   867         aLogInfo.SetName( emergencyText->Des().
       
   868                 Left( Min(emergencyText->Length(), KCntMaxTextFieldLength) ) );
       
   869         }
       
   870     }
       
   871 
   844 // End of File
   872 // End of File