predictivesearch/adapters/contacts/src/cpcscontactstore.cpp
branchRCL_3
changeset 32 2828b4d142c0
parent 21 b3431bff8c19
child 35 4ae315f230bc
--- a/predictivesearch/adapters/contacts/src/cpcscontactstore.cpp	Tue Apr 27 16:23:35 2010 +0300
+++ b/predictivesearch/adapters/contacts/src/cpcscontactstore.cpp	Tue May 11 16:00:21 2010 +0300
@@ -60,11 +60,13 @@
 #include <contactsort.rsg>
 
 // CONSTANTS
+namespace {
 const TInt KSimStoreOffset            = -5000;
+const TInt KTimerInterval             = 100000;   // 100 milliseconds
 
 _LIT(KResourceFileName, "contactsort.rsc");
 _LIT(KPcsViewPrefix,"PCSView_");
-
+}
 // FORWARD DECLARATION
 
 // ============================== MEMBER FUNCTIONS ================================
@@ -318,7 +320,10 @@
 	{
 	    // Fetch next block
 		iNextState = EFetchContactBlock;
-		IssueRequest();
+        // Delay the next fetch since contact fetch is CPU intensive,
+        // this will give other threads a chance to use CPU
+        iTimer.After( iStatus, KTimerInterval); // 100 milliseconds
+        SetActive();
 	}
 	
 }
@@ -344,7 +349,10 @@
 	{
 		// Fetch next block
 		iNextState = EFetchContactBlock;
-		IssueRequest();
+        // Delay the next fetch since contact fetch is CPU intensive,
+        // this will give other threads a chance to use CPU
+		iTimer.After( iStatus, KTimerInterval);   // 100 milliseconds
+        SetActive();
 	}
 	
 	PRINT ( _L("End CPcsContactStore::VPbkSingleContactOperationFailed") );
@@ -815,11 +823,6 @@
 	   	case EFetchContactBlock:
 	   		PRINT ( _L("Issuing the fetch request for next block") );
 			FetchlinksL();
-			
-			// Delay the next fetch since contact fetch is CPU intensive,
-			// this will give other threads a chance to use CPU
-			iTimer.After( timerStatus, 100000); // 100 milliseconds
-			User::WaitForRequest( timerStatus );
 			break;
 	   	
 	   	case EComplete: