mpx/collectionframework/collectionutility/src/mpxcollectionopenutility.cpp
branchRCL_3
changeset 56 63223d4fd956
parent 55 6c1dfe4da5dd
--- a/mpx/collectionframework/collectionutility/src/mpxcollectionopenutility.cpp	Tue Aug 31 15:41:40 2010 +0300
+++ b/mpx/collectionframework/collectionutility/src/mpxcollectionopenutility.cpp	Wed Sep 01 12:23:05 2010 +0100
@@ -221,8 +221,8 @@
 EXPORT_C void CMPXCollectionOpenUtility::SetDirection( TDirection aDirection )
     {
     iFetchDirection = aDirection;
-
-    if( iFetchStep == EFetchItems || iFetchStep == EFetchCommand || iFetchStep == EFetchCount )
+    
+    if( iFetchStep == EFetchItems || iFetchStep == EFetchCommand )
         {
         TBool skipFirst = iFetchStep == EFetchCommand ? ETrue : EFalse;
         
@@ -602,8 +602,10 @@
     MPX_DEBUG1("CMPXCollectionOpenUtility::DoHandleFetchItemsL <---" ); 
     // Task is done, and compact the list
     //
+    TInt curOffset(0);
     if( iIncrementalChunks.Count() )
         {
+        curOffset = iIncrementalChunks[0].iOffset;
         iIncrementalChunks.Remove(0);
         DoCompactTaskListL( aEntries );
         }
@@ -649,9 +651,12 @@
         iFetchStep = EFetchNone;
         }
 
-    // Callback to observer
+    // Callback to observer with some treshold to avoid over redrawing
+    // Playlists need every handle open to update the path
     //
-    if( iObs )
+    if( iObs && 
+        (Abs<TInt>(aIndex-curOffset) < iFetchInfo.iSize ||
+        iFirstOpen || iMode == KMcModePlaylist || complete ) )
         {
         iFirstOpen = EFalse;
         MPX_DEBUG1("CMPXCollectionOpenUtility::DoHandleFetchItemsL callback" );