mtpfws/mtpfw/dataproviders/proxydp/src/cmtpdeleteobject.cpp
branchRCL_3
changeset 6 f8e15b44d440
parent 0 d0791faffa3f
child 11 4843bb5893b6
--- a/mtpfws/mtpfw/dataproviders/proxydp/src/cmtpdeleteobject.cpp	Tue Feb 02 01:11:40 2010 +0200
+++ b/mtpfws/mtpfw/dataproviders/proxydp/src/cmtpdeleteobject.cpp	Fri Feb 19 23:40:44 2010 +0200
@@ -86,6 +86,19 @@
     __FLOG( _L8("-ConstructL") );
     }
     
+TMTPResponseCode CMTPDeleteObject::CheckRequestL()
+	{
+    __FLOG(_L8("CheckRequestL - Entry"));
+    TMTPResponseCode responseCode = CMTPRequestProcessor::CheckRequestL();   
+    if ((EMTPRespCodeOK == responseCode) && (iSingletons.DpController().EnumerateState() == CMTPDataProviderController::EEnumeratingSubDirFiles))
+        {
+		responseCode = EMTPRespCodeDeviceBusy;
+        }
+    
+	__FLOG_VA((_L8("CheckRequestL - Exit with responseCode = 0x%04X"), responseCode));
+    return responseCode;
+	}
+
 /**
 DeleteObject request handler
 */ 
@@ -158,11 +171,21 @@
     
     if ( iStatus == KErrNone )
         {
-        NextObjectHandleL();
-        if ( iOwnerDp != KInvalidDpId )
+        //First check if the operation has been cancelled or not
+        if(iCancelled)
             {
-            CMTPDataProvider& dp = iSingletons.DpController().DataProviderL( iOwnerDp );
-            dp.ExecuteProxyRequestL( iCurrentRequest, Connection(), *this );
+            __FLOG(_L8("Initiator cancell delete, send response with cancelled code "));
+            SendResponseL(EMTPRespCodeTransactionCancelled);
+            iCancelled = EFalse;
+            }
+        else
+            {
+            NextObjectHandleL();
+            if ( iOwnerDp != KInvalidDpId )
+                {
+                CMTPDataProvider& dp = iSingletons.DpController().DataProviderL( iOwnerDp );
+                dp.ExecuteProxyRequestL( iCurrentRequest, Connection(), *this );
+                }
             }
         }
     else
@@ -209,6 +232,7 @@
     iHandles.Reset();
     iCurrentHandle = 0;
     iDeletedObjectsNumber = 0;
+    
     MMTPType::CopyL( Request(), iCurrentRequest );
     
     CMTPObjectBrowser::TBrowseCallback callback = { CMTPDeleteObject::OnBrowseObjectL, this };