predictivesearch/adapters/contacts/src/cpcscontactstore.cpp
branchRCL_3
changeset 32 2828b4d142c0
parent 21 b3431bff8c19
child 35 4ae315f230bc
equal deleted inserted replaced
26:0d28c1c5b6dd 32:2828b4d142c0
    58 #include "CPcsDebug.h" 
    58 #include "CPcsDebug.h" 
    59 #include "CPcsDefs.h"
    59 #include "CPcsDefs.h"
    60 #include <contactsort.rsg>
    60 #include <contactsort.rsg>
    61 
    61 
    62 // CONSTANTS
    62 // CONSTANTS
       
    63 namespace {
    63 const TInt KSimStoreOffset            = -5000;
    64 const TInt KSimStoreOffset            = -5000;
       
    65 const TInt KTimerInterval             = 100000;   // 100 milliseconds
    64 
    66 
    65 _LIT(KResourceFileName, "contactsort.rsc");
    67 _LIT(KResourceFileName, "contactsort.rsc");
    66 _LIT(KPcsViewPrefix,"PCSView_");
    68 _LIT(KPcsViewPrefix,"PCSView_");
    67 
    69 }
    68 // FORWARD DECLARATION
    70 // FORWARD DECLARATION
    69 
    71 
    70 // ============================== MEMBER FUNCTIONS ================================
    72 // ============================== MEMBER FUNCTIONS ================================
    71 
    73 
    72 // ---------------------------------------------------------------------------------
    74 // ---------------------------------------------------------------------------------
   316 	}
   318 	}
   317 	else if ( (iFetchedContactCount % KLinksToFetchInOneGo) == 0 )
   319 	else if ( (iFetchedContactCount % KLinksToFetchInOneGo) == 0 )
   318 	{
   320 	{
   319 	    // Fetch next block
   321 	    // Fetch next block
   320 		iNextState = EFetchContactBlock;
   322 		iNextState = EFetchContactBlock;
   321 		IssueRequest();
   323         // Delay the next fetch since contact fetch is CPU intensive,
       
   324         // this will give other threads a chance to use CPU
       
   325         iTimer.After( iStatus, KTimerInterval); // 100 milliseconds
       
   326         SetActive();
   322 	}
   327 	}
   323 	
   328 	
   324 }
   329 }
   325     
   330     
   326 // ---------------------------------------------------------------------------
   331 // ---------------------------------------------------------------------------
   342 	}
   347 	}
   343 	else if ( (iFetchedContactCount % KLinksToFetchInOneGo) == 0 ) 
   348 	else if ( (iFetchedContactCount % KLinksToFetchInOneGo) == 0 ) 
   344 	{
   349 	{
   345 		// Fetch next block
   350 		// Fetch next block
   346 		iNextState = EFetchContactBlock;
   351 		iNextState = EFetchContactBlock;
   347 		IssueRequest();
   352         // Delay the next fetch since contact fetch is CPU intensive,
       
   353         // this will give other threads a chance to use CPU
       
   354 		iTimer.After( iStatus, KTimerInterval);   // 100 milliseconds
       
   355         SetActive();
   348 	}
   356 	}
   349 	
   357 	
   350 	PRINT ( _L("End CPcsContactStore::VPbkSingleContactOperationFailed") );
   358 	PRINT ( _L("End CPcsContactStore::VPbkSingleContactOperationFailed") );
   351 }
   359 }
   352 
   360 
   813 		    break;
   821 		    break;
   814    		
   822    		
   815 	   	case EFetchContactBlock:
   823 	   	case EFetchContactBlock:
   816 	   		PRINT ( _L("Issuing the fetch request for next block") );
   824 	   		PRINT ( _L("Issuing the fetch request for next block") );
   817 			FetchlinksL();
   825 			FetchlinksL();
   818 			
       
   819 			// Delay the next fetch since contact fetch is CPU intensive,
       
   820 			// this will give other threads a chance to use CPU
       
   821 			iTimer.After( timerStatus, 100000); // 100 milliseconds
       
   822 			User::WaitForRequest( timerStatus );
       
   823 			break;
   826 			break;
   824 	   	
   827 	   	
   825 	   	case EComplete:
   828 	   	case EComplete:
   826 		    PRINT ( _L("Contacts Caching FINISHED") );
   829 		    PRINT ( _L("Contacts Caching FINISHED") );
   827 		    PRINT_BOOT_PERFORMANCE ( _L("Contacts Caching FINISHED") );
   830 		    PRINT_BOOT_PERFORMANCE ( _L("Contacts Caching FINISHED") );