telephonyserverplugins/common_tsy/commontsy/src/mmstorage/cmmphonebookstoretsy.cpp
branchRCL_3
changeset 8 3f227a47ad75
parent 7 fe8b59ab9fa0
child 9 2492a6e4aed7
equal deleted inserted replaced
7:fe8b59ab9fa0 8:3f227a47ad75
   658         // Set data got from phonebook initialization
   658         // Set data got from phonebook initialization
   659         *iStoreInfoData = *pbInitResp;
   659         *iStoreInfoData = *pbInitResp;
   660         // Reset initialization value
   660         // Reset initialization value
   661         iStoreInfoData->iIsPhonebookInitialized = ETrue;
   661         iStoreInfoData->iIsPhonebookInitialized = ETrue;
   662         iStoreInfoData->iIsPhonebookInitializeFailed = EFalse;
   662         iStoreInfoData->iIsPhonebookInitializeFailed = EFalse;
   663         // Set initialization flag for all phonebooks
   663         iIsPBInitCompleted = ETrue;
   664         for( TInt i = 0; i < iMmPhoneTsy->PBList()->GetNumberOfObjects(); i++ )
   664         iInitError = aResult;
   665             {
   665         SetMaxNameAndNumLenght();
   666             //Get pbStore object
   666         // Just in case here, if cache request has been come
   667             CMmPhoneBookStoreTsy* pbStore = iMmPhoneTsy->PBList()->GetMmPBByIndex( i );
   667         // before initialization is finished.
   668             pbStore->iIsPBInitCompleted = ETrue;
   668         CacheEntriesL();       
   669             pbStore->iInitError = aResult;
   669        }
   670             // Set max name & number length for the current phonebook
       
   671             pbStore->SetMaxNameAndNumLenght();
       
   672             // Just in case here, if cache request has been come
       
   673             // before initialization is finished.
       
   674             pbStore->CacheEntriesL();
       
   675             }
       
   676         }
       
   677     else
   670     else
   678     //Initialisation has failed
   671     //Initialisation has failed
   679         {
   672         {
   680         CMmCustomTsy* mmCustom = iMmPhoneTsy->GetCustomTsy();
   673         CMmCustomTsy* mmCustom = iMmPhoneTsy->GetCustomTsy();
   681 TFLOGSTRING("TSY: CMmPhoneBookStoreTsy::CompletePBStoreInitializationL has failed" );
   674 TFLOGSTRING("TSY: CMmPhoneBookStoreTsy::CompletePBStoreInitializationL has failed" );
   697 
   690 
   698             // Initializing should be tried again later
   691             // Initializing should be tried again later
   699             iStoreInfoData->iIsPhonebookInitializeFailed = ETrue;
   692             iStoreInfoData->iIsPhonebookInitializeFailed = ETrue;
   700             }
   693             }
   701         }
   694         }
   702 		if( iStoreInfoData->iIsPhonebookInitialized )
   695     
       
   696     
       
   697 	if( iStoreInfoData->iIsPhonebookInitialized )
       
   698 		{
       
   699 		TTsyReqHandle getInfoHandle =
       
   700 			iTsyReqHandleStore->ResetTsyReqHandle( EMultimodePhoneStoreGetInfo );
       
   701 		if ( EMultimodePhoneBookStoreReqHandleUnknown != getInfoHandle )
   703 			{
   702 			{
   704 		    TTsyReqHandle getInfoHandle =
   703 			iReqHandleType = EMultimodePhoneBookStoreReqHandleUnknown;
   705 				iTsyReqHandleStore->ResetTsyReqHandle( EMultimodePhoneStoreGetInfo );
   704 			RMobilePhoneBookStore::TMobilePhoneBookInfoV1Pckg info(*iPhoneBookInfoChanged);
   706 			if ( EMultimodePhoneBookStoreReqHandleUnknown != getInfoHandle )
   705 			TInt result = GetInfoL(getInfoHandle, &info);
       
   706 			if ( KErrNone != result )
   707 				{
   707 				{
   708 				iReqHandleType = EMultimodePhoneBookStoreReqHandleUnknown;
   708 				ReqCompleted( getInfoHandle, result );
   709 				RMobilePhoneBookStore::TMobilePhoneBookInfoV1Pckg info(*iPhoneBookInfoChanged);
   709 				}
   710 				TInt result = GetInfoL(getInfoHandle, &info);
   710 				// Save request handle
   711 				if ( KErrNone != result )
   711 			if ( EMultimodePhoneBookStoreReqHandleUnknown != iReqHandleType )
   712 					{
   712 				{
   713 					ReqCompleted( getInfoHandle, result );
       
   714 					}
       
   715 					// Save request handle
       
   716 				if ( EMultimodePhoneBookStoreReqHandleUnknown != iReqHandleType )
       
   717 					{
       
   718 #ifdef REQHANDLE_TIMER
   713 #ifdef REQHANDLE_TIMER
   719 					SetTypeOfResponse( iReqHandleType, getInfoHandle );
   714 				SetTypeOfResponse( iReqHandleType, getInfoHandle );
   720 #else
   715 #else
   721 					iTsyReqHandleStore->SetTsyReqHandle( iReqHandleType, getInfoHandle );
   716 				iTsyReqHandleStore->SetTsyReqHandle( iReqHandleType, getInfoHandle );
   722 #endif
   717 #endif
   723 					}
       
   724 				
       
   725 				}
   718 				}
       
   719 			
   726 			}
   720 			}
   727 		iMmPhoneTsy->PhoneBookStoreInitCompleteL(iInitError);
   721 		}
       
   722 	iMmPhoneTsy->PhoneBookStoreInitCompleteL(iInitError);
   728 
   723 
   729     }
   724     }
   730 
   725 
   731 // ---------------------------------------------------------------------------
   726 // ---------------------------------------------------------------------------
   732 // CMmPhoneBookStoreTsy::SetMaxNameAndNumLenght
   727 // CMmPhoneBookStoreTsy::SetMaxNameAndNumLenght