2007-06-29 Murray Cumming <murrayc@murrayc.com
[modest] / src / modest-mail-operation.c
index 02d635b..441c6fc 100644 (file)
@@ -799,8 +799,6 @@ recurse_folders (TnyFolderStore *store, TnyFolderStoreQuery *query, TnyList *all
 static gboolean
 idle_notify_progress (gpointer data)
 {
-       gdk_threads_enter ();
-
        ModestMailOperation *mail_op = MODEST_MAIL_OPERATION (data);
        ModestMailOperationState *state;
 
@@ -808,8 +806,6 @@ idle_notify_progress (gpointer data)
        g_signal_emit (G_OBJECT (mail_op), signals[PROGRESS_CHANGED_SIGNAL], 0, state, NULL);
        g_slice_free (ModestMailOperationState, state);
        
-       gdk_threads_leave ();
-
        return TRUE;
 }
 
@@ -821,8 +817,6 @@ idle_notify_progress (gpointer data)
 static gboolean
 idle_notify_progress_once (gpointer data)
 {
-       gdk_threads_enter ();
-
        ModestPair *pair;
 
        pair = (ModestPair *) data;
@@ -833,8 +827,6 @@ idle_notify_progress_once (gpointer data)
        g_slice_free (ModestMailOperationState, (ModestMailOperationState*)pair->second);
        g_object_unref (pair->first);
 
-       gdk_threads_leave ();
-
        return FALSE;
 }
 
@@ -951,7 +943,7 @@ update_account_thread (gpointer thr_user_data)
           Gtk+. We use a timeout in order to provide more status
           information, because the sync tinymail call does not
           provide it for the moment */
-       gint timeout = g_timeout_add (250, idle_notify_progress, info->mail_op);
+       gint timeout = g_timeout_add (100, idle_notify_progress, info->mail_op);
 
        /* Refresh folders */
        new_headers = g_ptr_array_new ();
@@ -1410,7 +1402,7 @@ modest_mail_operation_xfer_folder (ModestMailOperation *self,
                                   gboolean delete_original)
 {
        ModestMailOperationPrivate *priv = NULL;
-       ModestTnyFolderRules parent_rules, rules;
+       ModestTnyFolderRules parent_rules = 0, rules; 
 
        g_return_if_fail (MODEST_IS_MAIL_OPERATION (self));
        g_return_if_fail (TNY_IS_FOLDER (folder));
@@ -1428,6 +1420,7 @@ modest_mail_operation_xfer_folder (ModestMailOperation *self,
        
        /* The moveable restriction is applied also to copy operation */
        if ((!TNY_IS_FOLDER_STORE (parent)) || (rules & MODEST_FOLDER_RULES_FOLDER_NON_MOVEABLE)) {
+               printf("DEBUG: %s: Not allowing the move.\n", __FUNCTION__);
                /* Set status failed and set an error */
                priv->status = MODEST_MAIL_OPERATION_STATUS_FAILED;
                g_set_error (&(priv->error), MODEST_MAIL_OPERATION_ERROR,
@@ -2016,6 +2009,9 @@ transfer_msgs_cb (TnyFolder *folder, gboolean cancelled, GError **err, gpointer
                priv->status = MODEST_MAIL_OPERATION_STATUS_SUCCESS;
        }
 
+       /* Notify about operation end */
+       modest_mail_operation_notify_end (self, TRUE);
+
        /* If user defined callback function was defined, call it */
        if (helper->user_callback) {
                gdk_threads_enter ();
@@ -2030,8 +2026,6 @@ transfer_msgs_cb (TnyFolder *folder, gboolean cancelled, GError **err, gpointer
        g_slice_free   (XFerMsgAsyncHelper, helper);
        g_object_unref (folder);
 
-       /* Notify about operation end */
-       modest_mail_operation_notify_end (self, TRUE);
 }
 
 void