- self = helper->mail_op;
- priv = MODEST_MAIL_OPERATION_GET_PRIVATE(self);
-
- priv->done = 1;
- priv->total = 1;
-
- state = modest_mail_operation_clone_state (self);
- state->bytes_done = status->position;
- state->bytes_total = status->of_total;
-
- /* This is not a GDK lock because we are a Tinymail callback
- * which is already GDK locked by Tinymail */
-
- /* 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);
-}
-
-/****************************************************/
-typedef struct {
- ModestMailOperation *mail_op;
- TnyList *headers;
- GetMsgAsyncUserCallback user_callback;
- gpointer user_data;
- GDestroyNotify notify;
-} GetFullMsgsInfo;
-
-typedef struct {
- GetMsgAsyncUserCallback user_callback;
- TnyHeader *header;
- TnyMsg *msg;
- gpointer user_data;
- ModestMailOperation *mail_op;
-} NotifyGetMsgsInfo;
-
-
-/*
- * Used by get_msgs_full_thread to call the user_callback for each
- * message that has been read
- */
-static gboolean
-notify_get_msgs_full (gpointer data)
-{
- NotifyGetMsgsInfo *info;
-
- info = (NotifyGetMsgsInfo *) data;
-
- /* This is a GDK lock because we are an idle callback and
- * because info->user_callback can contain Gtk+ code */
-
- gdk_threads_enter (); /* CHECKED */
- info->user_callback (info->mail_op, info->header, info->msg, info->user_data);
- gdk_threads_leave (); /* CHECKED */
-
- g_slice_free (NotifyGetMsgsInfo, info);
-
- return FALSE;
-}
-
-/*
- * Used by get_msgs_full_thread to free al the thread resources and to
- * call the destroy function for the passed user_data
- */
-static gboolean
-get_msgs_full_destroyer (gpointer data)
-{
- GetFullMsgsInfo *info;
-
- info = (GetFullMsgsInfo *) data;
-
- if (info->notify) {
-
- /* This is a GDK lock because we are an idle callback and
- * because info->notify can contain Gtk+ code */
-
- gdk_threads_enter (); /* CHECKED */
- info->notify (info->user_data);
- gdk_threads_leave (); /* CHECKED */
- }
-
- /* free */
- g_object_unref (info->headers);
- g_slice_free (GetFullMsgsInfo, info);
-
- return FALSE;