photosgallery/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmdscommand.cpp
branchRCL_3
changeset 19 420f6808bf21
parent 13 bcb43dc84c44
child 24 ea65f74e6de4
--- a/photosgallery/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmdscommand.cpp	Tue May 25 12:42:31 2010 +0300
+++ b/photosgallery/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmdscommand.cpp	Wed Jun 09 09:41:51 2010 +0300
@@ -1028,7 +1028,7 @@
             objectsForRemoval.AppendL(object.Id());
             }
 			 
-        // After every 50 items are deleted, break from the for loop 
+        // After every 10 items are deleted, break from the for loop 
         // and process other pending requests if any
         if(deleteItemCounter == KDeletedItemCount)
 			{	
@@ -1036,6 +1036,13 @@
 							TCallBack( &SchedulerStopCallback, (TAny *)this ) );	
 			iSchedulerWait->Start();  
 			deleteItemCounter = 0;
+			if(objectsForRemoval.Count()>0)
+				{
+				// Inform the MdS for media items Delete Updation in batches of 10
+				DataSource()->Session().RemoveObjectsL(objectsForRemoval,
+						sucessfullyRemovedObjects);
+				objectsForRemoval.Reset();
+				}
 			}     
         deleteItemCounter++;     
         }
@@ -1044,7 +1051,7 @@
     
     User::LeaveIfError(lastErr);
     
-    if (queryCount)
+    if (queryCount && objectsForRemoval.Count()>0)
     	{
     	// Some objects may have already been removed by the harvester
     	DataSource()->Session().RemoveObjectsL(objectsForRemoval, sucessfullyRemovedObjects);