* src/maemo/modest-main-window.c:
[modest] / src / modest-mail-operation.c
index 087e2dc..136aab3 100644 (file)
@@ -305,6 +305,7 @@ modest_mail_operation_new_with_error_handling (ModestMailOperationTypeOperation
        
        g_return_val_if_fail (error_handler != NULL, obj);
        priv->error_checking = error_handler;
+       priv->error_checking_user_data = user_data;
 
        return obj;
 }
@@ -562,7 +563,10 @@ modest_mail_operation_send_mail (ModestMailOperation *self,
                /* TODO: connect to the msg-sent in order to know when
                   the mail operation is finished */
 
-               tny_send_queue_add (send_queue, msg, &(priv->error));
+/*             tny_send_queue_add (send_queue, msg, &(priv->error)); */
+               modest_tny_send_queue_add (MODEST_TNY_SEND_QUEUE(send_queue), 
+                                          msg, 
+                                          &(priv->error));
 
                /* TODO: we're setting always success, do the check in
                   the handler */
@@ -1559,28 +1563,19 @@ modest_mail_operation_create_folder (ModestMailOperation *self,
        ModestMailOperationPrivate *priv;
        TnyFolder *new_folder = NULL;
 
-       TnyList *list = tny_simple_list_new ();
-       TnyFolderStoreQuery *query = tny_folder_store_query_new ();
-
        g_return_val_if_fail (TNY_IS_FOLDER_STORE (parent), NULL);
        g_return_val_if_fail (name, NULL);
        
        priv = MODEST_MAIL_OPERATION_GET_PRIVATE (self);
 
        /* Check for already existing folder */
-       tny_folder_store_query_add_item (query, name, TNY_FOLDER_STORE_QUERY_OPTION_MATCH_ON_NAME);
-       tny_folder_store_get_folders (parent, list, query, NULL);
-       g_object_unref (G_OBJECT (query));
-
-       if (tny_list_get_length (list) > 0) {
+       if (modest_tny_folder_has_subfolder_with_name (parent, name)) {
                priv->status = MODEST_MAIL_OPERATION_STATUS_FAILED;
                g_set_error (&(priv->error), MODEST_MAIL_OPERATION_ERROR,
                             MODEST_MAIL_OPERATION_ERROR_FOLDER_EXISTS,
                             _CS("ckdg_ib_folder_already_exists"));
        }
 
-       g_object_unref (G_OBJECT (list));
-
        /* Check parent */
        if (TNY_IS_FOLDER (parent)) {
                /* Check folder rules */
@@ -1852,9 +1847,7 @@ modest_mail_operation_xfer_folder (ModestMailOperation *self,
        folder_name = tny_folder_get_name (folder);
 
        /* Set the error msg */
-       error_msg = (delete_original) ? 
-               _("mail_in_ui_folder_move_target_error") : 
-               _("mail_in_ui_folder_copy_target_error");
+       error_msg = _("mail_in_ui_folder_move_target_error");
 
        /* Get account and set it into mail_operation */
        priv->account = modest_tny_folder_get_account (TNY_FOLDER(folder));
@@ -2773,10 +2766,7 @@ on_refresh_folder (TnyFolder   *folder,
 
                /* This is not a GDK lock because we are a Tinymail callback and
                 * Tinymail already acquires the Gdk lock */
-
-               /* no gdk_threads_enter (), CHECKED */
                helper->user_callback (self, folder, helper->user_data);
-               /* no gdk_threads_leave (), CHECKED */
        }
 
  out:
@@ -2815,13 +2805,8 @@ on_refresh_folder_status_update (GObject *obj,
 
        /* This is not a GDK lock because we are a Tinymail callback and
         * Tinymail already acquires the Gdk lock */
-
-       /* no gdk_threads_enter (), CHECKED */
-
        g_signal_emit (G_OBJECT (self), signals[PROGRESS_CHANGED_SIGNAL], 0, state, NULL);
 
-       /* no gdk_threads_leave (), CHECKED */
-
        g_slice_free (ModestMailOperationState, state);
 }