videocollection/mpxmyvideoscollection/src/vcxmyvideosasyncfileoperations.cpp
branchRCL_3
changeset 15 8f0df5c82986
parent 10 112a725ff2c2
child 16 67eb01668b0e
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosasyncfileoperations.cpp	Tue May 11 16:15:40 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosasyncfileoperations.cpp	Tue May 25 12:44:54 2010 +0300
@@ -574,17 +574,11 @@
         MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: Copy succeeded");
         if ( iIsMoveOperation )
             {
-            MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: move case");
+            MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: move op: deleting source file");
             aErr = BaflUtils::DeleteFile( iCollection.iFs, iSourcePath );
             if ( aErr != KErrNone )
                 {
                 MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: delete for source file failed: %d", aErr );
-                MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: deleting target file");
-                TInt delErr = BaflUtils::DeleteFile( iCollection.iFs, iTargetPath );
-                if ( delErr != KErrNone )
-                    {
-                    MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: delete for target file failed: %d", delErr );
-                    }
                 }
             }
         }
@@ -593,15 +587,21 @@
         MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: CopyFile failed: %d", aErr);
         }
     
-    // roll mds and cache back if file operations failed
+    // roll everything back if file operations failed
     if ( aErr != KErrNone )
         {
         if ( iIsMoveOperation )
             {
-            MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: move failed %d", aErr );
-            MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: setting media path back and leaving." );
+            MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: move operation failed %d", aErr );
+            MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: setting media path back in MDS" );
             iMediaForMoveOp->SetTextValueL( KMPXMediaGeneralUri, iSourcePath );
             iCollection.SetVideoL( *iMediaForMoveOp );
+            MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: deleting target file");
+            TInt delErr = BaflUtils::DeleteFile( iCollection.iFs, iTargetPath );
+            if ( delErr != KErrNone )
+                {
+                MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: delete for target file failed: %d", delErr );
+                }
             }
         else
             {