satengine/satserver/Engine/src/CSatCommandContainer.cpp
changeset 35 6aefa3341fcc
parent 33 8d5d7fcf9b59
child 51 12bc758d6a02
--- a/satengine/satserver/Engine/src/CSatCommandContainer.cpp	Wed Jul 21 18:26:52 2010 +0300
+++ b/satengine/satserver/Engine/src/CSatCommandContainer.cpp	Fri Jul 23 12:32:49 2010 +0300
@@ -20,12 +20,12 @@
 #include    <f32file.h>
 #include    <barsc.h>
 #include    <bautils.h>
-#include    <SatServer.rsg>
 #include    <ecom.h>
 #include    <e32property.h>
 #include    <data_caging_path_literals.hrh>
 #include    <startupdomainpskeys.h>
 #include    <satdomainpskeys.h>
+#include    <hbtextresolversymbian.h>
 
 #include    "MSatSystemState.h"
 #include    "TSatSystemStateFactory.h"
@@ -52,16 +52,14 @@
 #include    "csatmultimodeapi.h"
 #include    "csatsactivewrapper.h"
 
-// Drive letter for resource file
-_LIT( KResourceDrive, "Z:" );
-// SatServer's resource file
-_LIT( KSatServerRsc, "SatServer.rsc" );
-
+_LIT( KResourceDrive, "z:\\resource\\qt\\translations" );
+_LIT( KSatServerRsc, "satapp_");
+_LIT( KSatLogTitle, "txt_simatk_title_sim_services");
+_LIT( KSatCmccTitle, "txt_simatk_titlw_cmcc_sim_services");
 
 const TUid KSatInterfaceDefinitionUid = { 0x1000f001 };
 const TInt KSizeOfBuf = 50;
 
-const TInt8 KCreateSatAppNamePop( 2 );
 
 // Important plugins UIDs. These are started on startup
 // Implementation UID is from the <plugin>.rss
@@ -395,7 +393,7 @@
         iIsCmccSim = ETrue;
 
         // Update default name read in ConstructL.
-        TRAPD( err, CreateSatAppNameL( R_QTN_SAT_CMCC_TITLE ) );
+        TRAPD( err, CreateSatAppNameL( KSatCmccTitle ) );
         LOG2( NORMAL, "SATENGINE:   Error: %i", err )
         if ( KErrNone == err )
             {
@@ -627,7 +625,7 @@
         {
         LOG( NORMAL,
             "SATENGINE: CSatCommandContainer::RestoreSatAppNameL name reset" )
-        CreateSatAppNameL( R_QTN_SAT_LOG_TITLE );
+        CreateSatAppNameL( KSatLogTitle );
         }
     LOG( NORMAL, "SATENGINE: CSatCommandContainer::RestoreSatAppNameL exiting" )
     }
@@ -902,7 +900,7 @@
     LOG( NORMAL, "SATENGINE: CSatCommandContainer::ConstructL calling" )
 
     iIsCmccSim = EFalse;
-    CreateSatAppNameL( R_QTN_SAT_LOG_TITLE );
+    CreateSatAppNameL( KSatLogTitle );
 
     // Register for ui events in order to keep track if user or command
     // has launched the ui.
@@ -991,52 +989,22 @@
 // (other items were commented in a header).
 // -----------------------------------------------------------------------------
 //
-void CSatCommandContainer::CreateSatAppNameL( const TInt aResourceId )
+void CSatCommandContainer::CreateSatAppNameL( const TDesC& aResourceId )
     {
     LOG( NORMAL, "SATENGINE: CSatCommandContainer::CreateSatAppNameL calling" )
-
-    // Open the RFs session.
-    RFs fs;
-
-    User::LeaveIfError( fs.Connect() );
-
-    // Push close operation in tbe cleanup stack
-    CleanupClosePushL( fs );
-
-    RResourceFile resFile;
-    // Backslashes are already defined in resource file, not needed here.
-    TBuf<KSizeOfBuf> buf( KResourceDrive );
-    buf.Append( KDC_RESOURCE_FILES_DIR );
-    buf.Append( KSatServerRsc );
-
-    TFileName fileName( buf );
-
-    BaflUtils::NearestLanguageFile( fs, fileName );
-
-    // Open the resource file
-    resFile.OpenL( fs, fileName );
+    delete iSatAppName;
+    iSatAppName = NULL;
+    const TBool textResolver = HbTextResolverSymbian::Init( 
+        KSatServerRsc, KResourceDrive );
+    LOG2(NORMAL,"SATENGINE: CSatCommandContainer::\
+        CreateSatAppNameL textResolver = %d", textResolver ) 
+    LOG2(NORMAL,"SATENGINE: CSatCommandContainer::\
+        CreateSatAppNameL aResourceId = %S", &aResourceId )
 
-    // Push close operation in the cleanup stack
-    CleanupClosePushL( resFile );
-
-    resFile.ConfirmSignatureL( ESatSResourceSignature );
-
-    // Reads a resource structure with memory allocation.
-    HBufC8* dataBuffer = resFile.AllocReadLC( aResourceId );
-
-    TResourceReader resReader;
-    resReader.SetBuffer( dataBuffer );
-
-    // Reads a string with memory allocation
-    iSatAppName = resReader.ReadHBufCL();
+    iSatAppName = HbTextResolverSymbian::LoadL( aResourceId );
+    LOG2(NORMAL,"SATENGINE: CSatCommandContainer::\
+        CreateSatAppNameL iSatAppName = %S", iSatAppName )
     iSatBipName.Copy( SatAppName() );
-
-    // dataBuffer
-    CleanupStack::PopAndDestroy( dataBuffer );
-    // resFile, Calls resFile.Close()
-    // fs, Calls fs.Close
-    CleanupStack::PopAndDestroy( KCreateSatAppNamePop );
-
     LOG( NORMAL, "SATENGINE: CSatCommandContainer::CreateSatAppNameL exiting" )
     }