phoneuis/easydialing/src/easydialingcontactdatamanager.cpp
branchRCL_3
changeset 15 2a26698d78ba
parent 14 24062c24fe38
child 17 38529f706030
--- a/phoneuis/easydialing/src/easydialingcontactdatamanager.cpp	Fri Mar 12 15:42:40 2010 +0200
+++ b/phoneuis/easydialing/src/easydialingcontactdatamanager.cpp	Mon Mar 15 12:40:24 2010 +0200
@@ -186,7 +186,7 @@
     }
 
 // ---------------------------------------------------------------------------
-// CEasyDialingContactDataManager::GetThumbnail 
+// CEasyDialingContactDataManager::GetThumbnailAndFav 
 // ---------------------------------------------------------------------------
 //
 TBool CEasyDialingContactDataManager::GetThumbnailAndFav(const TDesC& aId, CFbsBitmap*& aThumbnail, TBool& aFav)
@@ -262,14 +262,13 @@
 //
 MVPbkContactLink* CEasyDialingContactDataManager::FavLinkLC( TInt aIndex )
     {
-    if ( iFavsView )
+    if ( !iFavsView )
         {
-        return iFavsView->ContactAtL( aIndex ).CreateLinkLC();
+        // LC function should not return normally unless it has actually
+        // put something to cleanup stack
+        User::Leave( KErrNotFound );
         }
-    else
-        {
-        return NULL;
-        }
+    return iFavsView->ContactAtL( aIndex ).CreateLinkLC();
     }
 
 // ---------------------------------------------------------------------------
@@ -326,6 +325,24 @@
     }
 
 // ---------------------------------------------------------------------------
+// CEasyDialingContactDataManager::Pause
+// ---------------------------------------------------------------------------
+//
+void CEasyDialingContactDataManager::Pause( TBool aPause )
+    {
+    iPause = aPause;
+    
+    if ( !iPause && iWaitingContacts.Count() )
+        {
+        TRAPD( err, LoadNextContactDataL());
+        if ( err )
+            {
+            HandleError(err);
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
 // CEasyDialingContactDataManager::InitReady
 // ---------------------------------------------------------------------------
 //
@@ -372,7 +389,7 @@
 void CEasyDialingContactDataManager::LoadNextContactDataL()
     {
     LOGSTRING("CEasyDialingContactDataManager: LoadNextContactDataL");
-    if (!iImageOperation && !iContactOperation && iWaitingContacts.Count() && iStoreReady)
+    if ( !iImageOperation && !iContactOperation && iWaitingContacts.Count() && iStoreReady && !iPause )
         {
         // first we need to load the contact item
         CEasyDialingContactData* tn = iContactDataArray[iWaitingContacts[0]];
@@ -477,6 +494,7 @@
     iStoreContact = NULL;
     iWaitingContacts.Reset();
     iContactDataArray.ResetAndDestroy();
+    iPause = EFalse;
     }
 
 // ---------------------------------------------------------------------------