phonebookengines/VirtualPhonebook/VPbkSimStore/src/CContactStore.cpp
branchRCL_3
changeset 85 38bb213f60ba
parent 63 f4a778e096c2
equal deleted inserted replaced
74:6b5524b4f673 85:38bb213f60ba
    46 #include <CVPbkContactStoreProperties.h>
    46 #include <CVPbkContactStoreProperties.h>
    47 #include <VPbkError.h>
    47 #include <VPbkError.h>
    48 #include <VPbkSimStoreTemplateFunctions.h>
    48 #include <VPbkSimStoreTemplateFunctions.h>
    49 #include <CVPbkAsyncCallback.h>
    49 #include <CVPbkAsyncCallback.h>
    50 
    50 
    51 #include <featmgr.h>  
       
    52 namespace VPbkSimStore {
    51 namespace VPbkSimStore {
    53 
    52 
    54 // LOCAL
    53 // LOCAL
    55 namespace {
    54 namespace {
    56 
    55 
   579 // -----------------------------------------------------------------------------
   578 // -----------------------------------------------------------------------------
   580 //
   579 //
   581 void CContactStore::StoreReady( MVPbkSimCntStore& /*aStore*/ )
   580 void CContactStore::StoreReady( MVPbkSimCntStore& /*aStore*/ )
   582     {
   581     {
   583     TVPbkGsmStoreProperty gsmProperties;
   582     TVPbkGsmStoreProperty gsmProperties;
   584     TInt res = KErrNone;  
   583     TInt res = iNativeStore->GetGsmStoreProperties( gsmProperties );
   585     if( !FeatureManager::FeatureSupported( KFeatureIdFfTdClmcontactreplicationfromphonebooktousimcard ) )
   584 
   586         {
   585     if ( res == KErrNone )
   587         res= iNativeStore->GetGsmStoreProperties( gsmProperties );
   586         {
   588         if ( res == KErrNone )
   587         delete iSupportedFieldTypes;
   589             {
   588         iSupportedFieldTypes = NULL;
   590             delete iSupportedFieldTypes;
   589         TRAP( res, iSupportedFieldTypes = CSupportedFieldTypes::NewL(
   591             iSupportedFieldTypes = NULL;
   590             iStoreDomain.FieldTypeMappings(), gsmProperties ) );
   592             TRAP( res, iSupportedFieldTypes = CSupportedFieldTypes::NewL(
   591         iSimStoreCapabilities = gsmProperties.iCaps;
   593                     iStoreDomain.FieldTypeMappings(), gsmProperties ) );
   592         }
   594                     iSimStoreCapabilities = gsmProperties.iCaps;
   593 
   595             }
       
   596         }
       
   597     else  // if contact replication from phonebook to usim card.
       
   598         {
       
   599         TInt resGsm = iNativeStore->GetGsmStoreProperties( gsmProperties );
       
   600         TVPbkUSimStoreProperty usimProperties;
       
   601         TInt resUsim = iNativeStore->GetUSimStoreProperties( usimProperties );	
       
   602         if( resGsm == KErrNone && resUsim == KErrNone )
       
   603             {
       
   604             delete iSupportedFieldTypes;
       
   605             iSupportedFieldTypes = NULL;
       
   606             TRAP( res, iSupportedFieldTypes = CSupportedFieldTypes::NewL(
       
   607                     iStoreDomain.FieldTypeMappings(), gsmProperties, usimProperties ) ); 
       
   608                     iSimStoreCapabilities = gsmProperties.iCaps;
       
   609             }
       
   610         else
       
   611             {
       
   612             res = ( resGsm != KErrNone ? resGsm : resUsim );
       
   613             }
       
   614         }
       
   615    
       
   616     if ( res != KErrNone )
   594     if ( res != KErrNone )
   617         {
   595         {
   618         iStoreState = EStoreNotAvailable;
   596         iStoreState = EStoreNotAvailable;
   619         VPbkSimStoreImpl::SendObserverMessageRV( iStoreObservers,
   597         VPbkSimStoreImpl::SendObserverMessageRV( iStoreObservers,
   620             &MVPbkContactStoreObserver::StoreUnavailable, *this, res );
   598             &MVPbkContactStoreObserver::StoreUnavailable, *this, res );