photosgallery/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmdscommand.cpp
branchRCL_3
changeset 24 ea65f74e6de4
parent 19 420f6808bf21
--- a/photosgallery/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmdscommand.cpp	Thu Jul 15 18:39:01 2010 +0300
+++ b/photosgallery/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmdscommand.cpp	Thu Aug 19 09:55:03 2010 +0300
@@ -1019,11 +1019,19 @@
         fs.SetAtt(object.Uri(), 0, KEntryAttReadOnly);
         TInt err = manager->DeleteFile(object.Uri());
         if (err != KErrNone)
-        	{
-        	lastErr = err;
-        	}    
+            {
+            const TInt KDelayInterval = 250000;
+            const TInt KMaxRetries = 4;
+            for (TInt i = 0; ((i < KMaxRetries) && err == KErrInUse
+                    && queryCount == 1); i++)
+                {
+                User::After(KDelayInterval);
+                err = manager->DeleteFile(object.Uri());
+                }
+            lastErr = err;
+            }
         else
-            {    
+            {
             // On successful deletion, delete the same from database
             objectsForRemoval.AppendL(object.Id());
             }