mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/crenameobject.cpp
branchRCL_3
changeset 17 780c925249c1
parent 9 bee149131e4b
child 19 51035f0751c2
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/crenameobject.cpp	Mon Mar 15 12:42:31 2010 +0200
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/crenameobject.cpp	Wed Mar 31 22:26:09 2010 +0300
@@ -18,9 +18,7 @@
 
 #include <f32file.h>
 
-#include <mtp/mmtpdataproviderframework.h>
 #include <mtp/mmtpobjectmgr.h>
-#include <mtp/cmtpobjectmetadata.h>
 #include <mtp/tmtptypeuint32.h>
 
 #include "crenameobject.h"
@@ -147,6 +145,8 @@
 
             if ( iNewFolderName.Length() + iRightPartName.Length() <= KMaxFileName )
                 {
+                PerformAdditionalActionL();
+
                 iFileName.Zero();
                 iFileName.Append( iNewFolderName );
                 iFileName.Append( iRightPartName );
@@ -155,8 +155,6 @@
                 iObjectInfo->SetDesCL( CMTPObjectMetaData::ESuid, iFileName );
                 iObjectInfo->SetUint( CMTPObjectMetaData::EObjectMetaDataUpdate, 1 );
                 iFramework.ObjectMgr().ModifyObjectL( *iObjectInfo );
-
-                PerformAdditionalActionL();
                 }
             }
 
@@ -287,7 +285,7 @@
     PRINT( _L( "MM MTP => CRenameObject::PerformAdditionalActionL" ) );
 
     // update MPX DB
-    TRAPD( err, iWrapper.RenameObjectL( iOldFileName, iFileName ) );
+    TRAPD( err, iWrapper.RenameObjectL( *iObjectInfo, iFileName ) );
 
     // should not fail for 1 file, keep it going, as folder already renamed
     if ( err != KErrNone )