videocollection/mpxmyvideoscollection/src/vcxmyvideosasyncfileoperations.cpp
branchRCL_3
changeset 15 8f0df5c82986
parent 10 112a725ff2c2
child 16 67eb01668b0e
equal deleted inserted replaced
14:55fa1ec415c6 15:8f0df5c82986
   572     if ( aErr == KErrNone )
   572     if ( aErr == KErrNone )
   573         {
   573         {
   574         MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: Copy succeeded");
   574         MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: Copy succeeded");
   575         if ( iIsMoveOperation )
   575         if ( iIsMoveOperation )
   576             {
   576             {
   577             MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: move case");
   577             MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: move op: deleting source file");
   578             aErr = BaflUtils::DeleteFile( iCollection.iFs, iSourcePath );
   578             aErr = BaflUtils::DeleteFile( iCollection.iFs, iSourcePath );
   579             if ( aErr != KErrNone )
   579             if ( aErr != KErrNone )
   580                 {
   580                 {
   581                 MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: delete for source file failed: %d", aErr );
   581                 MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: delete for source file failed: %d", aErr );
   582                 MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: deleting target file");
       
   583                 TInt delErr = BaflUtils::DeleteFile( iCollection.iFs, iTargetPath );
       
   584                 if ( delErr != KErrNone )
       
   585                     {
       
   586                     MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: delete for target file failed: %d", delErr );
       
   587                     }
       
   588                 }
   582                 }
   589             }
   583             }
   590         }
   584         }
   591     else
   585     else
   592         {
   586         {
   593         MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: CopyFile failed: %d", aErr);
   587         MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: CopyFile failed: %d", aErr);
   594         }
   588         }
   595     
   589     
   596     // roll mds and cache back if file operations failed
   590     // roll everything back if file operations failed
   597     if ( aErr != KErrNone )
   591     if ( aErr != KErrNone )
   598         {
   592         {
   599         if ( iIsMoveOperation )
   593         if ( iIsMoveOperation )
   600             {
   594             {
   601             MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: move failed %d", aErr );
   595             MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: move operation failed %d", aErr );
   602             MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: setting media path back and leaving." );
   596             MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: setting media path back in MDS" );
   603             iMediaForMoveOp->SetTextValueL( KMPXMediaGeneralUri, iSourcePath );
   597             iMediaForMoveOp->SetTextValueL( KMPXMediaGeneralUri, iSourcePath );
   604             iCollection.SetVideoL( *iMediaForMoveOp );
   598             iCollection.SetVideoL( *iMediaForMoveOp );
       
   599             MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: deleting target file");
       
   600             TInt delErr = BaflUtils::DeleteFile( iCollection.iFs, iTargetPath );
       
   601             if ( delErr != KErrNone )
       
   602                 {
       
   603                 MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: delete for target file failed: %d", delErr );
       
   604                 }
   605             }
   605             }
   606         else
   606         else
   607             {
   607             {
   608             MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: copy failed %d", aErr );
   608             MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: copy failed %d", aErr );
   609             MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: deleting the added media object and leaving");
   609             MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: deleting the added media object and leaving");