emailuis/nmframeworkadapter/src/nmfwaremoveattachmentoperation.cpp
changeset 39 b0b89ca206b5
parent 38 b4618f2cf6ac
child 43 99bcbff212ad
--- a/emailuis/nmframeworkadapter/src/nmfwaremoveattachmentoperation.cpp	Fri May 14 03:48:25 2010 +0300
+++ b/emailuis/nmframeworkadapter/src/nmfwaremoveattachmentoperation.cpp	Fri May 14 04:17:40 2010 +0300
@@ -53,7 +53,7 @@
 }
 
 /*!
-    Called after base object construction via timer event, runs the
+    Called after base object construction, runs the
     async operation.
     
     \sa NmOperation
@@ -83,16 +83,22 @@
         
     // Search through all attachments from message and remove attachment
     // if message part match.
+    bool found(false);
     for (int i=0; i<attachments.Count(); ++i) {
         if (mAttachmentPartId.id() == attachments[i]->GetPartId().GetNmId().id()) {
             mRequestId = msg->RemoveChildPartL(attachments[i]->GetPartId(),*this);
+            found = true;
             break;
         }
     }
-    attachments.ResetAndDestroy();
-    
+    attachments.ResetAndDestroy();   
     delete msg;
     msg = NULL;
+    // if attachment is not found, request to plugin is not made
+    // and the operation should be completed here
+    if (!found) {
+        completeOperation(NmNotFoundError);
+    }
 }
 
 /*!