* modest-mail-operation.c: Set FAILED status if an exception is received.
authorJavier Fernandez Garcia-Boente <jfernandez@igalia.com>
Mon, 21 May 2007 10:40:06 +0000 (10:40 +0000)
committerJavier Fernandez Garcia-Boente <jfernandez@igalia.com>
Mon, 21 May 2007 10:40:06 +0000 (10:40 +0000)
* modest-ui-actions.c: check if copy_folder_async failed to
remove mail operation from queue.

pmo-trunk-r1936

src/modest-mail-operation.c
src/modest-ui-actions.c

index 4ca932b..c229b36 100644 (file)
@@ -1014,6 +1014,7 @@ modest_mail_operation_xfer_folder_async (ModestMailOperation *self,
        /* The moveable restriction is applied also to copy operation */
        rules = modest_tny_folder_get_rules (TNY_FOLDER (parent));
        if (rules & MODEST_FOLDER_RULES_FOLDER_NON_MOVEABLE) {
+               priv->status = MODEST_MAIL_OPERATION_STATUS_FAILED;     
                g_set_error (&(priv->error), MODEST_MAIL_OPERATION_ERROR,
                             MODEST_MAIL_OPERATION_ERROR_FOLDER_RULES,
                             _("FIXME: unable to rename"));
index 52b5e4f..b5fac87 100644 (file)
@@ -2437,6 +2437,7 @@ modest_ui_actions_on_main_window_move_to (GtkAction *action,
                                                                 folder_store,
                                                                 TRUE);
                        g_object_unref (G_OBJECT (mail_op));
+                       
                }
 
                /* Frees */
@@ -2472,6 +2473,11 @@ modest_ui_actions_on_main_window_move_to (GtkAction *action,
        }
        g_object_unref (folder_store);
 
+       /* Check errors */
+       if (modest_mail_operation_get_status (mail_op) == MODEST_MAIL_OPERATION_STATUS_FAILED)
+               /* Notify the queue */
+               modest_mail_operation_queue_remove (modest_runtime_get_mail_operation_queue (), mail_op);
+       
  end:
        gtk_widget_destroy (dialog);
 }