aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer/e-msg-composer.c135
-rw-r--r--em-format/em-format-quote.c29
-rw-r--r--em-format/em-format.c165
-rw-r--r--em-format/em-format.h34
-rw-r--r--mail/e-mail-backend.c3
-rw-r--r--mail/e-mail-local.c3
-rw-r--r--mail/e-mail-migrate.c21
-rw-r--r--mail/e-mail-reader-utils.c2
-rw-r--r--mail/e-mail-reader.c12
-rw-r--r--mail/e-mail-store.c4
-rw-r--r--mail/em-composer-utils.c38
-rw-r--r--mail/em-folder-tree.c34
-rw-r--r--mail/em-folder-utils.c45
-rw-r--r--mail/em-format-hook.c4
-rw-r--r--mail/em-format-html-display.c29
-rw-r--r--mail/em-format-html-print.c10
-rw-r--r--mail/em-format-html.c163
-rw-r--r--mail/em-format-html.h4
-rw-r--r--mail/em-subscribe-editor.c8
-rw-r--r--mail/em-utils.c34
-rw-r--r--mail/em-utils.h2
-rw-r--r--mail/importers/mail-importer.c12
-rw-r--r--mail/mail-folder-cache.c23
-rw-r--r--mail/mail-folder-cache.h2
-rw-r--r--mail/mail-mt.c42
-rw-r--r--mail/mail-mt.h8
-rw-r--r--mail/mail-ops.c357
-rw-r--r--mail/mail-ops.h53
-rw-r--r--mail/mail-send-recv.c106
-rw-r--r--mail/mail-session.c8
-rw-r--r--mail/mail-tools.c26
-rw-r--r--mail/mail-tools.h16
-rw-r--r--mail/mail-vfolder.c29
-rw-r--r--mail/message-list.c22
-rw-r--r--modules/mail/e-mail-attachment-handler.c9
-rw-r--r--modules/mail/e-mail-shell-backend.c3
-rw-r--r--modules/mail/e-mail-shell-view.c6
-rw-r--r--plugins/dbx-import/dbx-importer.c10
-rw-r--r--plugins/groupwise-features/install-shared.c8
-rw-r--r--plugins/groupwise-features/share-folder-common.c9
-rw-r--r--plugins/groupwise-features/status-track.c4
-rw-r--r--plugins/itip-formatter/itip-formatter.c21
-rw-r--r--plugins/mail-to-task/mail-to-task.c5
-rw-r--r--plugins/mark-all-read/mark-all-read.c12
-rw-r--r--plugins/prefer-plain/prefer-plain.c28
-rw-r--r--plugins/pst-import/pst-importer.c25
-rw-r--r--plugins/templates/templates.c10
-rw-r--r--plugins/tnef-attachments/tnef-plugin.c15
48 files changed, 1102 insertions, 546 deletions
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 9f9aac9e19..5ef78d5daa 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -105,15 +105,19 @@ static void add_attachments_from_multipart (EMsgComposer *composer,
/* used by e_msg_composer_new_with_message () */
static void handle_multipart (EMsgComposer *composer,
CamelMultipart *multipart,
+ CamelOperation *operation,
gint depth);
static void handle_multipart_alternative (EMsgComposer *composer,
CamelMultipart *multipart,
+ CamelOperation *operation,
gint depth);
static void handle_multipart_encrypted (EMsgComposer *composer,
CamelMimePart *multipart,
+ CamelOperation *operation,
gint depth);
static void handle_multipart_signed (EMsgComposer *composer,
CamelMultipart *multipart,
+ CamelOperation *operation,
gint depth);
G_DEFINE_TYPE_WITH_CODE (
@@ -134,7 +138,10 @@ G_DEFINE_TYPE_WITH_CODE (
* Return Value: The part in displayable html format.
**/
static gchar *
-emcu_part_to_html (CamelMimePart *part, gssize *len, EMFormat *source)
+emcu_part_to_html (CamelMimePart *part,
+ gssize *len,
+ EMFormat *source,
+ CamelOperation *operation)
{
EMFormatQuote *emfq;
CamelStreamMem *mem;
@@ -157,7 +164,9 @@ emcu_part_to_html (CamelMimePart *part, gssize *len, EMFormat *source)
em_format_set_default_charset (
(EMFormat *) emfq, source->charset);
}
- em_format_part ((EMFormat *) emfq, (CamelStream *)mem, part);
+ em_format_part (
+ EM_FORMAT (emfq), CAMEL_STREAM (mem),
+ part, G_CANCELLABLE (operation));
g_object_unref (emfq);
camel_stream_write((CamelStream *) mem, "", 1, NULL);
@@ -614,6 +623,7 @@ build_message (EMsgComposer *composer,
CamelTransferEncoding plain_encoding;
const gchar *iconv_charset = NULL;
GPtrArray *recipients = NULL;
+ CamelOperation *operation;
CamelMultipart *body = NULL;
CamelContentType *type;
CamelMimeMessage *new;
@@ -646,6 +656,8 @@ build_message (EMsgComposer *composer,
return p->redirect;
}
+ operation = camel_operation_registered ();
+
new = camel_mime_message_new ();
build_message_headers (composer, new, FALSE);
for (i = 0; i < p->extra_hdr_names->len; i++) {
@@ -960,10 +972,17 @@ build_message (EMsgComposer *composer,
camel_gpg_context_set_always_trust (
CAMEL_GPG_CONTEXT (cipher),
account->pgp_always_trust);
+
+ camel_operation_start (
+ operation, _("Signing message"));
camel_cipher_sign (
- cipher, pgp_userid, account_hash_algo_to_camel_hash (
+ cipher, pgp_userid,
+ account_hash_algo_to_camel_hash (
account ? e_account_get_string (account, E_ACCOUNT_PGP_HASH_ALGORITHM) : NULL),
- part, npart, &local_error);
+ part, npart, G_CANCELLABLE (operation),
+ &local_error);
+ camel_operation_end (operation);
+
g_object_unref (cipher);
if (local_error != NULL) {
@@ -988,9 +1007,15 @@ build_message (EMsgComposer *composer,
camel_gpg_context_set_always_trust (
CAMEL_GPG_CONTEXT (cipher),
account->pgp_always_trust);
+
+ camel_operation_start (
+ operation, _("Encrypting mesage"));
camel_cipher_encrypt (
cipher, pgp_userid, recipients,
- part, npart, &local_error);
+ part, npart, G_CANCELLABLE (operation),
+ &local_error);
+ camel_operation_end (operation);
+
g_object_unref (cipher);
if (account && account->pgp_encrypt_to_self && pgp_userid)
@@ -1069,12 +1094,18 @@ build_message (EMsgComposer *composer,
TRUE, account->smime_encrypt_key);
}
- camel_cipher_sign (cipher, account->smime_sign_key,
+ camel_operation_start (
+ operation, _("Signing message"));
+ camel_cipher_sign (
+ cipher, account->smime_sign_key,
account_hash_algo_to_camel_hash (
(account != NULL) ?
e_account_get_string (account,
E_ACCOUNT_SMIME_HASH_ALGORITHM) : NULL),
- part, npart, &local_error);
+ part, npart, G_CANCELLABLE (operation),
+ &local_error);
+ camel_operation_end (operation);
+
g_object_unref (cipher);
if (local_error != NULL) {
@@ -1099,9 +1130,15 @@ build_message (EMsgComposer *composer,
(CamelSMIMEContext *) cipher, TRUE,
account->smime_encrypt_key);
+ camel_operation_start (
+ operation, _("Encrypting message"));
camel_cipher_encrypt (
cipher, NULL, recipients, part,
- (CamelMimePart *) new, &local_error);
+ (CamelMimePart *) new,
+ G_CANCELLABLE (operation),
+ &local_error);
+ camel_operation_end (operation);
+
g_object_unref (cipher);
if (local_error != NULL)
@@ -1145,6 +1182,9 @@ skip_content:
CAMEL_MEDIUM (new), "X-Evolution-Format",
html_content ? "text/html" : "text/plain");
+ if (operation != NULL)
+ g_object_unref (operation);
+
return new;
exception:
@@ -2443,6 +2483,7 @@ e_msg_composer_add_message_attachments (EMsgComposer *composer,
static void
handle_multipart_signed (EMsgComposer *composer,
CamelMultipart *multipart,
+ CamelOperation *operation,
gint depth)
{
CamelContentType *content_type;
@@ -2485,29 +2526,32 @@ handle_multipart_signed (EMsgComposer *composer,
if (CAMEL_IS_MULTIPART_SIGNED (content)) {
/* Handle the signed content and configure
* the composer to sign outgoing messages. */
- handle_multipart_signed (composer, multipart, depth);
+ handle_multipart_signed (
+ composer, multipart, operation, depth);
} else if (CAMEL_IS_MULTIPART_ENCRYPTED (content)) {
/* Decrypt the encrypted content and configure
* the composer to encrypt outgoing messages. */
- handle_multipart_encrypted (composer, mime_part, depth);
+ handle_multipart_encrypted (
+ composer, mime_part, operation, depth);
} else if (camel_content_type_is (content_type, "multipart", "alternative")) {
/* This contains the text/plain and text/html
* versions of the message body. */
handle_multipart_alternative (
- composer, multipart, depth);
+ composer, multipart, operation, depth);
} else {
/* There must be attachments... */
- handle_multipart (composer, multipart, depth);
+ handle_multipart (
+ composer, multipart, operation, depth);
}
} else if (camel_content_type_is (content_type, "text", "*")) {
gchar *html;
gssize length;
- html = emcu_part_to_html (mime_part, &length, NULL);
+ html = emcu_part_to_html (mime_part, &length, NULL, operation);
e_msg_composer_set_pending_body (composer, html, length);
} else {
e_msg_composer_attach (composer, mime_part);
@@ -2517,6 +2561,7 @@ handle_multipart_signed (EMsgComposer *composer,
static void
handle_multipart_encrypted (EMsgComposer *composer,
CamelMimePart *multipart,
+ CamelOperation *operation,
gint depth)
{
CamelContentType *content_type;
@@ -2544,7 +2589,11 @@ handle_multipart_encrypted (EMsgComposer *composer,
session = e_msg_composer_get_session (composer);
cipher = camel_gpg_context_new (session);
mime_part = camel_mime_part_new ();
- valid = camel_cipher_decrypt (cipher, multipart, mime_part, NULL);
+ camel_operation_start (operation, _("Decrypting message"));
+ valid = camel_cipher_decrypt (
+ cipher, multipart, mime_part,
+ G_CANCELLABLE (operation), NULL);
+ camel_operation_end (operation);
g_object_unref (cipher);
if (valid == NULL)
@@ -2568,29 +2617,31 @@ handle_multipart_encrypted (EMsgComposer *composer,
/* Handle the signed content and configure the
* composer to sign outgoing messages. */
handle_multipart_signed (
- composer, content_multipart, depth);
+ composer, content_multipart, operation, depth);
} else if (CAMEL_IS_MULTIPART_ENCRYPTED (content)) {
/* Decrypt the encrypted content and configure the
* composer to encrypt outgoing messages. */
- handle_multipart_encrypted (composer, mime_part, depth);
+ handle_multipart_encrypted (
+ composer, mime_part, operation, depth);
} else if (camel_content_type_is (content_type, "multipart", "alternative")) {
/* This contains the text/plain and text/html
* versions of the message body. */
handle_multipart_alternative (
- composer, content_multipart, depth);
+ composer, content_multipart, operation, depth);
} else {
/* There must be attachments... */
- handle_multipart (composer, content_multipart, depth);
+ handle_multipart (
+ composer, content_multipart, operation, depth);
}
} else if (camel_content_type_is (content_type, "text", "*")) {
gchar *html;
gssize length;
- html = emcu_part_to_html (mime_part, &length, NULL);
+ html = emcu_part_to_html (mime_part, &length, NULL, operation);
e_msg_composer_set_pending_body (composer, html, length);
} else {
e_msg_composer_attach (composer, mime_part);
@@ -2602,6 +2653,7 @@ handle_multipart_encrypted (EMsgComposer *composer,
static void
handle_multipart_alternative (EMsgComposer *composer,
CamelMultipart *multipart,
+ CamelOperation *operation,
gint depth)
{
/* Find the text/html part and set the composer body to it's contents */
@@ -2631,18 +2683,21 @@ handle_multipart_alternative (EMsgComposer *composer,
if (CAMEL_IS_MULTIPART_SIGNED (content)) {
/* Handle the signed content and configure
* the composer to sign outgoing messages. */
- handle_multipart_signed (composer, mp, depth + 1);
+ handle_multipart_signed (
+ composer, mp, operation, depth + 1);
} else if (CAMEL_IS_MULTIPART_ENCRYPTED (content)) {
/* Decrypt the encrypted content and configure
* the composer to encrypt outgoing messages. */
handle_multipart_encrypted (
- composer, mime_part, depth + 1);
+ composer, mime_part,
+ operation, depth + 1);
} else {
/* Depth doesn't matter so long as we
* don't pass 0. */
- handle_multipart (composer, mp, depth + 1);
+ handle_multipart (
+ composer, mp, operation, depth + 1);
}
} else if (camel_content_type_is (content_type, "text", "html")) {
@@ -2663,7 +2718,7 @@ handle_multipart_alternative (EMsgComposer *composer,
gchar *html;
gssize length;
- html = emcu_part_to_html (text_part, &length, NULL);
+ html = emcu_part_to_html (text_part, &length, NULL, operation);
e_msg_composer_set_pending_body (composer, html, length);
}
}
@@ -2671,6 +2726,7 @@ handle_multipart_alternative (EMsgComposer *composer,
static void
handle_multipart (EMsgComposer *composer,
CamelMultipart *multipart,
+ CamelOperation *operation,
gint depth)
{
gint i, nparts;
@@ -2698,22 +2754,25 @@ handle_multipart (EMsgComposer *composer,
if (CAMEL_IS_MULTIPART_SIGNED (content)) {
/* Handle the signed content and configure
* the composer to sign outgoing messages. */
- handle_multipart_signed (composer, mp, depth + 1);
+ handle_multipart_signed (
+ composer, mp, operation, depth + 1);
} else if (CAMEL_IS_MULTIPART_ENCRYPTED (content)) {
/* Decrypt the encrypted content and configure
* the composer to encrypt outgoing messages. */
handle_multipart_encrypted (
- composer, mime_part, depth + 1);
+ composer, mime_part,
+ operation, depth + 1);
} else if (camel_content_type_is (content_type, "multipart", "alternative")) {
handle_multipart_alternative (
- composer, mp, depth + 1);
+ composer, mp, operation, depth + 1);
} else {
/* Depth doesn't matter so long as we
* don't pass 0. */
- handle_multipart (composer, mp, depth + 1);
+ handle_multipart (
+ composer, mp, operation, depth + 1);
}
} else if (depth == 0 && i == 0) {
@@ -2722,7 +2781,8 @@ handle_multipart (EMsgComposer *composer,
/* Since the first part is not multipart/alternative,
* this must be the body. */
- html = emcu_part_to_html (mime_part, &length, NULL);
+ html = emcu_part_to_html (
+ mime_part, &length, NULL, operation);
e_msg_composer_set_pending_body (composer, html, length);
} else if (camel_mime_part_get_content_id (mime_part) ||
camel_mime_part_get_content_location (mime_part)) {
@@ -2785,6 +2845,7 @@ e_msg_composer_new_with_message (EShell *shell,
EDestination **Tov, **Ccv, **Bccv;
GHashTable *auto_cc, *auto_bcc;
CamelContentType *content_type;
+ CamelOperation *operation = NULL; /* FIXME Pass this in. */
struct _camel_header_raw *headers;
CamelDataWrapper *content;
EAccount *account = NULL;
@@ -3031,22 +3092,26 @@ e_msg_composer_new_with_message (EShell *shell,
if (CAMEL_IS_MULTIPART_SIGNED (content)) {
/* Handle the signed content and configure the
* composer to sign outgoing messages. */
- handle_multipart_signed (composer, multipart, 0);
+ handle_multipart_signed (
+ composer, multipart, operation, 0);
} else if (CAMEL_IS_MULTIPART_ENCRYPTED (content)) {
/* Decrypt the encrypted content and configure the
* composer to encrypt outgoing messages. */
handle_multipart_encrypted (
- composer, CAMEL_MIME_PART (message), 0);
+ composer, CAMEL_MIME_PART (message),
+ operation, 0);
} else if (camel_content_type_is (content_type, "multipart", "alternative")) {
/* This contains the text/plain and text/html
* versions of the message body. */
- handle_multipart_alternative (composer, multipart, 0);
+ handle_multipart_alternative (
+ composer, multipart, operation, 0);
} else {
/* There must be attachments... */
- handle_multipart (composer, multipart, 0);
+ handle_multipart (
+ composer, multipart, operation, 0);
}
} else {
gchar *html;
@@ -3059,7 +3124,8 @@ e_msg_composer_new_with_message (EShell *shell,
|| camel_content_type_is (content_type, "application", "pkcs7-mime")))
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (ACTION (SMIME_ENCRYPT)), TRUE);
- html = emcu_part_to_html ((CamelMimePart *)message, &length, NULL);
+ html = emcu_part_to_html (
+ CAMEL_MIME_PART (message), &length, NULL, operation);
e_msg_composer_set_pending_body (composer, html, length);
}
@@ -3072,6 +3138,9 @@ e_msg_composer_new_with_message (EShell *shell,
set_signature_gui (composer);
+ if (operation != NULL)
+ g_object_unref (operation);
+
return composer;
}
diff --git a/em-format/em-format-quote.c b/em-format/em-format-quote.c
index 9a461d3af0..3313f2a861 100644
--- a/em-format/em-format-quote.c
+++ b/em-format/em-format-quote.c
@@ -59,14 +59,16 @@ emfq_format_clone (EMFormat *emf,
CamelFolder *folder,
const gchar *uid,
CamelMimeMessage *msg,
- EMFormat *src)
+ EMFormat *src,
+ GCancellable *cancellable)
{
EMFormatQuote *emfq = (EMFormatQuote *) emf;
const EMFormatHandler *handle;
GConfClient *gconf;
/* Chain up to parent's format_clone() method. */
- EM_FORMAT_CLASS (parent_class)->format_clone (emf, folder, uid, msg, src);
+ EM_FORMAT_CLASS (parent_class)->format_clone (
+ emf, folder, uid, msg, src, cancellable);
gconf = gconf_client_get_default ();
camel_stream_reset (emfq->stream, NULL);
@@ -75,10 +77,16 @@ emfq_format_clone (EMFormat *emf,
g_object_unref (gconf);
handle = em_format_find_handler(emf, "x-evolution/message/prefix");
if (handle)
- handle->handler (emf, emfq->stream, (CamelMimePart *)msg, handle, FALSE);
+ handle->handler (
+ emf, emfq->stream,
+ CAMEL_MIME_PART (msg),
+ handle, cancellable, FALSE);
handle = em_format_find_handler(emf, "x-evolution/message/rfc822");
if (handle)
- handle->handler (emf, emfq->stream, (CamelMimePart *)msg, handle, FALSE);
+ handle->handler (
+ emf, emfq->stream,
+ CAMEL_MIME_PART (msg),
+ handle, cancellable, FALSE);
camel_stream_flush (emfq->stream, NULL);
@@ -121,7 +129,8 @@ emfq_format_attachment (EMFormat *emf,
CamelStream *stream,
CamelMimePart *part,
const gchar *mime_type,
- const EMFormatHandler *handle)
+ const EMFormatHandler *handle,
+ GCancellable *cancellable)
{
EMFormatQuote *emfq = EM_FORMAT_QUOTE (emf);
gchar *text, *html;
@@ -144,7 +153,7 @@ emfq_format_attachment (EMFormat *emf,
camel_stream_write_string (stream, "</font></td></tr></table>", NULL);
- handle->handler (emf, stream, part, handle, FALSE);
+ handle->handler (emf, stream, part, handle, cancellable, FALSE);
}
static void
@@ -471,6 +480,7 @@ emfq_format_message_prefix (EMFormat *emf,
CamelStream *stream,
CamelMimePart *part,
const EMFormatHandler *info,
+ GCancellable *cancellable,
gboolean is_fallback)
{
EMFormatQuote *emfq = (EMFormatQuote *) emf;
@@ -484,6 +494,7 @@ emfq_format_message (EMFormat *emf,
CamelStream *stream,
CamelMimePart *part,
const EMFormatHandler *info,
+ GCancellable *cancellable,
gboolean is_fallback)
{
EMFormatQuote *emfq = (EMFormatQuote *) emf;
@@ -502,7 +513,7 @@ emfq_format_message (EMFormat *emf,
} else if (emfq->flags & EM_FORMAT_QUOTE_HEADERS)
emfq_format_headers (emfq, stream, (CamelMedium *)part);
- em_format_part (emf, stream, part);
+ em_format_part (emf, stream, part, cancellable);
if (emfq->flags & EM_FORMAT_QUOTE_CITE)
camel_stream_write_string (
@@ -515,6 +526,7 @@ emfq_text_plain (EMFormat *emf,
CamelStream *stream,
CamelMimePart *part,
const EMFormatHandler *info,
+ GCancellable *cancellable,
gboolean is_fallback)
{
EMFormatQuote *emfq = EM_FORMAT_QUOTE (emf);
@@ -564,6 +576,7 @@ emfq_text_enriched (EMFormat *emf,
CamelStream *stream,
CamelMimePart *part,
const EMFormatHandler *info,
+ GCancellable *cancellable,
gboolean is_fallback)
{
CamelStream *filtered_stream;
@@ -596,6 +609,7 @@ emfq_text_html (EMFormat *emf,
CamelStream *stream,
CamelMimePart *part,
const EMFormatHandler *info,
+ GCancellable *cancellable,
gboolean is_fallback)
{
camel_stream_write_string(stream, "\n<!-- text/html -->\n", NULL);
@@ -607,6 +621,7 @@ emfq_ignore (EMFormat *emf,
CamelStream *stream,
CamelMimePart *part,
const EMFormatHandler *info,
+ GCancellable *cancellable,
gboolean is_fallback)
{
/* NOOP */
diff --git a/em-format/em-format.c b/em-format/em-format.c
index 5554dfc759..f2efac909b 100644
--- a/em-format/em-format.c
+++ b/em-format/em-format.c
@@ -28,8 +28,8 @@
#include <stdio.h>
#include <string.h>
-#include <glib/gi18n.h>
#include <gio/gio.h>
+#include <glib/gi18n-lib.h>
#include "em-format.h"
#include "e-util/e-util.h"
@@ -187,7 +187,8 @@ emf_format_clone (EMFormat *emf,
CamelFolder *folder,
const gchar *uid,
CamelMimeMessage *msg,
- EMFormat *emfsource)
+ EMFormat *emfsource,
+ GCancellable *cancellable)
{
/* Cancel any pending redraws. */
if (emf->priv->redraw_idle_id > 0) {
@@ -255,7 +256,8 @@ static void
emf_format_secure (EMFormat *emf,
CamelStream *stream,
CamelMimePart *part,
- CamelCipherValidity *valid)
+ CamelCipherValidity *valid,
+ GCancellable *cancellable)
{
CamelCipherValidity *save = emf->valid_parent;
gint len;
@@ -275,7 +277,7 @@ emf_format_secure (EMFormat *emf,
len = emf->part_id->len;
g_string_append_printf(emf->part_id, ".secured");
- em_format_part (emf, stream, part);
+ em_format_part (emf, stream, part, cancellable);
g_string_truncate (emf->part_id, len);
emf->valid_parent = save;
@@ -790,7 +792,8 @@ void
em_format_part_as (EMFormat *emf,
CamelStream *stream,
CamelMimePart *part,
- const gchar *mime_type)
+ const gchar *mime_type,
+ GCancellable *cancellable)
{
const EMFormatHandler *handle = NULL;
const gchar *snoop_save = emf->snoop_mime_type, *tmp;
@@ -836,7 +839,9 @@ em_format_part_as (EMFormat *emf,
if (handle != NULL
&& !em_format_is_attachment (emf, part)) {
d(printf("running handler for type '%s'\n", mime_type));
- handle->handler (emf, stream, part, handle, is_fallback);
+ handle->handler (
+ emf, stream, part, handle,
+ cancellable, is_fallback);
goto finish;
}
d(printf("this type is an attachment? '%s'\n", mime_type));
@@ -845,7 +850,7 @@ em_format_part_as (EMFormat *emf,
}
EM_FORMAT_GET_CLASS (emf)->format_attachment (
- emf, stream, part, mime_type, handle);
+ emf, stream, part, mime_type, handle, cancellable);
finish:
emf->base = base_save;
@@ -858,19 +863,22 @@ finish:
void
em_format_part (EMFormat *emf,
CamelStream *stream,
- CamelMimePart *part)
+ CamelMimePart *mime_part,
+ GCancellable *cancellable)
{
gchar *mime_type;
CamelDataWrapper *dw;
- dw = camel_medium_get_content (CAMEL_MEDIUM (part));
+ dw = camel_medium_get_content (CAMEL_MEDIUM (mime_part));
mime_type = camel_data_wrapper_get_mime_type (dw);
if (mime_type != NULL) {
camel_strdown (mime_type);
- em_format_part_as (emf, stream, part, mime_type);
+ em_format_part_as (
+ emf, stream, mime_part, mime_type, cancellable);
g_free (mime_type);
} else
- em_format_part_as (emf, stream, part, "text/plain");
+ em_format_part_as (
+ emf, stream, mime_part, "text/plain", cancellable);
}
/**
@@ -881,6 +889,7 @@ em_format_part (EMFormat *emf,
* @msg: a #CamelMimeMessage or %NULL
* @emfsource: Used as a basis for user-altered layout, e.g. inline viewed
* attachments.
+ * @cancellable: a #GCancellable, or %NULL
*
* Format a message @msg. If @emfsource is non NULL, then the status of
* inlined expansion and so forth is copied direction from @emfsource.
@@ -894,7 +903,8 @@ em_format_format_clone (EMFormat *emf,
CamelFolder *folder,
const gchar *uid,
CamelMimeMessage *message,
- EMFormat *source)
+ EMFormat *source,
+ GCancellable *cancellable)
{
EMFormatClass *class;
@@ -906,17 +916,18 @@ em_format_format_clone (EMFormat *emf,
class = EM_FORMAT_GET_CLASS (emf);
g_return_if_fail (class->format_clone != NULL);
- class->format_clone (emf, folder, uid, message, source);
+ class->format_clone (emf, folder, uid, message, source, cancellable);
}
void
em_format_format (EMFormat *emf,
CamelFolder *folder,
const gchar *uid,
- CamelMimeMessage *message)
+ CamelMimeMessage *message,
+ GCancellable *cancellable)
{
/* em_format_format_clone() will check the arguments. */
- em_format_format_clone (emf, folder, uid, message, NULL);
+ em_format_format_clone (emf, folder, uid, message, NULL, cancellable);
}
static gboolean
@@ -924,8 +935,9 @@ format_redraw_idle_cb (EMFormat *emf)
{
emf->priv->redraw_idle_id = 0;
+ /* FIXME Not passing a GCancellable here. */
em_format_format_clone (
- emf, emf->folder, emf->uid, emf->message, emf);
+ emf, emf->folder, emf->uid, emf->message, emf, NULL);
return FALSE;
}
@@ -1199,7 +1211,8 @@ em_format_format_attachment (EMFormat *emf,
CamelStream *stream,
CamelMimePart *mime_part,
const gchar *mime_type,
- const EMFormatHandler *info)
+ const EMFormatHandler *info,
+ GCancellable *cancellable)
{
EMFormatClass *class;
@@ -1212,7 +1225,8 @@ em_format_format_attachment (EMFormat *emf,
class = EM_FORMAT_GET_CLASS (emf);
g_return_if_fail (class->format_attachment != NULL);
- class->format_attachment (emf, stream, mime_part, mime_type, info);
+ class->format_attachment (
+ emf, stream, mime_part, mime_type, info, cancellable);
}
void
@@ -1243,7 +1257,8 @@ void
em_format_format_secure (EMFormat *emf,
CamelStream *stream,
CamelMimePart *mime_part,
- CamelCipherValidity *valid)
+ CamelCipherValidity *valid,
+ GCancellable *cancellable)
{
EMFormatClass *class;
@@ -1255,7 +1270,7 @@ em_format_format_secure (EMFormat *emf,
class = EM_FORMAT_GET_CLASS (emf);
g_return_if_fail (class->format_secure != NULL);
- class->format_secure (emf, stream, mime_part, valid);
+ class->format_secure (emf, stream, mime_part, valid, cancellable);
if (emf->valid_parent == NULL && emf->valid != NULL) {
camel_cipher_validity_free (emf->valid);
@@ -1297,7 +1312,8 @@ em_format_busy (EMFormat *emf)
void
em_format_format_content (EMFormat *emf,
CamelStream *stream,
- CamelMimePart *part)
+ CamelMimePart *part,
+ GCancellable *cancellable)
{
CamelDataWrapper *dw = camel_medium_get_content ((CamelMedium *)part);
@@ -1471,6 +1487,7 @@ emf_application_xpkcs7mime (EMFormat *emf,
CamelStream *stream,
CamelMimePart *part,
const EMFormatHandler *info,
+ GCancellable *cancellable,
gboolean is_fallback)
{
CamelCipherContext *context;
@@ -1484,7 +1501,8 @@ emf_application_xpkcs7mime (EMFormat *emf,
if (emfc && emfc->valid) {
em_format_format_secure (
emf, stream, emfc->secured,
- camel_cipher_validity_clone (emfc->valid));
+ camel_cipher_validity_clone (emfc->valid),
+ cancellable);
return;
}
@@ -1495,7 +1513,8 @@ emf_application_xpkcs7mime (EMFormat *emf,
EM_FORMAT_VALIDITY_FOUND_SMIME;
opart = camel_mime_part_new ();
- valid = camel_cipher_decrypt (context, part, opart, &local_error);
+ valid = camel_cipher_decrypt (
+ context, part, opart, cancellable, &local_error);
if (valid == NULL) {
em_format_format_error (
emf, stream, "%s",
@@ -1503,7 +1522,7 @@ emf_application_xpkcs7mime (EMFormat *emf,
_("Could not parse S/MIME message: Unknown error"));
g_clear_error (&local_error);
- em_format_part_as (emf, stream, part, NULL);
+ em_format_part_as (emf, stream, part, NULL, cancellable);
} else {
if (emfc == NULL)
emfc = emf_insert_cache (emf, emf->part_id->str);
@@ -1512,7 +1531,8 @@ emf_application_xpkcs7mime (EMFormat *emf,
g_object_ref ((emfc->secured = opart));
add_validity_found (emf, valid);
- em_format_format_secure (emf, stream, opart, valid);
+ em_format_format_secure (
+ emf, stream, opart, valid, cancellable);
}
g_object_unref (opart);
@@ -1526,6 +1546,7 @@ emf_multipart_appledouble (EMFormat *emf,
CamelStream *stream,
CamelMimePart *part,
const EMFormatHandler *info,
+ GCancellable *cancellable,
gboolean is_fallback)
{
CamelMultipart *mp = (CamelMultipart *)camel_medium_get_content ((CamelMedium *)part);
@@ -1542,7 +1563,7 @@ emf_multipart_appledouble (EMFormat *emf,
/* try the data fork for something useful, doubtful but who knows */
len = emf->part_id->len;
g_string_append_printf(emf->part_id, ".appledouble.1");
- em_format_part (emf, stream, mime_part);
+ em_format_part (emf, stream, mime_part, cancellable);
g_string_truncate (emf->part_id, len);
} else
em_format_format_source (emf, stream, part);
@@ -1555,6 +1576,7 @@ emf_multipart_mixed (EMFormat *emf,
CamelStream *stream,
CamelMimePart *part,
const EMFormatHandler *info,
+ GCancellable *cancellable,
gboolean is_fallback)
{
CamelMultipart *mp = (CamelMultipart *)camel_medium_get_content ((CamelMedium *)part);
@@ -1570,7 +1592,7 @@ emf_multipart_mixed (EMFormat *emf,
for (i = 0; i < nparts; i++) {
part = camel_multipart_get_part (mp, i);
g_string_append_printf(emf->part_id, ".mixed.%d", i);
- em_format_part (emf, stream, part);
+ em_format_part (emf, stream, part, cancellable);
g_string_truncate (emf->part_id, len);
}
}
@@ -1581,6 +1603,7 @@ emf_multipart_alternative (EMFormat *emf,
CamelStream *stream,
CamelMimePart *part,
const EMFormatHandler *info,
+ GCancellable *cancellable,
gboolean is_fallback)
{
CamelMultipart *mp = (CamelMultipart *)camel_medium_get_content ((CamelMedium *)part);
@@ -1626,10 +1649,11 @@ emf_multipart_alternative (EMFormat *emf,
gint len = emf->part_id->len;
g_string_append_printf(emf->part_id, ".alternative.%d", bestid);
- em_format_part (emf, stream, best);
+ em_format_part (emf, stream, best, cancellable);
g_string_truncate (emf->part_id, len);
} else
- emf_multipart_mixed (emf, stream, part, info, is_fallback);
+ emf_multipart_mixed (
+ emf, stream, part, info, cancellable, is_fallback);
}
static void
@@ -1637,6 +1661,7 @@ emf_multipart_encrypted (EMFormat *emf,
CamelStream *stream,
CamelMimePart *part,
const EMFormatHandler *info,
+ GCancellable *cancellable,
gboolean is_fallback)
{
CamelCipherContext *context;
@@ -1652,7 +1677,8 @@ emf_multipart_encrypted (EMFormat *emf,
if (emfc && emfc->valid) {
em_format_format_secure (
emf, stream, emfc->secured,
- camel_cipher_validity_clone (emfc->valid));
+ camel_cipher_validity_clone (emfc->valid),
+ cancellable);
return;
}
@@ -1671,7 +1697,9 @@ emf_multipart_encrypted (EMFormat *emf,
em_format_format_error (
emf, stream, _("Unsupported encryption "
"type for multipart/encrypted"));
- em_format_part_as (emf, stream, part, "multipart/mixed");
+ em_format_part_as (
+ emf, stream, part,
+ "multipart/mixed", cancellable);
return;
}
@@ -1681,7 +1709,8 @@ emf_multipart_encrypted (EMFormat *emf,
context = camel_gpg_context_new (emf->session);
opart = camel_mime_part_new ();
- valid = camel_cipher_decrypt (context, part, opart, &local_error);
+ valid = camel_cipher_decrypt (
+ context, part, opart, cancellable, &local_error);
if (valid == NULL) {
em_format_format_error (
emf, stream, local_error->message ?
@@ -1692,7 +1721,9 @@ emf_multipart_encrypted (EMFormat *emf,
emf, stream, "%s", local_error->message);
g_clear_error (&local_error);
- em_format_part_as(emf, stream, part, "multipart/mixed");
+ em_format_part_as (
+ emf, stream, part,
+ "multipart/mixed", cancellable);
} else {
if (emfc == NULL)
emfc = emf_insert_cache (emf, emf->part_id->str);
@@ -1701,7 +1732,8 @@ emf_multipart_encrypted (EMFormat *emf,
g_object_ref ((emfc->secured = opart));
add_validity_found (emf, valid);
- em_format_format_secure (emf, stream, opart, valid);
+ em_format_format_secure (
+ emf, stream, opart, valid, cancellable);
}
/* TODO: Make sure when we finalize this part, it is zero'd out */
@@ -1712,9 +1744,10 @@ emf_multipart_encrypted (EMFormat *emf,
static void
emf_write_related (EMFormat *emf,
CamelStream *stream,
- EMFormatPURI *puri)
+ EMFormatPURI *puri,
+ GCancellable *cancellable)
{
- em_format_format_content (emf, stream, puri->part);
+ em_format_format_content (emf, stream, puri->part, cancellable);
camel_stream_close (stream, NULL);
}
@@ -1724,6 +1757,7 @@ emf_multipart_related (EMFormat *emf,
CamelStream *stream,
CamelMimePart *part,
const EMFormatHandler *info,
+ GCancellable *cancellable,
gboolean is_fallback)
{
CamelMultipart *mp = (CamelMultipart *)camel_medium_get_content ((CamelMedium *)part);
@@ -1766,7 +1800,8 @@ emf_multipart_related (EMFormat *emf,
}
if (display_part == NULL) {
- emf_multipart_mixed (emf, stream, part, info, is_fallback);
+ emf_multipart_mixed (
+ emf, stream, part, info, cancellable, is_fallback);
return;
}
@@ -1792,7 +1827,7 @@ emf_multipart_related (EMFormat *emf,
}
g_string_append_printf(emf->part_id, ".related.%d", displayid);
- em_format_part (emf, stream, display_part);
+ em_format_part (emf, stream, display_part, cancellable);
g_string_truncate (emf->part_id, partidlen);
camel_stream_flush (stream, NULL);
@@ -1804,7 +1839,8 @@ emf_multipart_related (EMFormat *emf,
if (puri->use_count == 0) {
if (puri->func == emf_write_related) {
g_string_printf(emf->part_id, "%s", puri->part_id);
- em_format_part (emf, stream, puri->part);
+ em_format_part (
+ emf, stream, puri->part, cancellable);
}
}
@@ -1822,6 +1858,7 @@ emf_multipart_signed (EMFormat *emf,
CamelStream *stream,
CamelMimePart *part,
const EMFormatHandler *info,
+ GCancellable *cancellable,
gboolean is_fallback)
{
CamelMimePart *cpart;
@@ -1834,7 +1871,8 @@ emf_multipart_signed (EMFormat *emf,
if (emfc && emfc->valid) {
em_format_format_secure (
emf, stream, emfc->secured,
- camel_cipher_validity_clone (emfc->valid));
+ camel_cipher_validity_clone (emfc->valid),
+ cancellable);
return;
}
@@ -1869,12 +1907,15 @@ emf_multipart_signed (EMFormat *emf,
if (cipher == NULL) {
em_format_format_error(emf, stream, _("Unsupported signature format"));
- em_format_part_as(emf, stream, part, "multipart/mixed");
+ em_format_part_as (
+ emf, stream, part,
+ "multipart/mixed", cancellable);
} else {
CamelCipherValidity *valid;
GError *local_error = NULL;
- valid = camel_cipher_verify (cipher, part, &local_error);
+ valid = camel_cipher_verify (
+ cipher, part, cancellable, &local_error);
if (valid == NULL) {
em_format_format_error (
emf, stream, local_error->message ?
@@ -1886,7 +1927,9 @@ emf_multipart_signed (EMFormat *emf,
local_error->message);
g_clear_error (&local_error);
- em_format_part_as(emf, stream, part, "multipart/mixed");
+ em_format_part_as (
+ emf, stream, part,
+ "multipart/mixed", cancellable);
} else {
if (emfc == NULL)
emfc = emf_insert_cache (emf, emf->part_id->str);
@@ -1895,7 +1938,8 @@ emf_multipart_signed (EMFormat *emf,
g_object_ref ((emfc->secured = cpart));
add_validity_found (emf, valid);
- em_format_format_secure (emf, stream, cpart, valid);
+ em_format_format_secure (
+ emf, stream, cpart, valid, cancellable);
}
g_object_unref (cipher);
@@ -1908,6 +1952,7 @@ emf_application_mbox (EMFormat *emf,
CamelStream *stream,
CamelMimePart *mime_part,
const EMFormatHandler *info,
+ GCancellable *cancellable,
gboolean is_fallback)
{
const EMFormatHandler *handle;
@@ -1958,7 +2003,9 @@ emf_application_mbox (EMFormat *emf,
}
/* Render the message. */
- handle->handler (emf, stream, mime_part, handle, FALSE);
+ handle->handler (
+ emf, stream, mime_part,
+ handle, cancellable, FALSE);
g_object_unref (message);
@@ -1976,6 +2023,7 @@ emf_message_rfc822 (EMFormat *emf,
CamelStream *stream,
CamelMimePart *part,
const EMFormatHandler *info,
+ GCancellable *cancellable,
gboolean is_fallback)
{
CamelDataWrapper *dw = camel_medium_get_content ((CamelMedium *)part);
@@ -1992,7 +2040,9 @@ emf_message_rfc822 (EMFormat *emf,
handle = em_format_find_handler(emf, "x-evolution/message/rfc822");
if (handle)
- handle->handler (emf, stream, (CamelMimePart *)dw, handle, FALSE);
+ handle->handler (
+ emf, stream, CAMEL_MIME_PART (dw),
+ handle, cancellable, FALSE);
g_string_truncate (emf->part_id, len);
}
@@ -2002,6 +2052,7 @@ emf_message_deliverystatus (EMFormat *emf,
CamelStream *stream,
CamelMimePart *part,
const EMFormatHandler *info,
+ GCancellable *cancellable,
gboolean is_fallback)
{
em_format_format_text (emf, stream, (CamelDataWrapper *)part);
@@ -2012,6 +2063,7 @@ emf_inlinepgp_signed (EMFormat *emf,
CamelStream *stream,
CamelMimePart *ipart,
const EMFormatHandler *info,
+ GCancellable *cancellable,
gboolean is_fallback)
{
CamelStream *filtered_stream;
@@ -2034,7 +2086,7 @@ emf_inlinepgp_signed (EMFormat *emf,
cipher = camel_gpg_context_new (emf->session);
/* Verify the signature of the message */
- valid = camel_cipher_verify (cipher, ipart, &local_error);
+ valid = camel_cipher_verify (cipher, ipart, cancellable, &local_error);
if (!valid) {
em_format_format_error (
emf, stream, local_error->message ?
@@ -2093,7 +2145,7 @@ emf_inlinepgp_signed (EMFormat *emf,
add_validity_found (emf, valid);
/* Pass it off to the real formatter */
- em_format_format_secure (emf, stream, opart, valid);
+ em_format_format_secure (emf, stream, opart, valid, cancellable);
/* Clean Up */
g_object_unref (dw);
@@ -2107,12 +2159,14 @@ emf_inlinepgp_encrypted (EMFormat *emf,
CamelStream *stream,
CamelMimePart *ipart,
const EMFormatHandler *info,
+ GCancellable *cancellable,
gboolean is_fallback)
{
CamelCipherContext *cipher;
CamelCipherValidity *valid;
CamelMimePart *opart;
CamelDataWrapper *dw;
+ CamelOperation *operation;
gchar *mime_type;
GError *local_error = NULL;
@@ -2122,8 +2176,19 @@ emf_inlinepgp_encrypted (EMFormat *emf,
cipher = camel_gpg_context_new (emf->session);
opart = camel_mime_part_new ();
+
/* Decrypt the message */
- valid = camel_cipher_decrypt (cipher, ipart, opart, &local_error);
+ operation = camel_operation_registered ();
+ if (operation != NULL)
+ camel_operation_start (operation, _("Decrypting message"));
+ valid = camel_cipher_decrypt (
+ cipher, ipart, opart,
+ G_CANCELLABLE (operation), &local_error);
+ if (operation != NULL) {
+ camel_operation_end (operation);
+ g_object_unref (operation);
+ }
+
if (!valid) {
em_format_format_error (
emf, stream, _("Could not parse PGP message: "));
@@ -2157,7 +2222,7 @@ emf_inlinepgp_encrypted (EMFormat *emf,
add_validity_found (emf, valid);
/* Pass it off to the real formatter */
- em_format_format_secure (emf, stream, opart, valid);
+ em_format_format_secure (emf, stream, opart, valid, cancellable);
/* Clean Up */
g_object_unref (opart);
diff --git a/em-format/em-format.h b/em-format/em-format.h
index 2bb9ea1099..64f1d5fbea 100644
--- a/em-format/em-format.h
+++ b/em-format/em-format.h
@@ -63,6 +63,7 @@ typedef void (*EMFormatFunc) (EMFormat *emf,
CamelStream *stream,
CamelMimePart *mime_part,
const EMFormatHandler *info,
+ GCancellable *cancellable,
gboolean is_fallback);
typedef enum {
@@ -106,7 +107,8 @@ struct _EMFormatHandler {
typedef struct _EMFormatPURI EMFormatPURI;
typedef void (*EMFormatPURIFunc) (EMFormat *emf,
CamelStream *stream,
- EMFormatPURI *puri);
+ EMFormatPURI *puri,
+ GCancellable *cancellable);
/**
* struct _EMFormatPURI - Pending URI object.
@@ -252,7 +254,8 @@ struct _EMFormatClass {
CamelFolder *folder,
const gchar *uid,
CamelMimeMessage *message,
- EMFormat *source);
+ EMFormat *source,
+ GCancellable *cancellable);
/* some internel error/inconsistency */
void (*format_error) (EMFormat *emf,
@@ -264,7 +267,8 @@ struct _EMFormatClass {
CamelStream *stream,
CamelMimePart *mime_part,
const gchar *mime_type,
- const EMFormatHandler *info);
+ const EMFormatHandler *info,
+ GCancellable *cancellable);
/* use for unparsable content */
void (*format_source) (EMFormat *emf,
@@ -274,7 +278,8 @@ struct _EMFormatClass {
void (*format_secure) (EMFormat *emf,
CamelStream *stream,
CamelMimePart *mime_part,
- CamelCipherValidity *validity);
+ CamelCipherValidity *validity,
+ GCancellable *cancellable);
/* returns true if the formatter is still busy with pending stuff */
gboolean (*busy) (EMFormat *);
@@ -360,19 +365,22 @@ void em_format_format_clone (EMFormat *emf,
CamelFolder *folder,
const gchar *uid,
CamelMimeMessage *message,
- EMFormat *source);
+ EMFormat *source,
+ GCancellable *cancellable);
/* formats a new message */
void em_format_format (EMFormat *emf,
CamelFolder *folder,
const gchar *uid,
- CamelMimeMessage *message);
+ CamelMimeMessage *message,
+ GCancellable *cancellable);
void em_format_queue_redraw (EMFormat *emf);
void em_format_format_attachment (EMFormat *emf,
CamelStream *stream,
CamelMimePart *mime_part,
const gchar *mime_type,
- const EMFormatHandler *info);
+ const EMFormatHandler *info,
+ GCancellable *cancellable);
void em_format_format_error (EMFormat *emf,
CamelStream *stream,
const gchar *format,
@@ -380,7 +388,8 @@ void em_format_format_error (EMFormat *emf,
void em_format_format_secure (EMFormat *emf,
CamelStream *stream,
CamelMimePart *mime_part,
- CamelCipherValidity *valid);
+ CamelCipherValidity *valid,
+ GCancellable *cancellable);
void em_format_format_source (EMFormat *emf,
CamelStream *stream,
CamelMimePart *mime_part);
@@ -390,7 +399,8 @@ gboolean em_format_busy (EMFormat *emf);
/* raw content only */
void em_format_format_content (EMFormat *emf,
CamelStream *stream,
- CamelMimePart *part);
+ CamelMimePart *part,
+ GCancellable *cancellable);
/* raw content text parts - should this just be checked/done by above? */
void em_format_format_text (EMFormat *emf,
@@ -400,10 +410,12 @@ void em_format_format_text (EMFormat *emf,
void em_format_part_as (EMFormat *emf,
CamelStream *stream,
CamelMimePart *part,
- const gchar *mime_type);
+ const gchar *mime_type,
+ GCancellable *cancellable);
void em_format_part (EMFormat *emf,
CamelStream *stream,
- CamelMimePart *part);
+ CamelMimePart *mime_part,
+ GCancellable *cancellable);
void em_format_merge_handler (EMFormat *new,
EMFormat *old);
diff --git a/mail/e-mail-backend.c b/mail/e-mail-backend.c
index 3bc822cf0b..690181d87b 100644
--- a/mail/e-mail-backend.c
+++ b/mail/e-mail-backend.c
@@ -153,7 +153,8 @@ mail_backend_delete_junk (CamelStore *store,
guint32 mask;
guint ii;
- folder = camel_store_get_junk (store, NULL);
+ /* FIXME camel_store_get_junk() may block. */
+ folder = camel_store_get_junk (store, NULL, NULL);
if (folder == NULL)
return;
diff --git a/mail/e-mail-local.c b/mail/e-mail-local.c
index 7b825c4240..f0ad740f92 100644
--- a/mail/e-mail-local.c
+++ b/mail/e-mail-local.c
@@ -81,10 +81,11 @@ e_mail_local_init (const gchar *data_dir)
camel_url_set_fragment (url, display_name);
folder_uri = camel_url_to_string (url, 0);
+ /* FIXME camel_store_get_folder() may block. */
default_local_folders[ii].folder_uri = folder_uri;
default_local_folders[ii].folder = camel_store_get_folder (
CAMEL_STORE (service), display_name,
- CAMEL_STORE_FOLDER_CREATE, NULL);
+ CAMEL_STORE_FOLDER_CREATE, NULL, NULL);
}
camel_url_free (url);
diff --git a/mail/e-mail-migrate.c b/mail/e-mail-migrate.c
index 4208b380aa..360d3f6c69 100644
--- a/mail/e-mail-migrate.c
+++ b/mail/e-mail-migrate.c
@@ -556,9 +556,12 @@ migrate_folders (CamelStore *store,
g_idle_add ((GSourceFunc) update_states_in_main_thread, info);
if (is_local)
- folder = camel_store_get_folder (store, fi->full_name, CAMEL_STORE_IS_MIGRATING, NULL);
+ folder = camel_store_get_folder (
+ store, fi->full_name,
+ CAMEL_STORE_IS_MIGRATING, NULL, NULL);
else
- folder = camel_store_get_folder (store, fi->full_name, 0, NULL);
+ folder = camel_store_get_folder (
+ store, fi->full_name, 0, NULL, NULL);
if (folder != NULL)
camel_folder_summary_migrate_infos (folder->summary);
@@ -653,7 +656,12 @@ migrate_to_db (EShellBackend *shell_backend)
em_migrate_set_progress ( (double)i/(len+1));
store = setup_local_store (shell_backend, session);
- info = camel_store_get_folder_info (store, NULL, CAMEL_STORE_FOLDER_INFO_RECURSIVE|CAMEL_STORE_FOLDER_INFO_FAST|CAMEL_STORE_FOLDER_INFO_SUBSCRIBED, NULL);
+ info = camel_store_get_folder_info (
+ store, NULL,
+ CAMEL_STORE_FOLDER_INFO_RECURSIVE |
+ CAMEL_STORE_FOLDER_INFO_FAST |
+ CAMEL_STORE_FOLDER_INFO_SUBSCRIBED,
+ NULL, NULL);
if (info) {
struct migrate_folders_to_db_structure migrate_dbs;
@@ -689,7 +697,12 @@ migrate_to_db (EShellBackend *shell_backend)
e_mail_store_add_by_uri (service->url, name);
store = (CamelStore *) camel_session_get_service (CAMEL_SESSION (session), service->url, CAMEL_PROVIDER_STORE, NULL);
- info = camel_store_get_folder_info (store, NULL, CAMEL_STORE_FOLDER_INFO_RECURSIVE|CAMEL_STORE_FOLDER_INFO_FAST|CAMEL_STORE_FOLDER_INFO_SUBSCRIBED, NULL);
+ info = camel_store_get_folder_info (
+ store, NULL,
+ CAMEL_STORE_FOLDER_INFO_RECURSIVE |
+ CAMEL_STORE_FOLDER_INFO_FAST |
+ CAMEL_STORE_FOLDER_INFO_SUBSCRIBED,
+ NULL, NULL);
if (info) {
struct migrate_folders_to_db_structure migrate_dbs;
diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c
index 8317898dd6..4c320ff9f6 100644
--- a/mail/e-mail-reader-utils.c
+++ b/mail/e-mail-reader-utils.c
@@ -153,6 +153,7 @@ e_mail_reader_mark_as_read (EMailReader *reader,
mask = CAMEL_MESSAGE_SEEN;
set = CAMEL_MESSAGE_SEEN;
+
camel_folder_set_message_flags (folder, uid, mask, set);
}
@@ -180,6 +181,7 @@ e_mail_reader_mark_selected (EMailReader *reader,
folder, uids->pdata[ii], mask, set);
em_utils_uids_free (uids);
+
camel_folder_thaw (folder);
return ii;
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 68cae17828..9eda80a5a5 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -1353,6 +1353,7 @@ action_mail_toggle_important_cb (GtkAction *action,
flags ^= CAMEL_MESSAGE_FLAGGED;
if (flags & CAMEL_MESSAGE_FLAGGED)
flags &= ~CAMEL_MESSAGE_DELETED;
+
camel_folder_set_message_flags (
folder, uids->pdata[ii], CAMEL_MESSAGE_FLAGGED |
CAMEL_MESSAGE_DELETED, flags);
@@ -2233,8 +2234,10 @@ mail_reader_message_loaded_cb (CamelFolder *folder,
(EEvent *) event, "message.reading",
(EEventTarget *) target);
+ /* FIXME Need to pass a GCancellable. */
em_format_format (
- EM_FORMAT (formatter), folder, message_uid, message);
+ EM_FORMAT (formatter), folder,
+ message_uid, message, NULL);
/* Reset the shell view icon. */
e_shell_event (shell, "mail-icon", (gpointer) "evolution-mail");
@@ -2355,7 +2358,9 @@ mail_reader_message_selected_timeout_cb (EMailReader *reader)
priv->retrieving_message_operation_id = op_id;
}
} else {
- em_format_format (EM_FORMAT (formatter), NULL, NULL, NULL);
+ /* FIXME Need to pass a GCancellable. */
+ em_format_format (
+ EM_FORMAT (formatter), NULL, NULL, NULL, NULL);
priv->restoring_message_selection = FALSE;
}
@@ -2490,7 +2495,8 @@ mail_reader_set_folder (EMailReader *reader,
em_utils_folder_is_outbox (folder, folder_uri) ||
em_utils_folder_is_sent (folder, folder_uri));
- em_format_format (EM_FORMAT (formatter), NULL, NULL, NULL);
+ /* FIXME Need to pass a GCancellable. */
+ em_format_format (EM_FORMAT (formatter), NULL, NULL, NULL, NULL);
priv->folder_was_just_selected = (folder != NULL);
diff --git a/mail/e-mail-store.c b/mail/e-mail-store.c
index a8c3afe6ec..ea524ad5e2 100644
--- a/mail/e-mail-store.c
+++ b/mail/e-mail-store.c
@@ -86,9 +86,9 @@ store_info_new (CamelStore *store,
/* If these are vfolders then they need to be opened now,
* otherwise they won't keep track of all folders. */
if (store->flags & CAMEL_STORE_VTRASH)
- store_info->vtrash = camel_store_get_trash (store, NULL);
+ store_info->vtrash = camel_store_get_trash (store, NULL, NULL);
if (store->flags & CAMEL_STORE_VJUNK)
- store_info->vjunk = camel_store_get_junk (store, NULL);
+ store_info->vjunk = camel_store_get_junk (store, NULL, NULL);
return store_info;
}
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index 52d3c7e99a..01964d5fcd 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -229,9 +229,10 @@ composer_send_queued_cb (CamelFolder *folder, CamelMimeMessage *msg, CamelMessag
if (queued) {
if (emcs && emcs->drafts_folder) {
/* delete the old draft message */
- camel_folder_set_message_flags (emcs->drafts_folder, emcs->drafts_uid,
- CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_SEEN,
- CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_SEEN);
+ camel_folder_set_message_flags (
+ emcs->drafts_folder, emcs->drafts_uid,
+ CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_SEEN,
+ CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_SEEN);
g_object_unref (emcs->drafts_folder);
emcs->drafts_folder = NULL;
g_free (emcs->drafts_uid);
@@ -240,8 +241,12 @@ composer_send_queued_cb (CamelFolder *folder, CamelMimeMessage *msg, CamelMessag
if (emcs && emcs->folder) {
/* set any replied flags etc */
- camel_folder_set_message_flags (emcs->folder, emcs->uid, emcs->flags, emcs->set);
- camel_folder_set_message_user_flag (emcs->folder, emcs->uid, "receipt-handled", TRUE);
+ camel_folder_set_message_flags (
+ emcs->folder, emcs->uid,
+ emcs->flags, emcs->set);
+ camel_folder_set_message_user_flag (
+ emcs->folder, emcs->uid,
+ "receipt-handled", TRUE);
g_object_unref (emcs->folder);
emcs->folder = NULL;
g_free (emcs->uid);
@@ -542,6 +547,7 @@ em_utils_composer_send_cb (EMsgComposer *composer)
/* mail the message */
e_msg_composer_set_mail_sent (composer, TRUE);
info = camel_message_info_new (NULL);
+
camel_message_info_set_flags (info, CAMEL_MESSAGE_SEEN, ~0);
send = g_malloc (sizeof (*send));
@@ -593,9 +599,10 @@ save_draft_done (CamelFolder *folder, CamelMimeMessage *msg, CamelMessageInfo *i
if (emcs->drafts_folder) {
/* delete the original draft message */
- camel_folder_set_message_flags (emcs->drafts_folder, emcs->drafts_uid,
- CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_SEEN,
- CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_SEEN);
+ camel_folder_set_message_flags (
+ emcs->drafts_folder, emcs->drafts_uid,
+ CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_SEEN,
+ CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_SEEN);
g_object_unref (emcs->drafts_folder);
emcs->drafts_folder = NULL;
g_free (emcs->drafts_uid);
@@ -604,7 +611,9 @@ save_draft_done (CamelFolder *folder, CamelMimeMessage *msg, CamelMessageInfo *i
if (emcs->folder) {
/* set the replied flags etc */
- camel_folder_set_message_flags (emcs->folder, emcs->uid, emcs->flags, emcs->set);
+ camel_folder_set_message_flags (
+ emcs->folder, emcs->uid,
+ emcs->flags, emcs->set);
g_object_unref (emcs->folder);
emcs->folder = NULL;
g_free (emcs->uid);
@@ -717,7 +726,9 @@ em_utils_composer_save_draft_cb (EMsgComposer *composer)
}
info = camel_message_info_new (NULL);
- camel_message_info_set_flags (info, CAMEL_MESSAGE_DRAFT | CAMEL_MESSAGE_SEEN, ~0);
+
+ camel_message_info_set_flags (
+ info, CAMEL_MESSAGE_DRAFT | CAMEL_MESSAGE_SEEN, ~0);
mail_append_mail (folder, msg, info, save_draft_done, sdi);
g_object_unref (folder);
@@ -1142,7 +1153,9 @@ static void
real_update_forwarded_flag (gpointer uid, gpointer folder)
{
if (uid && folder)
- camel_folder_set_message_flags (folder, uid, CAMEL_MESSAGE_FORWARDED, CAMEL_MESSAGE_FORWARDED);
+ camel_folder_set_message_flags (
+ folder, uid, CAMEL_MESSAGE_FORWARDED,
+ CAMEL_MESSAGE_FORWARDED);
}
static void
@@ -1796,7 +1809,8 @@ em_utils_send_receipt (CamelFolder *folder, CamelMimeMessage *message)
/* Send the receipt */
info = camel_message_info_new (NULL);
out_folder = e_mail_local_get_folder (E_MAIL_FOLDER_OUTBOX);
- camel_message_info_set_flags (info, CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN);
+ camel_message_info_set_flags (
+ info, CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN);
mail_append_mail (out_folder, receipt, info, em_utils_receipt_done, NULL);
}
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c
index 1c0e00d508..3d1bb68265 100644
--- a/mail/em-folder-tree.c
+++ b/mail/em-folder-tree.c
@@ -201,7 +201,8 @@ folder_tree_get_folder_info__exec (struct _EMFolderTreeGetFolderInfo *m)
guint32 flags = m->flags | CAMEL_STORE_FOLDER_INFO_SUBSCRIBED;
m->fi = camel_store_get_folder_info (
- m->store, m->top, flags, &m->base.error);
+ m->store, m->top, flags,
+ m->base.cancellable, &m->base.error);
/* XXX POP3 stores always return an error because they have
* no folder hierarchy to scan. Clear that error so the
@@ -623,8 +624,10 @@ folder_tree_cell_edited_cb (EMFolderTree *folder_tree,
g_strfreev (strv);
/* Check for duplicate folder name. */
+ /* FIXME camel_store_get_folder_info() may block. */
folder_info = camel_store_get_folder_info (
- store, new_full_name, CAMEL_STORE_FOLDER_INFO_FAST, NULL);
+ store, new_full_name,
+ CAMEL_STORE_FOLDER_INFO_FAST, NULL, NULL);
if (folder_info != NULL) {
e_alert_run_dialog_for_args (
parent, "mail:no-rename-folder-exists",
@@ -633,9 +636,9 @@ folder_tree_cell_edited_cb (EMFolderTree *folder_tree,
goto exit;
}
- /* XXX This needs to be asynchronous. */
+ /* FIXME camel_store_rename_folder() may block. */
if (!camel_store_rename_folder (
- store, old_full_name, new_full_name, &local_error)) {
+ store, old_full_name, new_full_name, NULL, &local_error)) {
e_alert_run_dialog_for_args (
parent, "mail:no-rename-folder",
old_full_name, new_full_name,
@@ -1528,7 +1531,8 @@ tree_drag_data_delete (GtkWidget *widget,
if (is_store)
goto fail;
- camel_store_delete_folder (store, full_name, NULL);
+ /* FIXME camel_store_delete_folder() may block. */
+ camel_store_delete_folder (store, full_name, NULL, NULL);
fail:
gtk_tree_path_free (src_path);
@@ -1578,7 +1582,10 @@ tree_drag_data_get (GtkWidget *widget,
break;
case DND_DRAG_TYPE_TEXT_URI_LIST:
/* dragging to nautilus or something, probably */
- if ((folder = camel_store_get_folder (store, full_name, 0, NULL))) {
+ /* FIXME camel_store_get_folder() may block. */
+ if ((folder = camel_store_get_folder (
+ store, full_name, 0, NULL, NULL))) {
+
GPtrArray *uids = camel_folder_get_uids (folder);
em_utils_selection_set_urilist (selection, folder, uids);
@@ -1628,7 +1635,8 @@ folder_tree_drop_folder (struct _DragDataReceivedAsync *m)
d(printf(" * Drop folder '%s' onto '%s'\n", data, m->full_name));
- if (!(folder = mail_tool_uri_to_folder ((gchar *)data, 0, &m->base.error)))
+ if (!(folder = mail_tool_uri_to_folder (
+ (gchar *)data, 0, m->base.cancellable, &m->base.error)))
return;
full_name = camel_folder_get_full_name (folder);
@@ -1691,11 +1699,15 @@ folder_tree_drop_async__exec (struct _DragDataReceivedAsync *m)
&m->base.error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
_("Cannot drop message(s) into toplevel store"));
} else if ((folder = camel_store_get_folder (
- m->store, m->full_name, 0, &m->base.error))) {
+ m->store, m->full_name, 0,
+ m->base.cancellable, &m->base.error))) {
+
switch (m->info) {
case DND_DROP_TYPE_UID_LIST:
/* import a list of uids from another evo folder */
- em_utils_selection_get_uidlist (m->selection, folder, m->move, &m->base.error);
+ em_utils_selection_get_uidlist (
+ m->selection, folder, m->move,
+ m->base.cancellable, &m->base.error);
m->moved = m->move && (m->base.error == NULL);
break;
case DND_DROP_TYPE_MESSAGE_RFC822:
@@ -2798,9 +2810,11 @@ em_folder_tree_get_selected_folder (EMFolderTree *folder_tree)
gtk_tree_model_get (model, &iter, COL_POINTER_CAMEL_STORE, &store,
COL_STRING_FULL_NAME, &full_name, -1);
+ /* FIXME camel_store_get_folder() may block. */
if (store && full_name)
folder = camel_store_get_folder (
- store, full_name, CAMEL_STORE_FOLDER_INFO_FAST, NULL);
+ store, full_name,
+ CAMEL_STORE_FOLDER_INFO_FAST, NULL, NULL);
g_free (full_name);
diff --git a/mail/em-folder-utils.c b/mail/em-folder-utils.c
index 5bcc0326b6..201a0b9fb0 100644
--- a/mail/em-folder-utils.c
+++ b/mail/em-folder-utils.c
@@ -105,7 +105,8 @@ emft_copy_folders__exec (struct _EMCopyFolders *m)
gint fromlen;
fi = camel_store_get_folder_info (
- m->fromstore, m->frombase, flags, &m->base.error);
+ m->fromstore, m->frombase, flags,
+ m->base.cancellable, &m->base.error);
if (fi == NULL)
return;
@@ -147,26 +148,28 @@ emft_copy_folders__exec (struct _EMCopyFolders *m)
d(printf ("this folder is selectable\n"));
if (m->tostore == m->fromstore && m->delete) {
camel_store_rename_folder (
- m->fromstore, info->full_name,
- toname->str, &m->base.error);
+ m->fromstore, info->full_name, toname->str,
+ m->base.cancellable, &m->base.error);
if (m->base.error != NULL)
goto exception;
/* this folder no longer exists, unsubscribe it */
if (camel_store_supports_subscriptions (m->fromstore))
- camel_store_unsubscribe_folder (m->fromstore, info->full_name, NULL);
+ camel_store_unsubscribe_folder (
+ m->fromstore, info->full_name, NULL, NULL);
deleted = 1;
} else {
fromfolder = camel_store_get_folder (
- m->fromstore, info->full_name,
- 0, &m->base.error);
+ m->fromstore, info->full_name, 0,
+ m->base.cancellable, &m->base.error);
if (fromfolder == NULL)
goto exception;
tofolder = camel_store_get_folder (
m->tostore, toname->str,
CAMEL_STORE_FOLDER_CREATE,
+ m->base.cancellable,
&m->base.error);
if (tofolder == NULL) {
g_object_unref (fromfolder);
@@ -176,11 +179,15 @@ emft_copy_folders__exec (struct _EMCopyFolders *m)
uids = camel_folder_get_uids (fromfolder);
camel_folder_transfer_messages_to (
fromfolder, uids, tofolder,
- NULL, m->delete, &m->base.error);
+ NULL, m->delete,
+ m->base.cancellable,
+ &m->base.error);
camel_folder_free_uids (fromfolder, uids);
if (m->delete && m->base.error == NULL)
- camel_folder_sync (fromfolder, TRUE, NULL);
+ camel_folder_sync (
+ fromfolder, TRUE,
+ NULL, NULL);
g_object_unref (fromfolder);
g_object_unref (tofolder);
@@ -195,7 +202,8 @@ emft_copy_folders__exec (struct _EMCopyFolders *m)
/* subscribe to the new folder if appropriate */
if (camel_store_supports_subscriptions (m->tostore)
&& !camel_store_folder_is_subscribed (m->tostore, toname->str))
- camel_store_subscribe_folder (m->tostore, toname->str, NULL);
+ camel_store_subscribe_folder (
+ m->tostore, toname->str, NULL, NULL);
info = info->next;
}
@@ -212,9 +220,11 @@ emft_copy_folders__exec (struct _EMCopyFolders *m)
since otherwise the users sees a failed operation
with no error message or even any warnings */
if (camel_store_supports_subscriptions (m->fromstore))
- camel_store_unsubscribe_folder (m->fromstore, info->full_name, NULL);
+ camel_store_unsubscribe_folder (
+ m->fromstore, info->full_name, NULL, NULL);
- camel_store_delete_folder (m->fromstore, info->full_name, NULL);
+ camel_store_delete_folder (
+ m->fromstore, info->full_name, NULL, NULL);
l = l->next;
}
@@ -538,9 +548,14 @@ emfu_create_folder__exec (struct _EMCreateFolder *m)
{
d(printf ("creating folder parent='%s' name='%s' full_name='%s'\n", m->parent, m->name, m->full_name));
- if ((m->fi = camel_store_create_folder (m->store, m->parent, m->name, &m->base.error))) {
+ if ((m->fi = camel_store_create_folder (
+ m->store, m->parent, m->name,
+ m->base.cancellable, &m->base.error))) {
+
if (camel_store_supports_subscriptions (m->store))
- camel_store_subscribe_folder (m->store, m->full_name, &m->base.error);
+ camel_store_subscribe_folder (
+ m->store, m->full_name,
+ m->base.cancellable, &m->base.error);
}
}
@@ -736,7 +751,9 @@ emfu_unsubscribe_folder__exec (struct _folder_unsub_t *msg)
path = url->path + 1;
if (path != NULL)
- camel_store_unsubscribe_folder (store, path, &msg->base.error);
+ camel_store_unsubscribe_folder (
+ store, path, msg->base.cancellable,
+ &msg->base.error);
camel_url_free (url);
}
diff --git a/mail/em-format-hook.c b/mail/em-format-hook.c
index 5bc81aa2b4..c8a8c903a1 100644
--- a/mail/em-format-hook.c
+++ b/mail/em-format-hook.c
@@ -67,6 +67,7 @@ emfh_format_format (EMFormat *md,
CamelStream *stream,
CamelMimePart *part,
const EMFormatHandler *info,
+ GCancellable *cancellable,
gboolean is_fallback)
{
struct _EMFormatHookItem *item = (EMFormatHookItem *)info;
@@ -78,7 +79,8 @@ emfh_format_format (EMFormat *md,
e_plugin_invoke (item->hook->hook.plugin, item->format, &target);
} else if (info->old) {
- info->old->handler (md, stream, part, info->old, FALSE);
+ info->old->handler (
+ md, stream, part, info->old, cancellable, FALSE);
}
}
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c
index aab7ef84c2..d68b1f2508 100644
--- a/mail/em-format-html-display.c
+++ b/mail/em-format-html-display.c
@@ -108,7 +108,7 @@ static const gchar *smime_sign_colour[5] = {
"", " bgcolor=\"#88bb88\"", " bgcolor=\"#bb8888\"", " bgcolor=\"#e8d122\"",""
};
-static void efhd_attachment_frame (EMFormat *emf, CamelStream *stream, EMFormatPURI *puri);
+static void efhd_attachment_frame (EMFormat *emf, CamelStream *stream, EMFormatPURI *puri, GCancellable *cancellable);
static void efhd_message_add_bar (EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info);
static gboolean efhd_attachment_button (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *pobject);
static gboolean efhd_attachment_optional (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *object);
@@ -384,14 +384,15 @@ efhd_format_clone (EMFormat *emf,
CamelFolder *folder,
const gchar *uid,
CamelMimeMessage *msg,
- EMFormat *src)
+ EMFormat *src,
+ GCancellable *cancellable)
{
if (emf != src)
EM_FORMAT_HTML (emf)->header_wrap_flags = 0;
/* Chain up to parent's format_clone() method. */
EM_FORMAT_CLASS (parent_class)->
- format_clone (emf, folder, uid, msg, src);
+ format_clone (emf, folder, uid, msg, src, cancellable);
}
static void
@@ -399,7 +400,8 @@ efhd_format_attachment (EMFormat *emf,
CamelStream *stream,
CamelMimePart *part,
const gchar *mime_type,
- const EMFormatHandler *handle)
+ const EMFormatHandler *handle,
+ GCancellable *cancellable)
{
gchar *classid, *text, *html;
struct _attach_puri *info;
@@ -450,7 +452,8 @@ efhd_format_attachment (EMFormat *emf,
EM_FORMAT_HTML_VPAD, NULL);
if (handle && info->shown)
- handle->handler (emf, stream, part, handle, FALSE);
+ handle->handler (
+ emf, stream, part, handle, cancellable, FALSE);
g_free (classid);
}
@@ -519,12 +522,13 @@ static void
efhd_format_secure (EMFormat *emf,
CamelStream *stream,
CamelMimePart *part,
- CamelCipherValidity *valid)
+ CamelCipherValidity *valid,
+ GCancellable *cancellable)
{
EMFormatClass *format_class;
format_class = g_type_class_peek (EM_TYPE_FORMAT);
- format_class->format_secure (emf, stream, part, valid);
+ format_class->format_secure (emf, stream, part, valid, cancellable);
if (emf->valid == valid
&& (valid->encrypt.status != CAMEL_CIPHER_VALIDITY_ENCRYPT_NONE
@@ -674,7 +678,10 @@ efhd_builtin_init (EMFormatHTMLDisplayClass *efhc)
}
static void
-efhd_write_image (EMFormat *emf, CamelStream *stream, EMFormatPURI *puri)
+efhd_write_image (EMFormat *emf,
+ CamelStream *stream,
+ EMFormatPURI *puri,
+ GCancellable *cancellable)
{
CamelDataWrapper *dw = camel_medium_get_content ((CamelMedium *)puri->part);
@@ -857,13 +864,15 @@ efhd_attachment_button (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObj
static void
efhd_attachment_frame (EMFormat *emf,
CamelStream *stream,
- EMFormatPURI *puri)
+ EMFormatPURI *puri,
+ GCancellable *cancellable)
{
struct _attach_puri *info = (struct _attach_puri *)puri;
if (info->shown)
info->handle->handler (
- emf, stream, info->puri.part, info->handle, FALSE);
+ emf, stream, info->puri.part,
+ info->handle, cancellable, FALSE);
camel_stream_close (stream, NULL);
}
diff --git a/mail/em-format-html-print.c b/mail/em-format-html-print.c
index f7eb288fba..f67d3c7084 100644
--- a/mail/em-format-html-print.c
+++ b/mail/em-format-html-print.c
@@ -223,8 +223,10 @@ emfhp_complete (EMFormatHTMLPrint *efhp)
}
static void
-emfhp_got_message (CamelFolder *folder, const gchar *uid,
- CamelMimeMessage *msg, gpointer data)
+emfhp_got_message (CamelFolder *folder,
+ const gchar *uid,
+ CamelMimeMessage *msg,
+ gpointer data)
{
EMFormatHTMLPrint *efhp = data;
@@ -237,9 +239,11 @@ emfhp_got_message (CamelFolder *folder, const gchar *uid,
g_signal_connect (
efhp, "complete", G_CALLBACK (emfhp_complete), efhp);
+
+ /* FIXME Not passing a GCancellable here. */
em_format_format_clone (
(EMFormat *) efhp, folder, uid, msg,
- (EMFormat *) efhp->source);
+ (EMFormat *) efhp->source, NULL);
}
void
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index 327adc55e5..49a203b2eb 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -122,13 +122,24 @@ static void efh_url_requested (GtkHTML *html, const gchar *url, GtkHTMLStream *h
static gboolean efh_object_requested (GtkHTML *html, GtkHTMLEmbedded *eb, EMFormatHTML *efh);
static void efh_gtkhtml_destroy (GtkHTML *html, EMFormatHTML *efh);
-static void efh_format_message (EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info);
+static void efh_format_message (EMFormat *emf,
+ CamelStream *stream,
+ CamelMimePart *part,
+ const EMFormatHandler *info,
+ GCancellable *cancellable);
-static void efh_format_secure (EMFormat *emf, CamelStream *stream, CamelMimePart *part, CamelCipherValidity *valid);
+static void efh_format_secure (EMFormat *emf,
+ CamelStream *stream,
+ CamelMimePart *part,
+ CamelCipherValidity *valid,
+ GCancellable *cancellable);
-static void efh_builtin_init (EMFormatHTMLClass *efhc);
+static void efh_builtin_init (EMFormatHTMLClass *efhc);
-static void efh_write_image (EMFormat *emf, CamelStream *stream, EMFormatPURI *puri);
+static void efh_write_image (EMFormat *emf,
+ CamelStream *stream,
+ EMFormatPURI *puri,
+ GCancellable *cancellable);
static gpointer parent_class;
static CamelDataCache *emfh_http_cache;
@@ -159,7 +170,6 @@ efh_format_exec (struct _format_msg *m)
EMFormat *format;
struct _EMFormatHTMLJob *job;
GNode *puri_level;
- gint cancelled = FALSE;
CamelURL *base;
if (m->format->priv->web_view == NULL)
@@ -194,16 +204,18 @@ efh_format_exec (struct _format_msg *m)
if (handle != NULL)
handle->handler (
- format, (CamelStream *) m->estream,
- (CamelMimePart *) m->message, handle, FALSE);
+ format, CAMEL_STREAM (m->estream),
+ CAMEL_MIME_PART (m->message), handle,
+ m->base.cancellable, FALSE);
mime_type = "x-evolution/message/rfc822";
handle = em_format_find_handler (format, mime_type);
if (handle != NULL)
handle->handler (
- format, (CamelStream *) m->estream,
- (CamelMimePart *) m->message, handle, FALSE);
+ format, CAMEL_STREAM (m->estream),
+ CAMEL_MIME_PART (m->message), handle,
+ m->base.cancellable, FALSE);
}
camel_stream_flush ((CamelStream *)m->estream, NULL);
@@ -218,18 +230,14 @@ efh_format_exec (struct _format_msg *m)
g_mutex_unlock (m->format->priv->lock);
/* This is an implicit check to see if the gtkhtml has been destroyed */
- if (!cancelled)
- cancelled = m->format->priv->web_view == NULL;
-
- /* Now do an explicit check for user cancellation */
- if (!cancelled)
- cancelled = camel_operation_cancel_check (NULL);
+ if (m->format->priv->web_view == NULL)
+ g_cancellable_cancel (m->base.cancellable);
/* call jobs even if cancelled, so they can clean up resources */
format->pending_uri_level = job->puri_level;
if (job->base)
format->base = job->base;
- job->callback (job, cancelled);
+ job->callback (job, m->base.cancellable);
format->base = base;
/* clean up the job */
@@ -324,9 +332,10 @@ efh_format_timeout (struct _format_msg *m)
d(printf(" ready to go, firing off format thread\n"));
/* call super-class to kick it off */
+ /* FIXME Not passing a GCancellable here. */
EM_FORMAT_CLASS (parent_class)->format_clone (
EM_FORMAT (efh), m->folder, m->uid,
- m->message, m->format_source);
+ m->message, m->format_source, NULL);
em_format_html_clear_pobject (m->format);
/* FIXME: method off EMFormat? */
@@ -620,7 +629,8 @@ efh_format_clone (EMFormat *emf,
CamelFolder *folder,
const gchar *uid,
CamelMimeMessage *msg,
- EMFormat *emfsource)
+ EMFormat *emfsource,
+ GCancellable *cancellable)
{
EMFormatHTML *efh = EM_FORMAT_HTML (emf);
struct _format_msg *m;
@@ -714,7 +724,8 @@ efh_format_attachment (EMFormat *emf,
CamelStream *stream,
CamelMimePart *part,
const gchar *mime_type,
- const EMFormatHandler *handle)
+ const EMFormatHandler *handle,
+ GCancellable *cancellable)
{
gchar *text, *html;
@@ -743,7 +754,7 @@ efh_format_attachment (EMFormat *emf,
stream, "</font></td></tr><tr></table>", NULL);
if (handle && em_format_is_inline (emf, emf->part_id->str, part, handle))
- handle->handler (emf, stream, part, handle, FALSE);
+ handle->handler (emf, stream, part, handle, cancellable, FALSE);
}
static gboolean
@@ -1344,7 +1355,9 @@ em_format_html_clear_pobject (EMFormatHTML *emf)
}
struct _EMFormatHTMLJob *
-em_format_html_job_new (EMFormatHTML *emfh, void (*callback)(struct _EMFormatHTMLJob *job, gint cancelled), gpointer data)
+em_format_html_job_new (EMFormatHTML *emfh,
+ void (*callback) (struct _EMFormatHTMLJob *job, GCancellable *cancellable),
+ gpointer data)
{
struct _EMFormatHTMLJob *job = g_malloc0 (sizeof (*job));
@@ -1368,14 +1381,20 @@ em_format_html_job_queue (EMFormatHTML *emfh, struct _EMFormatHTMLJob *job)
/* ********************************************************************** */
-static void emfh_getpuri (struct _EMFormatHTMLJob *job, gint cancelled)
+static void
+emfh_getpuri (struct _EMFormatHTMLJob *job,
+ GCancellable *cancellable)
{
d(printf(" running getpuri task\n"));
- if (!cancelled)
- job->u.puri->func ((EMFormat *)job->format, job->stream, job->u.puri);
+ if (!g_cancellable_is_cancelled (cancellable))
+ job->u.puri->func (
+ EM_FORMAT (job->format), job->stream,
+ job->u.puri, cancellable);
}
-static void emfh_gethttp (struct _EMFormatHTMLJob *job, gint cancelled)
+static void
+emfh_gethttp (struct _EMFormatHTMLJob *job,
+ GCancellable *cancellable)
{
CamelStream *cistream = NULL, *costream = NULL, *instream = NULL;
CamelURL *url;
@@ -1385,7 +1404,7 @@ static void emfh_gethttp (struct _EMFormatHTMLJob *job, gint cancelled)
gchar buffer[1500];
const gchar *length;
- if (cancelled
+ if (g_cancellable_is_cancelled (cancellable)
|| (url = camel_url_new (job->u.uri, NULL)) == NULL)
goto badurl;
@@ -1418,7 +1437,7 @@ static void emfh_gethttp (struct _EMFormatHTMLJob *job, gint cancelled)
camel_http_stream_set_proxy ((CamelHttpStream *)instream, proxy);
g_free (proxy);
}
- camel_operation_start(NULL, _("Retrieving '%s'"), job->u.uri);
+ camel_operation_start (cancellable, _("Retrieving '%s'"), job->u.uri);
tmp_stream = (CamelHttpStream *)instream;
content_type = camel_http_stream_get_content_type (tmp_stream);
length = camel_header_raw_find(&tmp_stream->headers, "Content-Length", NULL);
@@ -1427,7 +1446,7 @@ static void emfh_gethttp (struct _EMFormatHTMLJob *job, gint cancelled)
total = atoi (length);
camel_content_type_unref (content_type);
} else
- camel_operation_start_transient(NULL, _("Retrieving '%s'"), job->u.uri);
+ camel_operation_start_transient (cancellable, _("Retrieving '%s'"), job->u.uri);
camel_url_free (url);
@@ -1438,7 +1457,7 @@ static void emfh_gethttp (struct _EMFormatHTMLJob *job, gint cancelled)
costream = camel_data_cache_add (emfh_http_cache, EMFH_HTTP_CACHE_PATH, job->u.uri, NULL);
do {
- if (camel_operation_cancel_check (NULL)) {
+ if (camel_operation_cancel_check (CAMEL_OPERATION (cancellable))) {
n = -1;
break;
}
@@ -1449,7 +1468,7 @@ static void emfh_gethttp (struct _EMFormatHTMLJob *job, gint cancelled)
/* If we didn't get a valid Content-Length header, do not try to calculate percentage */
if (total != 0) {
pc_complete = ((nread * 100) / total);
- camel_operation_progress (NULL, pc_complete);
+ camel_operation_progress (cancellable, pc_complete);
}
d(printf(" read %d bytes\n", n));
if (costream && camel_stream_write (costream, buffer, n, NULL) == -1) {
@@ -1474,7 +1493,7 @@ static void emfh_gethttp (struct _EMFormatHTMLJob *job, gint cancelled)
g_object_unref (instream);
done:
- camel_operation_end (NULL);
+ camel_operation_end (cancellable);
badurl:
g_free (job->u.uri);
}
@@ -1596,13 +1615,17 @@ static const gchar *smime_sign_colour[4] = {
/* TODO: this could probably be virtual on em-format-html
then we only need one version of each type handler */
static void
-efh_format_secure (EMFormat *emf, CamelStream *stream, CamelMimePart *part, CamelCipherValidity *valid)
+efh_format_secure (EMFormat *emf,
+ CamelStream *stream,
+ CamelMimePart *part,
+ CamelCipherValidity *valid,
+ GCancellable *cancellable)
{
EMFormatClass *format_class;
format_class = EM_FORMAT_CLASS (parent_class);
g_return_if_fail (format_class->format_secure != NULL);
- format_class->format_secure (emf, stream, part, valid);
+ format_class->format_secure (emf, stream, part, valid, cancellable);
/* To explain, if the validity is the same, then we are the
base validity and now have a combined sign/encrypt validity
@@ -1663,6 +1686,7 @@ efh_text_plain (EMFormatHTML *efh,
CamelStream *stream,
CamelMimePart *part,
const EMFormatHandler *info,
+ GCancellable *cancellable,
gboolean is_fallback)
{
CamelStream *filtered_stream;
@@ -1771,7 +1795,8 @@ efh_text_plain (EMFormatHTML *efh,
camel_stream_write_string (stream, "</div>\n", NULL);
} else {
g_string_append_printf(((EMFormat *)efh)->part_id, ".inline.%d", i);
- em_format_part ((EMFormat *)efh, stream, newpart);
+ em_format_part (
+ EM_FORMAT (efh), stream, newpart, cancellable);
g_string_truncate (((EMFormat *)efh)->part_id, len);
}
}
@@ -1820,7 +1845,10 @@ efh_text_enriched (EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part,
}
static void
-efh_write_text_html (EMFormat *emf, CamelStream *stream, EMFormatPURI *puri)
+efh_write_text_html (EMFormat *emf,
+ CamelStream *stream,
+ EMFormatPURI *puri,
+ GCancellable *cancellable)
{
#if d(!)0
CamelStream *out;
@@ -2019,20 +2047,25 @@ efh_message_deliverystatus (EMFormatHTML *efh, CamelStream *stream, CamelMimePar
}
static void
-emfh_write_related (EMFormat *emf, CamelStream *stream, EMFormatPURI *puri)
+emfh_write_related (EMFormat *emf,
+ CamelStream *stream,
+ EMFormatPURI *puri,
+ GCancellable *cancellable)
{
- em_format_format_content (emf, stream, puri->part);
+ em_format_format_content (emf, stream, puri->part, cancellable);
+
camel_stream_close (stream, NULL);
}
static void
-emfh_multipart_related_check (struct _EMFormatHTMLJob *job, gint cancelled)
+emfh_multipart_related_check (struct _EMFormatHTMLJob *job,
+ GCancellable *cancellable)
{
EMFormat *format;
GList *link;
gchar *oldpartid;
- if (cancelled)
+ if (g_cancellable_is_cancelled (cancellable))
return;
format = EM_FORMAT (job->format);
@@ -2055,7 +2088,10 @@ emfh_multipart_related_check (struct _EMFormatHTMLJob *job, gint cancelled)
d(printf("part '%s' '%s' used '%d'\n", puri->uri?puri->uri:"", puri->cid, puri->use_count));
if (puri->func == emfh_write_related) {
g_string_printf (format->part_id, "%s", puri->part_id);
- em_format_part (format, (CamelStream *)job->stream, puri->part);
+ /* FIXME Not passing a GCancellable here. */
+ em_format_part (
+ format, CAMEL_STREAM (job->stream),
+ puri->part, NULL);
}
/* else it was probably added by a previous format this loop */
}
@@ -2069,7 +2105,11 @@ emfh_multipart_related_check (struct _EMFormatHTMLJob *job, gint cancelled)
/* RFC 2387 */
static void
-efh_multipart_related (EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info)
+efh_multipart_related (EMFormat *emf,
+ CamelStream *stream,
+ CamelMimePart *part,
+ const EMFormatHandler *info,
+ GCancellable *cancellable)
{
CamelMultipart *mp = (CamelMultipart *)camel_medium_get_content ((CamelMedium *)part);
CamelMimePart *body_part, *display_part = NULL;
@@ -2111,7 +2151,9 @@ efh_multipart_related (EMFormat *emf, CamelStream *stream, CamelMimePart *part,
}
if (display_part == NULL) {
- em_format_part_as(emf, stream, part, "multipart/mixed");
+ em_format_part_as (
+ emf, stream, part,
+ "multipart/mixed", cancellable);
return;
}
@@ -2131,12 +2173,13 @@ efh_multipart_related (EMFormat *emf, CamelStream *stream, CamelMimePart *part,
}
g_string_append_printf(emf->part_id, "related.%d", displayid);
- em_format_part (emf, stream, display_part);
+ em_format_part (emf, stream, display_part, cancellable);
g_string_truncate (emf->part_id, partidlen);
camel_stream_flush (stream, NULL);
/* queue a job to check for un-referenced parts to add as attachments */
- job = em_format_html_job_new ((EMFormatHTML *)emf, emfh_multipart_related_check, NULL);
+ job = em_format_html_job_new (
+ EM_FORMAT_HTML (emf), emfh_multipart_related_check, NULL);
job->stream = stream;
g_object_ref (stream);
em_format_html_job_queue ((EMFormatHTML *)emf, job);
@@ -2145,7 +2188,10 @@ efh_multipart_related (EMFormat *emf, CamelStream *stream, CamelMimePart *part,
}
static void
-efh_write_image (EMFormat *emf, CamelStream *stream, EMFormatPURI *puri)
+efh_write_image (EMFormat *emf,
+ CamelStream *stream,
+ EMFormatPURI *puri,
+ GCancellable *cancellable)
{
CamelDataWrapper *dw = camel_medium_get_content ((CamelMedium *)puri->part);
@@ -2561,7 +2607,10 @@ efh_format_header (EMFormat *emf, CamelStream *stream, CamelMedium *part, struct
}
static void
-efh_format_headers (EMFormatHTML *efh, CamelStream *stream, CamelMedium *part)
+efh_format_headers (EMFormatHTML *efh,
+ CamelStream *stream,
+ CamelMedium *part,
+ GCancellable *cancellable)
{
EMFormat *emf = (EMFormat *) efh;
const gchar *charset;
@@ -2771,7 +2820,9 @@ efh_format_headers (EMFormatHTML *efh, CamelStream *stream, CamelMedium *part)
camel_mime_part_set_content ((CamelMimePart *) part, (const gchar *) face_header_value, face_header_len, "image/png");
classid = g_strdup_printf("icon:///em-format-html/face/photo/header");
camel_stream_printf(stream, "<td align=\"right\" valign=\"top\"><img width=48 src=\"%s\"></td>", classid);
- em_format_add_puri (emf, sizeof (EMFormatPURI), classid, part, efh_write_image);
+ em_format_add_puri (
+ emf, sizeof (EMFormatPURI),
+ classid, part, efh_write_image);
g_object_unref (part);
}
@@ -2794,7 +2845,9 @@ efh_format_headers (EMFormatHTML *efh, CamelStream *stream, CamelMedium *part)
}
if (iconpart) {
- em_format_add_puri (emf, sizeof (EMFormatPURI), classid, iconpart, efh_write_image);
+ em_format_add_puri (
+ emf, sizeof (EMFormatPURI),
+ classid, iconpart, efh_write_image);
g_object_unref (iconpart);
}
g_free (classid);
@@ -2804,7 +2857,11 @@ efh_format_headers (EMFormatHTML *efh, CamelStream *stream, CamelMedium *part)
}
static void
-efh_format_message (EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info)
+efh_format_message (EMFormat *emf,
+ CamelStream *stream,
+ CamelMimePart *part,
+ const EMFormatHandler *info,
+ GCancellable *cancellable)
{
const EMFormatHandler *handle;
@@ -2819,14 +2876,16 @@ efh_format_message (EMFormat *emf, CamelStream *stream, CamelMimePart *part, con
camel_stream_printf(stream, "<blockquote>\n");
if (!efh->hide_headers)
- efh_format_headers (efh, stream, (CamelMedium *)part);
+ efh_format_headers (
+ efh, stream, CAMEL_MEDIUM (part), cancellable);
handle = em_format_find_handler(emf, "x-evolution/message/post-header");
if (handle)
- handle->handler (emf, stream, part, handle, FALSE);
+ handle->handler (
+ emf, stream, part, handle, cancellable, FALSE);
camel_stream_printf (stream, EM_FORMAT_HTML_VPAD);
- em_format_part (emf, stream, part);
+ em_format_part (emf, stream, part, cancellable);
if (emf->message != (CamelMimeMessage *)part)
camel_stream_printf(stream, "</blockquote>\n");
diff --git a/mail/em-format-html.h b/mail/em-format-html.h
index 85b91f84c3..81f2fee5ca 100644
--- a/mail/em-format-html.h
+++ b/mail/em-format-html.h
@@ -115,7 +115,7 @@ struct _EMFormatHTMLJob {
GNode *puri_level;
CamelURL *base;
- void (*callback)(EMFormatHTMLJob *job, gint cancelled);
+ void (*callback)(EMFormatHTMLJob *job, GCancellable *cancellable);
union {
gchar *uri;
CamelMedium *msg;
@@ -269,7 +269,7 @@ void em_format_html_remove_pobject (EMFormatHTML *efh,
void em_format_html_clear_pobject (EMFormatHTML *efh);
EMFormatHTMLJob *
em_format_html_job_new (EMFormatHTML *efh,
- void (*callback)(EMFormatHTMLJob *job, gint cancelled),
+ void (*callback)(EMFormatHTMLJob *job, GCancellable *cancellable),
gpointer data);
void em_format_html_job_queue (EMFormatHTML *efh,
EMFormatHTMLJob *job);
diff --git a/mail/em-subscribe-editor.c b/mail/em-subscribe-editor.c
index 39ec661013..c0d1120a3e 100644
--- a/mail/em-subscribe-editor.c
+++ b/mail/em-subscribe-editor.c
@@ -268,11 +268,11 @@ sub_folder_exec (struct _zsubscribe_msg *m)
if (m->subscribe)
camel_store_subscribe_folder (
m->sub->store, m->node->info->full_name,
- &m->base.error);
+ m->base.cancellable, &m->base.error);
else
camel_store_unsubscribe_folder (
m->sub->store, m->node->info->full_name,
- &m->base.error);
+ m->base.cancellable, &m->base.error);
}
static void
@@ -453,15 +453,13 @@ static void
sub_folderinfo_exec (struct _emse_folderinfo_msg *m)
{
if (m->seq == m->sub->seq) {
- camel_operation_register (m->base.cancel);
/* get the full folder tree for search ability */
m->info = camel_store_get_folder_info (
m->sub->store, NULL,
CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL |
CAMEL_STORE_FOLDER_INFO_SUBSCRIPTION_LIST |
CAMEL_STORE_FOLDER_INFO_RECURSIVE,
- &m->base.error);
- camel_operation_unregister ();
+ m->base.cancellable, &m->base.error);
}
}
diff --git a/mail/em-utils.c b/mail/em-utils.c
index 17957815ad..922050212d 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -493,6 +493,7 @@ em_utils_flag_for_followup_clear (GtkWindow *parent, CamelFolder *folder, GPtrAr
camel_folder_free_message_info (folder, mi);
}
}
+
camel_folder_thaw (folder);
em_utils_uids_free (uids);
@@ -532,6 +533,7 @@ em_utils_flag_for_followup_completed (GtkWindow *parent, CamelFolder *folder, GP
camel_folder_free_message_info (folder, mi);
}
}
+
camel_folder_thaw (folder);
g_free (now);
@@ -558,7 +560,9 @@ em_utils_write_messages_to_stream (CamelFolder *folder, GPtrArray *uids, CamelSt
CamelMimeMessage *message;
gchar *from;
- message = camel_folder_get_message (folder, uids->pdata[i], NULL);
+ /* FIXME camel_folder_get_message() may block. */
+ message = camel_folder_get_message (
+ folder, uids->pdata[i], NULL, NULL);
if (message == NULL) {
res = -1;
break;
@@ -607,8 +611,9 @@ em_utils_read_messages_from_stream (CamelFolder *folder, CamelStream *stream)
break;
}
+ /* FIXME camel_folder_append_message() may block. */
success = camel_folder_append_message (
- folder, msg, NULL, NULL, NULL);
+ folder, msg, NULL, NULL, NULL, NULL);
g_object_unref (msg);
if (!success)
@@ -712,7 +717,9 @@ em_utils_selection_get_message (GtkSelectionData *selection_data,
camel_stream_mem_new_with_buffer ((gchar *)data, length);
msg = camel_mime_message_new ();
if (camel_data_wrapper_construct_from_stream ((CamelDataWrapper *)msg, stream, NULL) == 0)
- camel_folder_append_message (folder, msg, NULL, NULL, NULL);
+ /* FIXME camel_folder_append_message() may block. */
+ camel_folder_append_message (
+ folder, msg, NULL, NULL, NULL, NULL);
g_object_unref (msg);
g_object_unref (stream);
}
@@ -762,6 +769,7 @@ void
em_utils_selection_get_uidlist (GtkSelectionData *selection_data,
CamelFolder *dest,
gint move,
+ GCancellable *cancellable,
GError **error)
{
/* format: "uri\0uid1\0uid2\0uid3\0...\0uidn" */
@@ -800,9 +808,13 @@ em_utils_selection_get_uidlist (GtkSelectionData *selection_data,
return;
}
- folder = mail_tool_uri_to_folder ((gchar *) data, 0, error);
+ /* FIXME mail_tool_uri_to_folder() may block. */
+ folder = mail_tool_uri_to_folder (
+ (gchar *) data, 0, cancellable, error);
if (folder) {
- camel_folder_transfer_messages_to (folder, uids, dest, NULL, move, error);
+ /* FIXME camel_folder_transfer_messages_to() may block. */
+ camel_folder_transfer_messages_to (
+ folder, uids, dest, NULL, move, cancellable, error);
g_object_unref (folder);
}
@@ -1243,7 +1255,13 @@ em_utils_get_proxy_uri (const gchar *pUri)
* Return value: The html version.
**/
gchar *
-em_utils_message_to_html (CamelMimeMessage *message, const gchar *credits, guint32 flags, gssize *len, EMFormat *source, const gchar *append, guint32 *validity_found)
+em_utils_message_to_html (CamelMimeMessage *message,
+ const gchar *credits,
+ guint32 flags,
+ gssize *len,
+ EMFormat *source,
+ const gchar *append,
+ guint32 *validity_found)
{
EMFormatQuote *emfq;
CamelStreamMem *mem;
@@ -1269,7 +1287,9 @@ em_utils_message_to_html (CamelMimeMessage *message, const gchar *credits, guint
g_free (charset);
}
- em_format_format_clone ((EMFormat *)emfq, NULL, NULL, message, source);
+ /* FIXME Not passing a GCancellable here. */
+ em_format_format_clone (
+ EM_FORMAT (emfq), NULL, NULL, message, source, NULL);
if (validity_found)
*validity_found = ((EMFormat *)emfq)->validity_found;
g_object_unref (emfq);
diff --git a/mail/em-utils.h b/mail/em-utils.h
index 7e071756a2..0e9ef9f41a 100644
--- a/mail/em-utils.h
+++ b/mail/em-utils.h
@@ -57,7 +57,7 @@ void em_utils_selection_get_mailbox (GtkSelectionData *data, CamelFolder *folder
void em_utils_selection_get_message (GtkSelectionData *data, CamelFolder *folder);
/* FIXME: be nice if these also worked on CamelFolder's, no easy way to get uri from folder yet tho */
void em_utils_selection_set_uidlist (GtkSelectionData *data, const gchar *uri, GPtrArray *uids);
-void em_utils_selection_get_uidlist (GtkSelectionData *data, CamelFolder *dest, gint move, GError **error);
+void em_utils_selection_get_uidlist (GtkSelectionData *data, CamelFolder *dest, gint move, GCancellable *cancellable, GError **error);
void em_utils_selection_set_urilist (GtkSelectionData *data, CamelFolder *folder, GPtrArray *uids);
void em_utils_selection_get_urilist (GtkSelectionData *data, CamelFolder *folder);
diff --git a/mail/importers/mail-importer.c b/mail/importers/mail-importer.c
index ddc9f66300..3dac78744c 100644
--- a/mail/importers/mail-importer.c
+++ b/mail/importers/mail-importer.c
@@ -123,7 +123,8 @@ import_mbox_exec (struct _import_mbox_msg *m)
folder = e_mail_local_get_folder (E_MAIL_FOLDER_INBOX);
else
folder = mail_tool_uri_to_folder (
- m->uri, CAMEL_STORE_FOLDER_CREATE, &m->base.error);
+ m->uri, CAMEL_STORE_FOLDER_CREATE,
+ m->base.cancellable, &m->base.error);
if (folder == NULL)
return;
@@ -181,7 +182,8 @@ import_mbox_exec (struct _import_mbox_msg *m)
camel_message_info_set_flags (info, flags, ~0);
camel_folder_append_message (
- folder, msg, info, NULL, &m->base.error);
+ folder, msg, info, NULL,
+ m->base.cancellable, &m->base.error);
camel_message_info_free (info);
g_object_unref (msg);
@@ -190,7 +192,8 @@ import_mbox_exec (struct _import_mbox_msg *m)
camel_mime_parser_step (mp, NULL, NULL);
}
- camel_folder_sync (folder, FALSE, NULL);
+ /* FIXME Not passing a GCancellable or GError here. */
+ camel_folder_sync (folder, FALSE, NULL, NULL);
camel_folder_thaw (folder);
camel_operation_end (NULL);
/* TODO: these api's are a bit weird, registering the old is the same as deregistering */
@@ -200,7 +203,8 @@ import_mbox_exec (struct _import_mbox_msg *m)
g_object_unref (mp);
}
fail1:
- camel_folder_sync (folder, FALSE, NULL);
+ /* FIXME Not passing a GCancellable or GError here. */
+ camel_folder_sync (folder, FALSE, NULL, NULL);
g_object_unref (folder);
}
diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c
index d12d77ea64..00818a1ef5 100644
--- a/mail/mail-folder-cache.c
+++ b/mail/mail-folder-cache.c
@@ -188,11 +188,16 @@ real_flush_updates (gpointer o, gpointer event_data, gpointer data)
}
if (CAMEL_IS_VEE_STORE (up->store) && !up->remove) {
- /* Normally the vfolder store takes care of the folder_opened event itself,
- but we add folder to the noting system later, thus we do not know about
- search folders to update them in a tree, thus ensure their changes will
- be tracked correctly. */
- CamelFolder *folder = camel_store_get_folder (up->store, up->full_name, 0, NULL);
+ /* Normally the vfolder store takes care of the
+ * folder_opened event itself, but we add folder to
+ * the noting system later, thus we do not know about
+ * search folders to update them in a tree, thus
+ * ensure their changes will be tracked correctly. */
+ CamelFolder *folder;
+
+ /* FIXME camel_store_get_folder() may block. */
+ folder = camel_store_get_folder (
+ up->store, up->full_name, 0, NULL, NULL);
if (folder) {
mail_folder_cache_note_folder (self, folder);
@@ -802,7 +807,8 @@ ping_store_exec (struct _ping_store_msg *m)
online = TRUE;
}
if (online)
- camel_store_noop (m->store, &m->base.error);
+ camel_store_noop (
+ m->store, m->base.cancellable, &m->base.error);
}
static void
@@ -1086,7 +1092,7 @@ mail_folder_cache_get_default (void)
void
mail_folder_cache_note_store (MailFolderCache *self,
CamelStore *store,
- CamelOperation *op,
+ GCancellable *cancellable,
NoteDoneFunc done,
gpointer data)
{
@@ -1143,7 +1149,8 @@ mail_folder_cache_note_store (MailFolderCache *self,
}
} else {
normal_setup:
- ud->id = mail_get_folderinfo (store, op, update_folders, ud);
+ ud->id = mail_get_folderinfo (
+ store, cancellable, update_folders, ud);
}
g_queue_push_tail (&si->folderinfo_updates, ud);
diff --git a/mail/mail-folder-cache.h b/mail/mail-folder-cache.h
index 55aaeb9651..870b7fe8ae 100644
--- a/mail/mail-folder-cache.h
+++ b/mail/mail-folder-cache.h
@@ -83,7 +83,7 @@ MailFolderCache *
mail_folder_cache_get_default (void);
void mail_folder_cache_note_store (MailFolderCache *self,
CamelStore *store,
- CamelOperation *op,
+ GCancellable *cancellable,
NoteDoneFunc done,
gpointer data);
void mail_folder_cache_note_store_remove
diff --git a/mail/mail-mt.c b/mail/mail-mt.c
index 80a37c15ec..694a8f5abe 100644
--- a/mail/mail-mt.c
+++ b/mail/mail-mt.c
@@ -89,7 +89,7 @@ mail_msg_new (MailMsgInfo *info)
msg->info = info;
msg->ref_count = 1;
msg->seq = mail_msg_seq++;
- msg->cancel = camel_operation_new ();
+ msg->cancellable = (GCancellable *) camel_operation_new ();
msg->priv = g_slice_new0 (MailMsgPrivate);
msg->priv->activity = e_activity_new ();
@@ -99,10 +99,10 @@ mail_msg_new (MailMsgInfo *info)
e_activity_set_cancellable (
msg->priv->activity,
- G_CANCELLABLE (msg->cancel));
+ G_CANCELLABLE (msg->cancellable));
g_signal_connect (
- msg->cancel, "cancelled",
+ msg->cancellable, "cancelled",
G_CALLBACK (mail_msg_cancelled),
GINT_TO_POINTER (msg->seq));
@@ -157,8 +157,8 @@ mail_msg_free (MailMsg *mail_msg)
g_object_unref (mail_msg->priv->activity);
}
- if (mail_msg->cancel != NULL)
- g_object_unref (mail_msg->cancel);
+ if (mail_msg->cancellable != NULL)
+ g_object_unref (mail_msg->cancellable);
if (mail_msg->error != NULL)
g_error_free (mail_msg->error);
@@ -255,8 +255,7 @@ mail_msg_check_error (gpointer msg)
if (m->error == NULL
|| g_error_matches (m->error, G_IO_ERROR, G_IO_ERROR_CANCELLED)
- || g_error_matches (m->error, CAMEL_FOLDER_ERROR, CAMEL_FOLDER_ERROR_INVALID_UID)
- || (m->cancel && camel_operation_cancel_check (m->cancel)))
+ || g_error_matches (m->error, CAMEL_FOLDER_ERROR, CAMEL_FOLDER_ERROR_INVALID_UID))
return;
if (active_errors == NULL)
@@ -295,26 +294,26 @@ mail_msg_check_error (gpointer msg)
}
-void mail_msg_cancel (guint msgid)
+void
+mail_msg_cancel (guint msgid)
{
- MailMsg *m;
+ MailMsg *msg;
g_mutex_lock (mail_msg_lock);
- m = g_hash_table_lookup (mail_msg_active_table, GINT_TO_POINTER (msgid));
+ msg = g_hash_table_lookup (
+ mail_msg_active_table, GINT_TO_POINTER (msgid));
- if (m != NULL && m->cancel != NULL && !camel_operation_cancel_check (m->cancel)) {
- g_signal_handlers_block_by_func (m->cancel, mail_msg_cancelled, GINT_TO_POINTER (m->seq));
- camel_operation_cancel (m->cancel);
- g_signal_handlers_unblock_by_func (m->cancel, mail_msg_cancelled, GINT_TO_POINTER (m->seq));
- }
+ if (msg != NULL && msg->cancellable != NULL)
+ camel_operation_cancel (CAMEL_OPERATION (msg->cancellable));
g_mutex_unlock (mail_msg_lock);
}
/* waits for a message to be finished processing (freed)
the messageid is from MailMsg->seq */
-void mail_msg_wait (guint msgid)
+void
+mail_msg_wait (guint msgid)
{
MailMsg *m;
@@ -473,10 +472,9 @@ mail_msg_idle_cb (void)
static void
mail_msg_proxy (MailMsg *msg)
{
- if (msg->info->desc != NULL && msg->cancel) {
+ if (msg->info->desc != NULL) {
gchar *text = msg->info->desc (msg);
- camel_operation_register (msg->cancel);
- camel_operation_start (msg->cancel, "%s", text);
+ camel_operation_start (msg->cancellable, "%s", text);
g_free (text);
}
@@ -489,10 +487,8 @@ mail_msg_proxy (MailMsg *msg)
if (msg->info->exec != NULL)
msg->info->exec (msg);
- if (msg->info->desc != NULL && msg->cancel) {
- camel_operation_end (msg->cancel);
- camel_operation_unregister ();
- }
+ if (msg->info->desc != NULL)
+ camel_operation_end (msg->cancellable);
g_async_queue_push (msg_reply_queue, msg);
diff --git a/mail/mail-mt.h b/mail/mail-mt.h
index c27f61ce6c..e31d9e9506 100644
--- a/mail/mail-mt.h
+++ b/mail/mail-mt.h
@@ -38,10 +38,10 @@ typedef void (*MailMsgDispatchFunc) (gpointer msg);
struct _MailMsg {
MailMsgInfo *info;
volatile gint ref_count;
- guint seq; /* seq number for synchronisation */
- gint priority; /* priority (default = 0) */
- CamelOperation *cancel; /* a cancellation/status handle */
- GError *error; /* up to the caller to use this */
+ guint seq; /* seq number for synchronisation */
+ gint priority; /* priority (default = 0) */
+ GCancellable *cancellable; /* a cancellation/status handle */
+ GError *error; /* up to the caller to use this */
MailMsgPrivate *priv;
};
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 1303daee81..5699199666 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -69,7 +69,8 @@ struct _filter_mail_msg {
struct _fetch_mail_msg {
struct _filter_mail_msg fmsg;
- CamelOperation *cancel; /* we have our own cancellation struct, the other should be empty */
+ GCancellable *cancellable; /* we have our own cancellation
+ * struct, the other should be empty */
gint keep; /* keep on server? */
gchar *source_uri;
@@ -116,8 +117,8 @@ em_filter_folder_element_exec (struct _filter_mail_msg *m)
folder_uids = uids = camel_folder_get_uids (folder);
camel_filter_driver_filter_folder (
- m->driver, folder, m->cache, uids,
- m->delete, &m->base.error);
+ m->driver, folder, m->cache, uids, m->delete,
+ m->base.cancellable, &m->base.error);
camel_filter_driver_flush (m->driver, &m->base.error);
if (folder_uids)
@@ -125,7 +126,8 @@ em_filter_folder_element_exec (struct _filter_mail_msg *m)
/* sync our source folder */
if (!m->cache)
- camel_folder_sync (folder, FALSE, &m->base.error);
+ camel_folder_sync (
+ folder, FALSE, m->base.cancellable, &m->base.error);
camel_folder_thaw (folder);
if (m->destination)
@@ -249,8 +251,8 @@ fetch_mail_exec (struct _fetch_mail_msg *m)
struct _filter_mail_msg *fm = (struct _filter_mail_msg *)m;
gint i;
- if (m->cancel)
- camel_operation_register (m->cancel);
+ if (m->cancellable)
+ camel_operation_register (CAMEL_OPERATION (m->cancellable));
fm->destination = e_mail_local_get_folder (E_MAIL_FOLDER_LOCAL_INBOX);
if (fm->destination == NULL)
@@ -268,7 +270,7 @@ fetch_mail_exec (struct _fetch_mail_msg *m)
fm->driver, fm->destination);
camel_filter_driver_filter_mbox (
fm->driver, path, m->source_uri,
- &fm->base.error);
+ fm->base.cancellable, &fm->base.error);
camel_folder_thaw (fm->destination);
if (fm->base.error == NULL)
@@ -279,7 +281,10 @@ fetch_mail_exec (struct _fetch_mail_msg *m)
CamelFolder *folder;
folder = fm->source_folder =
- mail_tool_get_inbox (m->source_uri, &fm->base.error);
+ mail_tool_get_inbox (
+ m->source_uri,
+ fm->base.cancellable,
+ &fm->base.error);
if (folder) {
/* this handles 'keep on server' stuff, if we have any new uid's to copy
@@ -327,7 +332,8 @@ fetch_mail_exec (struct _fetch_mail_msg *m)
if ((fm->delete || cache_uids) && fm->base.error == NULL) {
/* expunge messages (downloaded so far) */
- camel_folder_sync (folder, fm->delete, NULL);
+ /* FIXME Not passing a GCancellable or GError here. */
+ camel_folder_sync (folder, fm->delete, NULL, NULL);
}
camel_uid_cache_destroy (cache);
@@ -344,7 +350,7 @@ fetch_mail_exec (struct _fetch_mail_msg *m)
}
}
fail:
- if (m->cancel)
+ if (m->cancellable)
camel_operation_unregister ();
/* we unref this here as it may have more work to do (syncing
@@ -367,8 +373,9 @@ static void
fetch_mail_free (struct _fetch_mail_msg *m)
{
g_free (m->source_uri);
- if (m->cancel)
- g_object_unref (m->cancel);
+
+ if (m->cancellable)
+ g_object_unref (m->cancellable);
em_filter_folder_element_free ((struct _filter_mail_msg *) m);
}
@@ -383,10 +390,16 @@ static MailMsgInfo fetch_mail_info = {
/* ouch, a 'do everything' interface ... */
void
-mail_fetch_mail (const gchar *source, gint keep, const gchar *type, CamelOperation *cancel,
- CamelFilterGetFolderFunc get_folder, gpointer get_data,
- CamelFilterStatusFunc *status, gpointer status_data,
- void (*done)(const gchar *source, gpointer data), gpointer data)
+mail_fetch_mail (const gchar *source,
+ gint keep,
+ const gchar *type,
+ GCancellable *cancellable,
+ CamelFilterGetFolderFunc get_folder,
+ gpointer get_data,
+ CamelFilterStatusFunc *status,
+ gpointer status_data,
+ void (*done)(const gchar *source, gpointer data),
+ gpointer data)
{
struct _fetch_mail_msg *m;
struct _filter_mail_msg *fm;
@@ -396,8 +409,8 @@ mail_fetch_mail (const gchar *source, gint keep, const gchar *type, CamelOperati
m->source_uri = g_strdup (source);
fm->delete = !keep;
fm->cache = NULL;
- if (cancel)
- m->cancel = g_object_ref (cancel);
+ if (cancellable)
+ m->cancellable = g_object_ref (cancellable);
m->done = done;
m->data = data;
@@ -457,6 +470,7 @@ mail_send_message (struct _send_queue_msg *m,
const gchar *uid,
const gchar *destination,
CamelFilterDriver *driver,
+ GCancellable *cancellable,
GError **error)
{
EAccount *account = NULL;
@@ -474,7 +488,7 @@ mail_send_message (struct _send_queue_msg *m,
gint i;
GError *local_error = NULL;
- message = camel_folder_get_message (queue, uid, error);
+ message = camel_folder_get_message (queue, uid, cancellable, error);
if (!message)
return;
@@ -545,7 +559,8 @@ mail_send_message (struct _send_queue_msg *m,
if (xport == NULL)
goto exit;
- if (!camel_transport_send_to (xport, message, from, recipients, error))
+ if (!camel_transport_send_to (
+ xport, message, from, recipients, cancellable, error))
goto exit;
}
@@ -562,9 +577,12 @@ mail_send_message (struct _send_queue_msg *m,
/* TODO: don't lose errors */
uri = g_strstrip (g_strdup (header->value));
- folder = mail_tool_uri_to_folder (uri, 0, NULL);
+ /* FIXME Not passing a GCancellable or GError here. */
+ folder = mail_tool_uri_to_folder (uri, 0, NULL, NULL);
if (folder) {
- camel_folder_append_message (folder, message, info, NULL, NULL);
+ /* FIXME Not passing a GCancellable or GError here. */
+ camel_folder_append_message (
+ folder, message, info, NULL, NULL, NULL);
g_object_unref (folder);
folder = NULL;
}
@@ -576,8 +594,8 @@ mail_send_message (struct _send_queue_msg *m,
if (driver) {
camel_filter_driver_filter_message (
- driver, message, info, NULL,
- NULL, NULL, "", &local_error);
+ driver, message, info, NULL, NULL,
+ NULL, "", cancellable, &local_error);
if (local_error != NULL) {
if (g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
@@ -598,7 +616,7 @@ mail_send_message (struct _send_queue_msg *m,
if (sent_folder_uri) {
folder = mail_tool_uri_to_folder (
- sent_folder_uri, 0, &local_error);
+ sent_folder_uri, 0, cancellable, &local_error);
if (folder == NULL) {
g_string_append_printf (
err, _("Failed to append to %s: %s\n"
@@ -613,7 +631,10 @@ mail_send_message (struct _send_queue_msg *m,
g_object_ref (folder);
}
- if (!camel_folder_append_message (folder, message, info, NULL, &local_error)) {
+ if (!camel_folder_append_message (
+ folder, message, info,
+ NULL, cancellable, &local_error)) {
+
CamelFolder *sent_folder;
if (g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
@@ -637,7 +658,8 @@ mail_send_message (struct _send_queue_msg *m,
g_clear_error (&local_error);
camel_folder_append_message (
- folder, message, info, NULL, &local_error);
+ folder, message, info,
+ NULL, cancellable, &local_error);
}
if (local_error != NULL) {
@@ -659,7 +681,8 @@ mail_send_message (struct _send_queue_msg *m,
CAMEL_MESSAGE_SEEN, ~0);
/* Sync it to disk, since if it crashes in between,
* we keep sending it again on next start. */
- camel_folder_sync (queue, FALSE, NULL);
+ /* FIXME Not passing a GCancellable or GError here. */
+ camel_folder_sync (queue, FALSE, NULL, NULL);
}
if (err->len) {
@@ -673,8 +696,9 @@ exit:
if (local_error != NULL)
g_propagate_error (error, local_error);
+ /* FIXME Not passing a GCancellable or GError here. */
if (folder) {
- camel_folder_sync (folder, FALSE, NULL);
+ camel_folder_sync (folder, FALSE, NULL, NULL);
g_object_unref (folder);
}
if (info)
@@ -701,7 +725,7 @@ struct _send_queue_msg {
gchar *destination;
CamelFilterDriver *driver;
- CamelOperation *cancel;
+ GCancellable *cancellable;
/* we use camelfilterstatusfunc, even though its not the filter doing it */
CamelFilterStatusFunc *status;
@@ -761,27 +785,33 @@ send_queue_exec (struct _send_queue_msg *m)
return;
}
- if (m->cancel)
- camel_operation_register (m->cancel);
+ if (m->cancellable)
+ camel_operation_register (CAMEL_OPERATION (m->cancellable));
else
- camel_operation_register (m->base.cancel);
+ camel_operation_register (CAMEL_OPERATION (m->base.cancellable));
- if (!m->cancel)
+ if (!m->cancellable)
camel_operation_start (NULL, _("Sending message"));
- /* NB: This code somewhat abuses the 'exception' stuff. Apart from fatal problems, it is also
- used as a mechanism to accumualte warning messages and present them back to the user. */
+ /* NB: This code somewhat abuses the 'exception' stuff. Apart from
+ * fatal problems, it is also used as a mechanism to accumualte
+ * warning messages and present them back to the user. */
for (i = 0, j = 0; i < send_uids->len; i++) {
gint pc = (100 * i) / send_uids->len;
- report_status (m, CAMEL_FILTER_STATUS_START, pc, _("Sending message %d of %d"), i+1, send_uids->len);
- if (!m->cancel)
- camel_operation_progress (NULL, (i+1) * 100 / send_uids->len);
+ report_status (
+ m, CAMEL_FILTER_STATUS_START, pc,
+ _("Sending message %d of %d"), i+1,
+ send_uids->len);
+
+ if (!m->cancellable)
+ camel_operation_progress (
+ NULL, (i+1) * 100 / send_uids->len);
mail_send_message (
- m, m->queue, send_uids->pdata[i],
- m->destination, m->driver, &local_error);
+ m, m->queue, send_uids->pdata[i], m->destination,
+ m->driver, m->base.cancellable, &local_error);
if (local_error != NULL) {
if (g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
/* merge exceptions into one */
@@ -833,13 +863,15 @@ send_queue_exec (struct _send_queue_msg *m)
camel_folder_free_uids (m->queue, uids);
g_ptr_array_free (send_uids, TRUE);
+ /* FIXME Not passing a GCancellable or GError here. */
if (j <= 0 && m->base.error == NULL)
- camel_folder_sync (m->queue, TRUE, NULL);
+ camel_folder_sync (m->queue, TRUE, NULL, NULL);
+ /* FIXME Not passing a GCancellable or GError here. */
if (sent_folder)
- camel_folder_sync (sent_folder, FALSE, NULL);
+ camel_folder_sync (sent_folder, FALSE, NULL, NULL);
- if (!m->cancel)
+ if (!m->cancellable)
camel_operation_end (NULL);
camel_operation_unregister ();
@@ -866,8 +898,8 @@ send_queue_free (struct _send_queue_msg *m)
g_object_unref (m->driver);
g_object_unref (m->queue);
g_free (m->destination);
- if (m->cancel)
- g_object_unref (m->cancel);
+ if (m->cancellable)
+ g_object_unref (m->cancellable);
}
static MailMsgInfo send_queue_info = {
@@ -880,24 +912,27 @@ static MailMsgInfo send_queue_info = {
/* same interface as fetch_mail, just 'cause i'm lazy today (and we need to run it from the same spot?) */
void
-mail_send_queue (CamelFolder *queue, const gchar *destination,
- const gchar *type, CamelOperation *cancel,
- CamelFilterGetFolderFunc get_folder, gpointer get_data,
- CamelFilterStatusFunc *status, gpointer status_data,
- void (*done)(const gchar *destination, gpointer data), gpointer data)
+mail_send_queue (CamelFolder *queue,
+ const gchar *destination,
+ const gchar *type,
+ GCancellable *cancellable,
+ CamelFilterGetFolderFunc get_folder,
+ gpointer get_data,
+ CamelFilterStatusFunc *status,
+ gpointer status_data,
+ void (*done)(const gchar *destination, gpointer data),
+ gpointer data)
{
struct _send_queue_msg *m;
m = mail_msg_new (&send_queue_info);
- m->queue = queue;
- g_object_ref (queue);
+ m->queue = g_object_ref (queue);
m->destination = g_strdup (destination);
- if (cancel) {
- m->cancel = g_object_ref (cancel);
- g_object_unref (m->base.cancel);
+ if (G_IS_CANCELLABLE (cancellable)) {
+ m->cancellable = g_object_ref (cancellable);
+ g_object_unref (m->base.cancellable);
mail_msg_set_cancelable (m, FALSE);
-
- m->base.cancel = NULL;
+ m->base.cancellable = NULL;
}
m->status = status;
m->status_data = status_data;
@@ -933,8 +968,13 @@ append_mail_desc (struct _append_msg *m)
static void
append_mail_exec (struct _append_msg *m)
{
- camel_mime_message_set_date (m->message, CAMEL_MESSAGE_DATE_CURRENT, 0);
- camel_folder_append_message (m->folder, m->message, m->info, &m->appended_uid, &m->base.error);
+ camel_mime_message_set_date (
+ m->message, CAMEL_MESSAGE_DATE_CURRENT, 0);
+
+ camel_folder_append_message (
+ m->folder, m->message,
+ m->info, &m->appended_uid,
+ m->base.cancellable, &m->base.error);
}
static void
@@ -1017,7 +1057,9 @@ transfer_messages_exec (struct _transfer_msg *m)
{
CamelFolder *dest;
- dest = mail_tool_uri_to_folder (m->dest_uri, m->dest_flags, &m->base.error);
+ dest = mail_tool_uri_to_folder (
+ m->dest_uri, m->dest_flags,
+ m->base.cancellable, &m->base.error);
if (dest == NULL)
return;
@@ -1030,7 +1072,9 @@ transfer_messages_exec (struct _transfer_msg *m)
camel_folder_freeze (m->source);
camel_folder_freeze (dest);
- camel_folder_transfer_messages_to (m->source, m->uids, dest, NULL, m->delete, &m->base.error);
+ camel_folder_transfer_messages_to (
+ m->source, m->uids, dest, NULL, m->delete,
+ m->base.cancellable, &m->base.error);
/* make sure all deleted messages are marked as seen */
@@ -1038,13 +1082,16 @@ transfer_messages_exec (struct _transfer_msg *m)
gint i;
for (i = 0; i < m->uids->len; i++)
- camel_folder_set_message_flags (m->source, m->uids->pdata[i],
- CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN);
+ camel_folder_set_message_flags (
+ m->source, m->uids->pdata[i],
+ CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN);
}
camel_folder_thaw (m->source);
camel_folder_thaw (dest);
- camel_folder_sync (dest, FALSE, NULL);
+
+ /* FIXME Not passing a GCancellable or GError here. */
+ camel_folder_sync (dest, FALSE, NULL, NULL);
g_object_unref (dest);
}
@@ -1126,7 +1173,9 @@ get_folderinfo_exec (struct _get_folderinfo_msg *m)
{
guint32 flags = CAMEL_STORE_FOLDER_INFO_RECURSIVE|CAMEL_STORE_FOLDER_INFO_FAST | CAMEL_STORE_FOLDER_INFO_SUBSCRIBED;
- m->info = camel_store_get_folder_info (m->store, NULL, flags, &m->base.error);
+ m->info = camel_store_get_folder_info (
+ m->store, NULL, flags,
+ m->base.cancellable, &m->base.error);
}
static void
@@ -1164,15 +1213,18 @@ static MailMsgInfo get_folderinfo_info = {
};
gint
-mail_get_folderinfo (CamelStore *store, CamelOperation *op, gboolean (*done)(CamelStore *store, CamelFolderInfo *info, gpointer data), gpointer data)
+mail_get_folderinfo (CamelStore *store,
+ GCancellable *cancellable,
+ gboolean (*done)(CamelStore *store, CamelFolderInfo *info, gpointer data),
+ gpointer data)
{
struct _get_folderinfo_msg *m;
gint id;
m = mail_msg_new (&get_folderinfo_info);
- if (op) {
- g_object_unref (m->base.cancel);
- m->base.cancel = g_object_ref (op);
+ if (G_IS_CANCELLABLE (cancellable)) {
+ g_object_unref (m->base.cancellable);
+ m->base.cancellable = g_object_ref (cancellable);
}
m->store = store;
g_object_ref (store);
@@ -1270,7 +1322,8 @@ get_folder_desc (struct _get_folder_msg *m)
static void
get_folder_exec (struct _get_folder_msg *m)
{
- m->folder = mail_tool_uri_to_folder (m->uri, m->flags, &m->base.error);
+ m->folder = mail_tool_uri_to_folder (
+ m->uri, m->flags, m->base.cancellable, &m->base.error);
}
static void
@@ -1439,15 +1492,18 @@ static MailMsgInfo get_store_info = {
};
gint
-mail_get_store (const gchar *uri, CamelOperation *op, void (*done) (gchar *uri, CamelStore *store, gpointer data), gpointer data)
+mail_get_store (const gchar *uri,
+ GCancellable *cancellable,
+ void (*done) (gchar *uri, CamelStore *store, gpointer data),
+ gpointer data)
{
struct _get_store_msg *m;
gint id;
m = mail_msg_new (&get_store_info);
- if (op) {
- g_object_unref (m->base.cancel);
- m->base.cancel = g_object_ref (op);
+ if (G_IS_CANCELLABLE (cancellable)) {
+ g_object_unref (m->base.cancellable);
+ m->base.cancellable = g_object_ref (cancellable);
}
m->uri = g_strdup (uri);
m->data = data;
@@ -1476,19 +1532,24 @@ remove_folder_desc (struct _remove_folder_msg *m)
}
static gboolean
-remove_folder_rec (CamelStore *store, CamelFolderInfo *fi, GError **error)
+remove_folder_rec (CamelStore *store,
+ CamelFolderInfo *fi,
+ GCancellable *cancellable,
+ GError **error)
{
while (fi) {
CamelFolder *folder;
if (fi->child) {
- if (!remove_folder_rec (store, fi->child, error))
+ if (!remove_folder_rec (
+ store, fi->child, cancellable, error))
return FALSE;
}
d(printf ("deleting folder '%s'\n", fi->full_name));
- folder = camel_store_get_folder (store, fi->full_name, 0, error);
+ folder = camel_store_get_folder (
+ store, fi->full_name, 0, cancellable, error);
if (folder == NULL)
return FALSE;
@@ -1499,20 +1560,26 @@ remove_folder_rec (CamelStore *store, CamelFolderInfo *fi, GError **error)
/* Delete every message in this folder, then expunge it */
camel_folder_freeze (folder);
for (i = 0; i < uids->len; i++)
- camel_folder_delete_message (folder, uids->pdata[i]);
+ camel_folder_delete_message (
+ folder, uids->pdata[i]);
camel_folder_free_uids (folder, uids);
- camel_folder_sync (folder, TRUE, NULL);
+ /* FIXME Not passing a GCancellable or GError here. */
+ camel_folder_sync (folder, TRUE, NULL, NULL);
camel_folder_thaw (folder);
}
- /* if the store supports subscriptions, unsubscribe from this folder... */
+ /* If the store supports subscriptions, unsubscribe
+ * from this folder.
+ * FIXME Not passing a GCancellable or GError here. */
if (camel_store_supports_subscriptions (store))
- camel_store_unsubscribe_folder (store, fi->full_name, NULL);
+ camel_store_unsubscribe_folder (
+ store, fi->full_name, NULL, NULL);
/* Then delete the folder from the store */
- if (!camel_store_delete_folder (store, fi->full_name, error))
+ if (!camel_store_delete_folder (
+ store, fi->full_name, cancellable, error))
return FALSE;
fi = fi->next;
@@ -1538,11 +1605,13 @@ remove_folder_exec (struct _remove_folder_msg *m)
CAMEL_STORE_FOLDER_INFO_RECURSIVE |
CAMEL_STORE_FOLDER_INFO_FAST |
CAMEL_STORE_FOLDER_INFO_SUBSCRIBED,
+ m->base.cancellable,
&m->base.error);
if (fi == NULL)
return;
- m->removed = remove_folder_rec (parent_store, fi, &m->base.error);
+ m->removed = remove_folder_rec (
+ parent_store, fi, m->base.cancellable, &m->base.error);
camel_store_free_folder_info (parent_store, fi);
}
@@ -1603,7 +1672,8 @@ sync_folder_desc (struct _sync_folder_msg *m)
static void
sync_folder_exec (struct _sync_folder_msg *m)
{
- camel_folder_sync (m->folder, FALSE, &m->base.error);
+ camel_folder_sync (
+ m->folder, FALSE, m->base.cancellable, &m->base.error);
}
static void
@@ -1670,7 +1740,9 @@ sync_store_desc (struct _sync_store_msg *m)
static void
sync_store_exec (struct _sync_store_msg *m)
{
- camel_store_sync (m->store, m->expunge, &m->base.error);
+ camel_store_sync (
+ m->store, m->expunge,
+ m->base.cancellable, &m->base.error);
}
static void
@@ -1720,10 +1792,8 @@ refresh_folder_desc (struct _sync_folder_msg *m)
static void
refresh_folder_exec (struct _sync_folder_msg *m)
{
- /* camel_folder_sync (m->folder, FALSE, &m->base.error); */
-
- /* if (!camel_exception_is_set (&m->base.error)) */
- camel_folder_refresh_info (m->folder, &m->base.error);
+ camel_folder_refresh_info (
+ m->folder, m->base.cancellable, &m->base.error);
}
/* we just use the sync stuff where we can, since it would be the same */
@@ -1760,7 +1830,8 @@ expunge_folder_desc (struct _sync_folder_msg *m)
static void
expunge_folder_exec (struct _sync_folder_msg *m)
{
- camel_folder_expunge (m->folder, &m->base.error);
+ camel_folder_expunge (
+ m->folder, m->base.cancellable, &m->base.error);
}
/* we just use the sync stuff where we can, since it would be the same */
@@ -1811,16 +1882,20 @@ empty_trash_exec (struct _empty_trash_msg *m)
gchar *uri;
if (m->account) {
- trash = mail_tool_get_trash (m->account->source->url, FALSE, &m->base.error);
+ trash = mail_tool_get_trash (
+ m->account->source->url, FALSE,
+ m->base.cancellable, &m->base.error);
} else {
data_dir = mail_session_get_data_dir ();
uri = g_strdup_printf ("mbox:%s/local", data_dir);
- trash = mail_tool_get_trash (uri, TRUE, &m->base.error);
+ trash = mail_tool_get_trash (
+ uri, TRUE, m->base.cancellable, &m->base.error);
g_free (uri);
}
if (trash) {
- camel_folder_expunge (trash, &m->base.error);
+ camel_folder_expunge (
+ trash, m->base.cancellable, &m->base.error);
g_object_unref (trash);
}
}
@@ -1884,10 +1959,12 @@ get_message_desc (struct _get_message_msg *m)
static void
get_message_exec (struct _get_message_msg *m)
{
- if (m->base.cancel && camel_operation_cancel_check (m->base.cancel))
+ if (g_cancellable_is_cancelled (m->base.cancellable))
m->message = NULL;
else
- m->message = camel_folder_get_message (m->folder, m->uid, &m->base.error);
+ m->message = camel_folder_get_message (
+ m->folder, m->uid,
+ m->base.cancellable, &m->base.error);
}
static void
@@ -2017,8 +2094,11 @@ get_messages_exec (struct _get_messages_msg *m)
for (i=0; i<m->uids->len; i++) {
gint pc = ((i+1) * 100) / m->uids->len;
- message = camel_folder_get_message (m->folder, m->uids->pdata[i], &m->base.error);
- camel_operation_progress (m->base.cancel, pc);
+ message = camel_folder_get_message (
+ m->folder, m->uids->pdata[i],
+ m->base.cancellable, &m->base.error);
+ camel_operation_progress (
+ m->base.cancellable, pc);
if (message == NULL)
break;
@@ -2157,8 +2237,11 @@ save_messages_exec (struct _save_messages_msg *m)
CamelMimeMessage *message;
gint pc = ((i+1) * 100) / m->uids->len;
- message = camel_folder_get_message (m->folder, m->uids->pdata[i], &m->base.error);
- camel_operation_progress (m->base.cancel, pc);
+ message = camel_folder_get_message (
+ m->folder, m->uids->pdata[i],
+ m->base.cancellable, &m->base.error);
+ camel_operation_progress (
+ m->base.cancellable, pc);
if (message == NULL)
break;
@@ -2349,7 +2432,7 @@ mail_save_part (CamelMimePart *part, const gchar *path,
struct _prep_offline_msg {
MailMsg base;
- CamelOperation *cancel;
+ GCancellable *cancel;
gchar *uri;
void (*done)(const gchar *uri, gpointer data);
gpointer data;
@@ -2360,26 +2443,24 @@ prep_offline_exec (struct _prep_offline_msg *m)
{
CamelFolder *folder;
- if (m->cancel)
- camel_operation_register (m->cancel);
-
- folder = mail_tool_uri_to_folder (m->uri, 0, &m->base.error);
+ folder = mail_tool_uri_to_folder (
+ m->uri, 0, m->base.cancellable, &m->base.error);
if (folder) {
if (CAMEL_IS_DISCO_FOLDER (folder)) {
- camel_disco_folder_prepare_for_offline ((CamelDiscoFolder *)folder,
- "(match-all)",
- &m->base.error);
+ camel_disco_folder_prepare_for_offline (
+ CAMEL_DISCO_FOLDER (folder),
+ "(match-all)", m->cancel, &m->base.error);
} else if (CAMEL_IS_OFFLINE_FOLDER (folder)) {
- camel_offline_folder_downsync ((CamelOfflineFolder *) folder, "(match-all)", &m->base.error);
+ camel_offline_folder_downsync (
+ CAMEL_OFFLINE_FOLDER (folder),
+ "(match-all)", m->cancel, &m->base.error);
}
/* prepare_for_offline should do this? */
/* of course it should all be atomic, but ... */
- camel_folder_sync (folder, FALSE, NULL);
+ /* FIXME Not passing a GCancellable here. */
+ camel_folder_sync (folder, FALSE, NULL, NULL);
g_object_unref (folder);
}
-
- if (m->cancel)
- camel_operation_unregister ();
}
static void
@@ -2414,9 +2495,8 @@ mail_prep_offline (const gchar *uri,
struct _prep_offline_msg *m;
m = mail_msg_new (&prep_offline_info);
- m->cancel = cancel;
- if (cancel)
- g_object_ref (cancel);
+ if (G_IS_CANCELLABLE (cancel))
+ m->cancel = g_object_ref (cancel);
m->uri = g_strdup (uri);
m->data = data;
m->done = done;
@@ -2452,26 +2532,34 @@ set_offline_exec (struct _set_offline_msg *m)
{
if (CAMEL_IS_DISCO_STORE (m->store)) {
if (!m->offline) {
- camel_disco_store_set_status (CAMEL_DISCO_STORE (m->store),
- CAMEL_DISCO_STORE_ONLINE,
- &m->base.error);
+ camel_disco_store_set_status (
+ CAMEL_DISCO_STORE (m->store),
+ CAMEL_DISCO_STORE_ONLINE,
+ m->base.cancellable,
+ &m->base.error);
return;
} else if (camel_disco_store_can_work_offline (CAMEL_DISCO_STORE (m->store))) {
- camel_disco_store_set_status (CAMEL_DISCO_STORE (m->store),
- CAMEL_DISCO_STORE_OFFLINE,
- &m->base.error);
+ camel_disco_store_set_status (
+ CAMEL_DISCO_STORE (m->store),
+ CAMEL_DISCO_STORE_OFFLINE,
+ m->base.cancellable,
+ &m->base.error);
return;
}
} else if (CAMEL_IS_OFFLINE_STORE (m->store)) {
if (!m->offline) {
- camel_offline_store_set_network_state (CAMEL_OFFLINE_STORE (m->store),
- CAMEL_OFFLINE_STORE_NETWORK_AVAIL,
- &m->base.error);
+ camel_offline_store_set_network_state (
+ CAMEL_OFFLINE_STORE (m->store),
+ CAMEL_OFFLINE_STORE_NETWORK_AVAIL,
+ m->base.cancellable,
+ &m->base.error);
return;
} else {
- camel_offline_store_set_network_state (CAMEL_OFFLINE_STORE (m->store),
- CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL,
- &m->base.error);
+ camel_offline_store_set_network_state (
+ CAMEL_OFFLINE_STORE (m->store),
+ CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL,
+ m->base.cancellable,
+ &m->base.error);
return;
}
}
@@ -2547,11 +2635,13 @@ static void
prepare_offline_exec (struct _set_offline_msg *m)
{
if (CAMEL_IS_DISCO_STORE (m->store)) {
- camel_disco_store_prepare_for_offline (CAMEL_DISCO_STORE (m->store),
- &m->base.error);
+ camel_disco_store_prepare_for_offline (
+ CAMEL_DISCO_STORE (m->store),
+ m->base.cancellable, &m->base.error);
} else if (CAMEL_IS_OFFLINE_STORE (m->store)) {
- camel_offline_store_prepare_for_offline (CAMEL_OFFLINE_STORE (m->store),
- &m->base.error);
+ camel_offline_store_prepare_for_offline (
+ CAMEL_OFFLINE_STORE (m->store),
+ m->base.cancellable, &m->base.error);
}
}
@@ -2637,7 +2727,8 @@ check_service_exec (struct _check_msg *m)
return;
}
- m->authtypes = camel_service_query_auth_types (service, &m->base.error);
+ m->authtypes = camel_service_query_auth_types (
+ service, m->base.cancellable, &m->base.error);
g_object_unref (service);
}
diff --git a/mail/mail-ops.h b/mail/mail-ops.h
index 879a62654e..06b838849b 100644
--- a/mail/mail-ops.h
+++ b/mail/mail-ops.h
@@ -71,7 +71,7 @@ gint mail_get_folder_quota (CamelFolder *folder,
gpointer data, MailMsgDispatchFunc dispatch);
/* and for a store */
-gint mail_get_store (const gchar *uri, CamelOperation *op,
+gint mail_get_store (const gchar *uri, GCancellable *cancellable,
void (*done) (gchar *uri, CamelStore *store, gpointer data), gpointer data);
/* build an attachment */
@@ -99,9 +99,10 @@ void mail_empty_trash (EAccount *account,
gpointer data);
/* get folder info asynchronously */
-gint mail_get_folderinfo (CamelStore *store, CamelOperation *op,
- gboolean (*done)(CamelStore *store, CamelFolderInfo *info, gpointer data),
- gpointer data);
+gint mail_get_folderinfo (CamelStore *store,
+ GCancellable *cancellable,
+ gboolean (*done)(CamelStore *store, CamelFolderInfo *info, gpointer data),
+ gpointer data);
/* remove an existing folder */
void mail_remove_folder (CamelFolder *folder,
@@ -124,23 +125,33 @@ gint mail_save_part (CamelMimePart *part, const gchar *path,
gpointer data, gboolean readonly);
/* yeah so this is messy, but it does a lot, maybe i can consolidate all user_data's to be the one */
-void mail_send_queue (CamelFolder *queue, const gchar *destination,
- const gchar *type, CamelOperation *cancel,
- CamelFilterGetFolderFunc get_folder, gpointer get_data,
- CamelFilterStatusFunc *status, gpointer status_data,
- void (*done)(const gchar *destination, gpointer data),
- gpointer data);
-
-void mail_fetch_mail (const gchar *source, gint keep,
- const gchar *type, CamelOperation *cancel,
- CamelFilterGetFolderFunc get_folder, gpointer get_data,
- CamelFilterStatusFunc *status, gpointer status_data,
- void (*done)(const gchar *source, gpointer data),
- gpointer data);
-
-void mail_filter_folder (CamelFolder *source_folder, GPtrArray *uids,
- const gchar *type, gboolean notify,
- CamelOperation *cancel);
+void mail_send_queue (CamelFolder *queue,
+ const gchar *destination,
+ const gchar *type,
+ GCancellable *cancellable,
+ CamelFilterGetFolderFunc get_folder,
+ gpointer get_data,
+ CamelFilterStatusFunc *status,
+ gpointer status_data,
+ void (*done)(const gchar *destination, gpointer data),
+ gpointer data);
+
+void mail_fetch_mail (const gchar *source,
+ gint keep,
+ const gchar *type,
+ GCancellable *cancellable,
+ CamelFilterGetFolderFunc get_folder,
+ gpointer get_data,
+ CamelFilterStatusFunc *status,
+ gpointer status_data,
+ void (*done)(const gchar *source, gpointer data),
+ gpointer data);
+
+void mail_filter_folder (CamelFolder *source_folder,
+ GPtrArray *uids,
+ const gchar *type,
+ gboolean notify,
+ CamelOperation *cancel);
/* convenience functions for above */
void mail_filter_on_demand (CamelFolder *folder, GPtrArray *uids);
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index c7d1b3c0b4..186fc9054f 100644
--- a/mail/mail-send-recv.c
+++ b/mail/mail-send-recv.c
@@ -101,7 +101,7 @@ typedef enum {
struct _send_info {
send_info_t type; /* 0 = fetch, 1 = send */
- CamelOperation *cancel;
+ GCancellable *cancellable;
gchar *uri;
gboolean keep_on_server;
send_state_t state;
@@ -145,8 +145,8 @@ static void
free_send_info (struct _send_info *info)
{
g_free (info->uri);
- if (info->cancel)
- g_object_unref (info->cancel);
+ if (info->cancellable)
+ g_object_unref (info->cancellable);
if (info->timeout_id != 0)
g_source_remove (info->timeout_id);
g_free (info->what);
@@ -181,7 +181,7 @@ static void
receive_cancel (GtkButton *button, struct _send_info *info)
{
if (info->state == SEND_ACTIVE) {
- camel_operation_cancel (info->cancel);
+ camel_operation_cancel (CAMEL_OPERATION (info->cancellable));
if (info->status_label)
gtk_label_set_text (
GTK_LABEL (info->status_label),
@@ -529,12 +529,12 @@ build_dialog (GtkWindow *parent,
info->uri = g_strdup (source->url);
info->keep_on_server = source->keep_on_server;
- info->cancel = camel_operation_new ();
+ info->cancellable = (GCancellable *) camel_operation_new ();
info->state = SEND_ACTIVE;
info->timeout_id = g_timeout_add (STATUS_TIMEOUT, operation_status_timeout, info);
g_signal_connect (
- info->cancel, "status",
+ info->cancellable, "status",
G_CALLBACK (operation_status), info);
g_hash_table_insert (data->active, info->uri, info);
@@ -619,12 +619,12 @@ build_dialog (GtkWindow *parent,
info->uri = g_strdup (destination);
info->keep_on_server = FALSE;
- info->cancel = camel_operation_new ();
+ info->cancellable = (GCancellable *) camel_operation_new ();
info->state = SEND_ACTIVE;
info->timeout_id = g_timeout_add (STATUS_TIMEOUT, operation_status_timeout, info);
g_signal_connect (
- info->cancel, "status",
+ info->cancellable, "status",
G_CALLBACK (operation_status), info);
g_hash_table_insert (data->active, (gpointer) SEND_URI_KEY, info);
@@ -765,7 +765,7 @@ receive_done (const gchar *uri, gpointer data)
mail_send_queue (local_outbox,
info->uri,
E_FILTER_SOURCE_OUTGOING,
- info->cancel,
+ info->cancellable,
receive_get_folder, info,
receive_status, info,
receive_done, info);
@@ -830,7 +830,8 @@ receive_get_folder (CamelFilterDriver *d,
g_object_ref (oldinfo->folder);
return oldinfo->folder;
}
- folder = mail_tool_uri_to_folder (uri, 0, error);
+ /* FIXME Not passing a GCancellable here. */
+ folder = mail_tool_uri_to_folder (uri, 0, NULL, error);
if (!folder)
return NULL;
@@ -905,17 +906,20 @@ refresh_folders_exec (struct _refresh_folders_msg *m)
get_folders (m->store, m->folders, m->finfo);
for (i=0;i<m->folders->len;i++) {
- folder = mail_tool_uri_to_folder (m->folders->pdata[i], 0, &local_error);
+ folder = mail_tool_uri_to_folder (
+ m->folders->pdata[i], 0,
+ m->base.cancellable, &local_error);
if (folder) {
- camel_folder_sync (folder, FALSE, NULL);
- camel_folder_refresh_info (folder, NULL);
+ /* FIXME Not passing a GCancellable or GError here. */
+ camel_folder_sync (folder, FALSE, NULL, NULL);
+ camel_folder_refresh_info (folder, NULL, NULL);
g_object_unref (folder);
} else if (local_error != NULL) {
g_warning ("Failed to refresh folders: %s", local_error->message);
g_clear_error (&local_error);
}
- if (camel_operation_cancel_check (m->info->cancel))
+ if (g_cancellable_is_cancelled (m->info->cancellable))
break;
}
}
@@ -979,8 +983,9 @@ receive_update_got_store (gchar *uri, CamelStore *store, gpointer data)
struct _send_info *info = data;
if (store) {
- mail_folder_cache_note_store (mail_folder_cache_get_default (),
- store, info->cancel,
+ mail_folder_cache_note_store (
+ mail_folder_cache_get_default (),
+ store, info->cancellable,
receive_update_got_folderinfo, info);
} else {
receive_done("", info);
@@ -1021,24 +1026,29 @@ mail_send_receive (GtkWindow *parent)
switch (info->type) {
case SEND_RECEIVE:
- mail_fetch_mail (info->uri, info->keep_on_server,
- E_FILTER_SOURCE_INCOMING,
- info->cancel,
- receive_get_folder, info,
- receive_status, info,
- receive_done, info);
+ mail_fetch_mail (
+ info->uri,
+ info->keep_on_server,
+ E_FILTER_SOURCE_INCOMING,
+ info->cancellable,
+ receive_get_folder, info,
+ receive_status, info,
+ receive_done, info);
break;
case SEND_SEND:
/* todo, store the folder in info? */
- mail_send_queue (local_outbox, info->uri,
- E_FILTER_SOURCE_OUTGOING,
- info->cancel,
- receive_get_folder, info,
- receive_status, info,
- receive_done, info);
+ mail_send_queue (
+ local_outbox, info->uri,
+ E_FILTER_SOURCE_OUTGOING,
+ info->cancellable,
+ receive_get_folder, info,
+ receive_status, info,
+ receive_done, info);
break;
case SEND_UPDATE:
- mail_get_store (info->uri, info->cancel, receive_update_got_store, info);
+ mail_get_store (
+ info->uri, info->cancellable,
+ receive_update_got_store, info);
break;
default:
break;
@@ -1239,14 +1249,14 @@ mail_receive_uri (const gchar *uri, gboolean keep_on_server)
info->status_label = NULL;
info->uri = g_strdup (uri);
info->keep_on_server = keep_on_server;
- info->cancel = camel_operation_new ();
+ info->cancellable = (GCancellable *) camel_operation_new ();
info->cancel_button = NULL;
info->data = data;
info->state = SEND_ACTIVE;
info->timeout_id = 0;
g_signal_connect (
- info->cancel, "status",
+ info->cancellable, "status",
G_CALLBACK (operation_status), info);
d(printf("Adding new info %p\n", info));
@@ -1255,25 +1265,29 @@ mail_receive_uri (const gchar *uri, gboolean keep_on_server)
switch (info->type) {
case SEND_RECEIVE:
- mail_fetch_mail (info->uri, info->keep_on_server,
- E_FILTER_SOURCE_INCOMING,
- info->cancel,
- receive_get_folder, info,
- receive_status, info,
- receive_done, info);
+ mail_fetch_mail (
+ info->uri, info->keep_on_server,
+ E_FILTER_SOURCE_INCOMING,
+ info->cancellable,
+ receive_get_folder, info,
+ receive_status, info,
+ receive_done, info);
break;
case SEND_SEND:
/* todo, store the folder in info? */
local_outbox = e_mail_local_get_folder (E_MAIL_FOLDER_OUTBOX);
- mail_send_queue (local_outbox, info->uri,
- E_FILTER_SOURCE_OUTGOING,
- info->cancel,
- receive_get_folder, info,
- receive_status, info,
- receive_done, info);
+ mail_send_queue (
+ local_outbox, info->uri,
+ E_FILTER_SOURCE_OUTGOING,
+ info->cancellable,
+ receive_get_folder, info,
+ receive_status, info,
+ receive_done, info);
break;
case SEND_UPDATE:
- mail_get_store (info->uri, info->cancel, receive_update_got_store, info);
+ mail_get_store (
+ info->uri, info->cancellable,
+ receive_update_got_store, info);
break;
default:
g_return_if_reached ();
@@ -1315,7 +1329,7 @@ mail_send (void)
info->status_label = NULL;
info->uri = g_strdup (transport->url);
info->keep_on_server = FALSE;
- info->cancel = NULL;
+ info->cancellable = NULL;
info->cancel_button = NULL;
info->data = data;
info->state = SEND_ACTIVE;
@@ -1329,7 +1343,7 @@ mail_send (void)
local_outbox = e_mail_local_get_folder (E_MAIL_FOLDER_OUTBOX);
mail_send_queue (local_outbox, info->uri,
E_FILTER_SOURCE_OUTGOING,
- info->cancel,
+ info->cancellable,
receive_get_folder, info,
receive_status, info,
receive_done, info);
diff --git a/mail/mail-session.c b/mail/mail-session.c
index c3ba26cb10..dbe886d69a 100644
--- a/mail/mail-session.c
+++ b/mail/mail-session.c
@@ -478,7 +478,8 @@ get_folder (CamelFilterDriver *d,
gpointer data,
GError **error)
{
- return mail_tool_uri_to_folder (uri, 0, error);
+ /* FIXME Not passing a GCancellable here. */
+ return mail_tool_uri_to_folder (uri, 0, NULL, error);
}
static void
@@ -636,7 +637,7 @@ static gpointer ms_thread_msg_new (CamelSession *session, CamelSessionThreadOps
msg->data = m;
g_object_unref (msg->op);
- msg->op = g_object_ref (m->cancel);
+ msg->op = g_object_ref (m->cancellable);
}
return msg;
@@ -780,7 +781,8 @@ ms_forward_to (CamelSession *session,
/* and send it */
info = camel_message_info_new (NULL);
out_folder = e_mail_local_get_folder (E_MAIL_FOLDER_OUTBOX);
- camel_message_info_set_flags (info, CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN);
+ camel_message_info_set_flags (
+ info, CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN);
mail_append_mail (out_folder, forward, info, ms_forward_to_cb, NULL);
return TRUE;
diff --git a/mail/mail-tools.c b/mail/mail-tools.c
index d717c29540..66ffdd207a 100644
--- a/mail/mail-tools.c
+++ b/mail/mail-tools.c
@@ -44,7 +44,9 @@
/* **************************************** */
CamelFolder *
-mail_tool_get_inbox (const gchar *url, GError **error)
+mail_tool_get_inbox (const gchar *url,
+ GCancellable *cancellable,
+ GError **error)
{
CamelStore *store;
CamelFolder *folder;
@@ -53,7 +55,7 @@ mail_tool_get_inbox (const gchar *url, GError **error)
if (!store)
return NULL;
- folder = camel_store_get_inbox (store, error);
+ folder = camel_store_get_inbox (store, cancellable, error);
g_object_unref (store);
return folder;
@@ -76,6 +78,7 @@ is_local_provider (CamelStore *store)
CamelFolder *
mail_tool_get_trash (const gchar *url,
gint connect,
+ GCancellable *cancellable,
GError **error)
{
CamelStore *store;
@@ -93,7 +96,7 @@ mail_tool_get_trash (const gchar *url,
if (connect ||
(CAMEL_SERVICE (store)->status == CAMEL_SERVICE_CONNECTED ||
is_local_provider (store)))
- trash = camel_store_get_trash (store, error);
+ trash = camel_store_get_trash (store, cancellable, error);
else
trash = NULL;
@@ -293,7 +296,10 @@ mail_tool_make_message_attachment (CamelMimeMessage *message)
}
CamelFolder *
-mail_tool_uri_to_folder (const gchar *uri, guint32 flags, GError **error)
+mail_tool_uri_to_folder (const gchar *uri,
+ guint32 flags,
+ GCancellable *cancellable,
+ GError **error)
{
CamelURL *url;
CamelStore *store = NULL;
@@ -345,11 +351,14 @@ mail_tool_uri_to_folder (const gchar *uri, guint32 flags, GError **error)
if (offset) {
if (offset == 7)
- folder = camel_store_get_trash (store, error);
+ folder = camel_store_get_trash (
+ store, cancellable, error);
else if (offset == 6)
- folder = camel_store_get_junk (store, error);
+ folder = camel_store_get_junk (
+ store, cancellable, error);
} else
- folder = camel_store_get_folder (store, name, flags, error);
+ folder = camel_store_get_folder (
+ store, name, flags, cancellable, error);
g_object_unref (store);
}
@@ -381,7 +390,8 @@ mail_tools_x_evolution_message_parse (gchar *in, guint inlen, GPtrArray **uids)
if (in == NULL)
return NULL;
- folder = mail_tool_uri_to_folder (in, 0, NULL);
+ /* FIXME Not passing a GCancellable or GError here. */
+ folder = mail_tool_uri_to_folder (in, 0, NULL, NULL);
if (!folder)
return NULL;
diff --git a/mail/mail-tools.h b/mail/mail-tools.h
index 01c800fbd9..e746e9f5ec 100644
--- a/mail/mail-tools.h
+++ b/mail/mail-tools.h
@@ -27,10 +27,15 @@
#include <camel/camel.h>
/* Get the "inbox" for a url (uses global session) */
-CamelFolder *mail_tool_get_inbox (const gchar *url, GError **error);
+CamelFolder * mail_tool_get_inbox (const gchar *url,
+ GCancellable *cancellable,
+ GError **error);
/* Get the "trash" for a url (uses global session) */
-CamelFolder *mail_tool_get_trash (const gchar *url, gint connect, GError **error);
+CamelFolder * mail_tool_get_trash (const gchar *url,
+ gint connect,
+ GCancellable *cancellable,
+ GError **error);
/* Does a camel_movemail into the local movemail folder
* and returns the path to the new movemail folder that was created. which shoudl be freed later */
@@ -45,8 +50,11 @@ gchar *mail_tool_generate_forward_subject (CamelMimeMessage *msg);
/* Make a message into an attachment */
CamelMimePart *mail_tool_make_message_attachment (CamelMimeMessage *message);
-/* Parse the ui into a real CamelFolder any way we know how. */
-CamelFolder *mail_tool_uri_to_folder (const gchar *uri, guint32 flags, GError **error);
+/* Parse the URI into a real CamelFolder any way we know how. */
+CamelFolder * mail_tool_uri_to_folder (const gchar *uri,
+ guint32 flags,
+ GCancellable *cancellable,
+ GError **error);
GHashTable *mail_lookup_url_table (CamelMimeMessage *mime_message);
diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c
index 9cb2844bff..221151c5ea 100644
--- a/mail/mail-vfolder.c
+++ b/mail/mail-vfolder.c
@@ -98,7 +98,8 @@ vfolder_setup_exec (struct _setup_msg *m)
while (l && !vfolder_shutdown) {
d(printf(" Adding uri: %s\n", (gchar *)l->data));
- folder = mail_tool_uri_to_folder (l->data, 0, NULL);
+ /* FIXME Not passing a GCancellable or GError here. */
+ folder = mail_tool_uri_to_folder (l->data, 0, NULL, NULL);
if (folder != NULL)
list = g_list_append (list, folder);
l = l->next;
@@ -254,13 +255,16 @@ vfolder_adduri_exec (struct _adduri_msg *m)
}
if (folder == NULL)
- folder = mail_tool_uri_to_folder (m->uri, 0, &m->base.error);
+ folder = mail_tool_uri_to_folder (
+ m->uri, 0, m->base.cancellable, &m->base.error);
if (folder != NULL) {
l = m->folders;
while (l && !vfolder_shutdown) {
if (m->remove)
- camel_vee_folder_remove_folder ((CamelVeeFolder *)l->data, folder);
+ camel_vee_folder_remove_folder (
+ CAMEL_VEE_FOLDER (l->data),
+ folder, m->base.cancellable);
else
camel_vee_folder_add_folder ((CamelVeeFolder *)l->data, folder);
l = l->next;
@@ -829,7 +833,9 @@ rule_changed (EFilterRule *rule, CamelFolder *folder)
}
oldname = g_strdup (full_name);
- camel_store_rename_folder (vfolder_store, oldname, rule->name, NULL);
+ /* FIXME Not passing a GCancellable or GError. */
+ camel_store_rename_folder (
+ vfolder_store, oldname, rule->name, NULL, NULL);
g_free (oldname);
}
@@ -853,14 +859,18 @@ rule_changed (EFilterRule *rule, CamelFolder *folder)
g_string_free (query, TRUE);
}
-static void context_rule_added (ERuleContext *ctx, EFilterRule *rule)
+static void
+context_rule_added (ERuleContext *ctx,
+ EFilterRule *rule)
{
CamelFolder *folder;
d(printf("rule added: %s\n", rule->name));
/* this always runs quickly */
- folder = camel_store_get_folder (vfolder_store, rule->name, 0, NULL);
+ /* FIXME Not passing a GCancellable or GError. */
+ folder = camel_store_get_folder (
+ vfolder_store, rule->name, 0, NULL, NULL);
if (folder) {
g_signal_connect(rule, "changed", G_CALLBACK(rule_changed), folder);
@@ -872,7 +882,9 @@ static void context_rule_added (ERuleContext *ctx, EFilterRule *rule)
}
}
-static void context_rule_removed (ERuleContext *ctx, EFilterRule *rule)
+static void
+context_rule_removed (ERuleContext *ctx,
+ EFilterRule *rule)
{
gpointer key, folder = NULL;
@@ -887,7 +899,8 @@ static void context_rule_removed (ERuleContext *ctx, EFilterRule *rule)
}
G_UNLOCK (vfolder);
- camel_store_delete_folder (vfolder_store, rule->name, NULL);
+ /* FIXME Not passing a GCancellable or GError. */
+ camel_store_delete_folder (vfolder_store, rule->name, NULL, NULL);
/* this must be unref'd after its deleted */
if (folder)
g_object_unref ((CamelFolder *) folder);
diff --git a/mail/message-list.c b/mail/message-list.c
index ff7350a327..c6a8092046 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -937,9 +937,12 @@ message_list_copy (MessageList *ml, gboolean cut)
camel_folder_freeze (ml->folder);
for (i=0;i<uids->len;i++)
- camel_folder_set_message_flags (ml->folder, uids->pdata[i],
- CAMEL_MESSAGE_SEEN | CAMEL_MESSAGE_DELETED,
- CAMEL_MESSAGE_SEEN | CAMEL_MESSAGE_DELETED);
+ camel_folder_set_message_flags (
+ ml->folder, uids->pdata[i],
+ CAMEL_MESSAGE_SEEN |
+ CAMEL_MESSAGE_DELETED,
+ CAMEL_MESSAGE_SEEN |
+ CAMEL_MESSAGE_DELETED);
camel_folder_thaw (ml->folder);
}
@@ -2108,8 +2111,9 @@ ml_selection_received (GtkWidget *widget,
return;
}
+ /* FIXME Not passing a GCancellable or GError here. */
em_utils_selection_get_uidlist (
- selection_data, ml->folder, FALSE, NULL);
+ selection_data, ml->folder, FALSE, NULL, NULL);
}
static void
@@ -2176,6 +2180,7 @@ ml_drop_async_exec (struct _drop_msg *m)
em_utils_selection_get_uidlist (
m->selection, m->folder,
m->action == GDK_ACTION_MOVE,
+ m->base.cancellable,
&m->base.error);
break;
case DND_MESSAGE_RFC822:
@@ -4514,7 +4519,7 @@ regen_list_exec (struct _regen_list_msg *m)
e_profile_event_emit("list.threaduids", m->folder->full_name, 0);
/* camel_folder_summary_prepare_fetch_all (m->folder->summary, NULL); */
- if (!camel_operation_cancel_check (m->base.cancel)) {
+ if (!g_cancellable_is_cancelled (m->base.cancellable)) {
/* update/build a new tree */
if (m->dotree) {
ml_sort_uids_by_tree (m->ml, uids);
@@ -4557,7 +4562,7 @@ regen_list_done (struct _regen_list_msg *m)
if (!m->complete)
return;
- if (camel_operation_cancel_check (m->base.cancel))
+ if (g_cancellable_is_cancelled (m->base.cancellable))
return;
if (m->ml->folder != m->folder)
@@ -4744,8 +4749,9 @@ mail_regen_cancel (MessageList *ml)
while (l) {
MailMsg *mm = l->data;
- if (mm->cancel)
- camel_operation_cancel (mm->cancel);
+ if (mm->cancellable)
+ camel_operation_cancel (
+ CAMEL_OPERATION (mm->cancellable));
l = l->next;
}
diff --git a/modules/mail/e-mail-attachment-handler.c b/modules/mail/e-mail-attachment-handler.c
index 313dddeac4..99d16e9a34 100644
--- a/modules/mail/e-mail-attachment-handler.c
+++ b/modules/mail/e-mail-attachment-handler.c
@@ -288,14 +288,16 @@ mail_attachment_handler_x_uid_list (EAttachmentView *view,
goto exit;
/* The first string is the folder URI. */
- folder = mail_tool_uri_to_folder (data, 0, &local_error);
+ /* FIXME Not passing a GCancellable here. */
+ folder = mail_tool_uri_to_folder (data, 0, NULL, &local_error);
if (folder == NULL)
goto exit;
/* Handle one message. */
if (uids->len == 1) {
+ /* FIXME Not passing a GCancellable here. */
message = camel_folder_get_message (
- folder, uids->pdata[0], &local_error);
+ folder, uids->pdata[0], NULL, &local_error);
if (message == NULL)
goto exit;
@@ -318,8 +320,9 @@ mail_attachment_handler_x_uid_list (EAttachmentView *view,
camel_multipart_set_boundary (multipart, NULL);
for (ii = 0; ii < uids->len; ii++) {
+ /* FIXME Not passing a GCancellable here. */
message = camel_folder_get_message (
- folder, uids->pdata[ii], &local_error);
+ folder, uids->pdata[ii], NULL, &local_error);
if (message == NULL) {
g_object_unref (multipart);
goto exit;
diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c
index f1696692dd..24d3ecab58 100644
--- a/modules/mail/e-mail-shell-backend.c
+++ b/modules/mail/e-mail-shell-backend.c
@@ -795,5 +795,6 @@ mbox_fill_preview_cb (GObject *preview, CamelMimeMessage *msg)
format = g_object_get_data (preview, "mbox-imp-formatter");
g_return_if_fail (format != NULL);
- em_format_format (EM_FORMAT (format), NULL, NULL, msg);
+ /* FIXME Not passing a GCancellable here. */
+ em_format_format (EM_FORMAT (format), NULL, NULL, msg, NULL);
}
diff --git a/modules/mail/e-mail-shell-view.c b/modules/mail/e-mail-shell-view.c
index 3e58330d93..f6603446ea 100644
--- a/modules/mail/e-mail-shell-view.c
+++ b/modules/mail/e-mail-shell-view.c
@@ -563,7 +563,8 @@ all_accounts:
iter = mail_vfolder_get_sources_local ();
while (iter != NULL) {
folder_uri = iter->data;
- folder = mail_tool_uri_to_folder (folder_uri, 0, NULL);
+ /* FIXME Not passing a GCancellable or GError here. */
+ folder = mail_tool_uri_to_folder (folder_uri, 0, NULL, NULL);
if (folder != NULL)
list = g_list_append (list, folder);
@@ -577,7 +578,8 @@ all_accounts:
iter = mail_vfolder_get_sources_remote ();
while (iter != NULL) {
folder_uri = iter->data;
- folder = mail_tool_uri_to_folder (folder_uri, 0, NULL);
+ /* FIXME Not passing a GCancellable or GError here. */
+ folder = mail_tool_uri_to_folder (folder_uri, 0, NULL, NULL);
if (folder != NULL)
list = g_list_append (list, folder);
diff --git a/plugins/dbx-import/dbx-importer.c b/plugins/dbx-import/dbx-importer.c
index 9905b617b7..fd3825762c 100644
--- a/plugins/dbx-import/dbx-importer.c
+++ b/plugins/dbx-import/dbx-importer.c
@@ -552,7 +552,9 @@ dbx_import_file (DbxImporter *m)
m->parent_uri = g_strdup (((EImportTargetURI *)m->target)->uri_dest); /* Destination folder, was set in our widget */
camel_operation_start (NULL, _("Importing '%s'"), filename);
- folder = mail_tool_uri_to_folder (m->parent_uri, CAMEL_STORE_FOLDER_CREATE, &m->base.error);
+ folder = mail_tool_uri_to_folder (
+ m->parent_uri, CAMEL_STORE_FOLDER_CREATE,
+ m->base.cancellable, &m->base.error);
if (!folder)
return;
d(printf("importing to %s\n", camel_folder_get_full_name(folder)));
@@ -623,7 +625,8 @@ dbx_import_file (DbxImporter *m)
info = camel_message_info_new (NULL);
camel_message_info_set_flags (info, flags, ~0);
success = camel_folder_append_message (
- folder, msg, info, NULL, &m->base.error);
+ folder, msg, info, NULL,
+ m->base.cancellable, &m->base.error);
camel_message_info_free (info);
g_object_unref (msg);
@@ -637,7 +640,8 @@ dbx_import_file (DbxImporter *m)
close (m->dbx_fd);
if (m->indices)
g_free (m->indices);
- camel_folder_sync (folder, FALSE, NULL);
+ /* FIXME Not passing GCancellable or GError here. */
+ camel_folder_sync (folder, FALSE, NULL, NULL);
camel_folder_thaw (folder);
g_object_unref (folder);
if (missing && m->base.error == NULL) {
diff --git a/plugins/groupwise-features/install-shared.c b/plugins/groupwise-features/install-shared.c
index 2db4eaf4e7..b753653229 100644
--- a/plugins/groupwise-features/install-shared.c
+++ b/plugins/groupwise-features/install-shared.c
@@ -103,12 +103,16 @@ install_folder_response (EMFolderSelector *emfs, gint response, gpointer *data)
if (e_gw_connection_accept_shared_folder (cnc, folder_name, container_id, (gchar *)item_id, NULL) == E_GW_CONNECTION_STATUS_OK) {
- folder = camel_store_get_folder (store, "Mailbox", 0, NULL);
+ /* FIXME Not passing a GCancellable or GError here. */
+ folder = camel_store_get_folder (store, "Mailbox", 0, NULL, NULL);
/*changes = camel_folder_change_info_new ();
camel_folder_change_info_remove_uid (changes, (gchar *) item_id);
camel_folder_summary_remove_uid (folder->summary, item_id);*/
/* camel_folder_delete_message (folder, item_id); */
- camel_folder_set_message_flags (folder, item_id, CAMEL_MESSAGE_DELETED, CAMEL_MESSAGE_DELETED);
+ camel_folder_set_message_flags (
+ folder, item_id,
+ CAMEL_MESSAGE_DELETED,
+ CAMEL_MESSAGE_DELETED);
camel_folder_summary_touch (folder->summary);
/* camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", changes); */
uri = camel_url_to_string (((CamelService *) store)->url, CAMEL_URL_HIDE_ALL);
diff --git a/plugins/groupwise-features/share-folder-common.c b/plugins/groupwise-features/share-folder-common.c
index 1b6fb180ea..9a345f1ba6 100644
--- a/plugins/groupwise-features/share-folder-common.c
+++ b/plugins/groupwise-features/share-folder-common.c
@@ -142,9 +142,14 @@ create_folder_exec (struct _EMCreateFolder *m)
{
d(printf ("creating folder parent='%s' name='%s' full_name='%s'\n", m->parent, m->name, m->full_name));
- if ((m->fi = camel_store_create_folder (m->store, m->parent, m->name, &m->base.error))) {
+ if ((m->fi = camel_store_create_folder (
+ m->store, m->parent, m->name,
+ m->base.cancellable, &m->base.error))) {
+
if (camel_store_supports_subscriptions (m->store))
- camel_store_subscribe_folder (m->store, m->full_name, &m->base.error);
+ camel_store_subscribe_folder (
+ m->store, m->full_name,
+ m->base.cancellable, &m->base.error);
}
}
diff --git a/plugins/groupwise-features/status-track.c b/plugins/groupwise-features/status-track.c
index 2ff2764a12..61c1ac25f0 100644
--- a/plugins/groupwise-features/status-track.c
+++ b/plugins/groupwise-features/status-track.c
@@ -73,7 +73,9 @@ get_selected_message (EShellView *shell_view,
*folder = e_mail_reader_get_folder (reader);
*selected_uid = g_strdup (g_ptr_array_index (uids, 0));
- msg = camel_folder_get_message (*folder, *selected_uid, NULL);
+ /* FIXME Not passing a GCancellable or GError here. */
+ msg = camel_folder_get_message (
+ *folder, *selected_uid, NULL, NULL);
}
em_utils_uids_free (uids);
diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c
index f0ca0fd807..15fdf6f9e1 100644
--- a/plugins/itip-formatter/itip-formatter.c
+++ b/plugins/itip-formatter/itip-formatter.c
@@ -132,7 +132,7 @@ struct _itip_puri {
void format_itip (EPlugin *ep, EMFormatHookTarget *target);
GtkWidget *itip_formatter_page_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_data);
-static void itip_attachment_frame (EMFormat *emf, CamelStream *stream, EMFormatPURI *puri);
+static void itip_attachment_frame (EMFormat *emf, CamelStream *stream, EMFormatPURI *puri, GCancellable *cancellable);
gint e_plugin_lib_enable (EPlugin *ep, gint enable);
typedef struct {
@@ -2025,9 +2025,8 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data)
}
}
- if (!save_schedules && pitip->delete_message) {
+ if (!save_schedules && pitip->delete_message)
camel_folder_delete_message (pitip->folder, pitip->uid);
- }
if (itip_view_get_rsvp (ITIP_VIEW (pitip->view)) && status) {
ECalComponent *comp = NULL;
@@ -2097,7 +2096,10 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data)
e_cal_component_rescan (comp);
if (itip_send_comp (E_CAL_COMPONENT_METHOD_REPLY, comp, pitip->current_ecal, pitip->top_level, NULL, NULL, TRUE, FALSE)) {
- camel_folder_set_message_flags (pitip->folder, pitip->uid, CAMEL_MESSAGE_ANSWERED, CAMEL_MESSAGE_ANSWERED);
+ camel_folder_set_message_flags (
+ pitip->folder, pitip->uid,
+ CAMEL_MESSAGE_ANSWERED,
+ CAMEL_MESSAGE_ANSWERED);
}
g_object_unref (comp);
@@ -2748,12 +2750,17 @@ itip_formatter_page_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_data)
}
static void
-itip_attachment_frame (EMFormat *emf, CamelStream *stream, EMFormatPURI *puri)
+itip_attachment_frame (EMFormat *emf,
+ CamelStream *stream,
+ EMFormatPURI *puri,
+ GCancellable *cancellable)
{
struct _itip_puri *info = (struct _itip_puri *)puri;
- d(printf("writing to frame content, handler is '%s'\n", info->handle->mime_type));
- info->handle->handler (emf, stream, info->puri.part, info->handle, FALSE);
+ info->handle->handler (
+ emf, stream, info->puri.part,
+ info->handle, cancellable, FALSE);
+
camel_stream_close (stream, NULL);
}
diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c
index 86663cc3b5..88d9d09e3a 100644
--- a/plugins/mail-to-task/mail-to-task.c
+++ b/plugins/mail-to-task/mail-to-task.c
@@ -780,7 +780,10 @@ do_mail_to_event (AsyncData *data)
struct _manage_comp *mc;
/* retrieve the message from the CamelFolder */
- message = camel_folder_get_message (folder, g_ptr_array_index (uids, i), NULL);
+ /* FIXME Not passing a GCancellable or GError. */
+ message = camel_folder_get_message (
+ folder, g_ptr_array_index (uids, i),
+ NULL, NULL);
if (!message) {
continue;
}
diff --git a/plugins/mark-all-read/mark-all-read.c b/plugins/mark-all-read/mark-all-read.c
index 5649bd8661..10d0eae5e9 100644
--- a/plugins/mark-all-read/mark-all-read.c
+++ b/plugins/mark-all-read/mark-all-read.c
@@ -348,18 +348,20 @@ mark_all_as_read (CamelFolder *folder)
static gboolean
mar_all_sub_folders (CamelStore *store,
CamelFolderInfo *fi,
+ GCancellable *cancellable,
GError **error)
{
while (fi) {
CamelFolder *folder;
if (fi->child) {
- if (!mar_all_sub_folders (store, fi->child, error))
+ if (!mar_all_sub_folders (
+ store, fi->child, cancellable, error))
return FALSE;
}
folder = camel_store_get_folder (
- store, fi->full_name, 0, error);
+ store, fi->full_name, 0, cancellable, error);
if (folder == NULL)
return FALSE;
@@ -389,10 +391,11 @@ mar_got_folder (gchar *folder_uri,
full_name = camel_folder_get_full_name (folder);
parent_store = camel_folder_get_parent_store (folder);
+ /* FIXME Not passing a GCancellable or GError here. */
folder_info = camel_store_get_folder_info (
parent_store, full_name,
CAMEL_STORE_FOLDER_INFO_RECURSIVE |
- CAMEL_STORE_FOLDER_INFO_FAST, NULL);
+ CAMEL_STORE_FOLDER_INFO_FAST, NULL, NULL);
if (folder_info == NULL)
goto exit;
@@ -405,7 +408,8 @@ mar_got_folder (gchar *folder_uri,
if (response == MARK_ALL_READ_CURRENT_FOLDER)
mark_all_as_read (folder);
else if (response == MARK_ALL_READ_WITH_SUBFOLDERS)
- mar_all_sub_folders (parent_store, folder_info, NULL);
+ /* FIXME Not passing a GCancellable or GError here. */
+ mar_all_sub_folders (parent_store, folder_info, NULL, NULL);
exit:
camel_store_free_folder_info (parent_store, folder_info);
diff --git a/plugins/prefer-plain/prefer-plain.c b/plugins/prefer-plain/prefer-plain.c
index 630b5e3ab4..f82a217f9a 100644
--- a/plugins/prefer-plain/prefer-plain.c
+++ b/plugins/prefer-plain/prefer-plain.c
@@ -66,9 +66,13 @@ make_part_attachment (EMFormat *format, CamelStream *stream, CamelMimePart *part
g_free (str);
}
- em_format_part_as (format, stream, part, "application/octet-stream");
+ /* FIXME Not passing a GCancellable here. */
+ em_format_part_as (
+ format, stream, part,
+ "application/octet-stream", NULL);
} else
- em_format_part (format, stream, part);
+ /* FIXME Not passing a GCancellable here. */
+ em_format_part (format, stream, part, NULL);
g_string_truncate (format->part_id, partidlen);
}
@@ -80,7 +84,10 @@ org_gnome_prefer_plain_text_html (gpointer ep, EMFormatHookTarget *t)
if (epp_mode != EPP_TEXT
|| strstr (t->format->part_id->str, ".alternative-prefer-plain.") != NULL
|| em_format_is_inline (t->format, t->format->part_id->str, t->part, &(t->item->handler)))
- t->item->handler.old->handler (t->format, t->stream, t->part, t->item->handler.old, FALSE);
+ /* FIXME Not passing a GCancellable here. */
+ t->item->handler.old->handler (
+ t->format, t->stream, t->part,
+ t->item->handler.old, NULL, FALSE);
else if (epp_show_suppressed)
make_part_attachment (t->format, t->stream, t->part, -1);
}
@@ -155,10 +162,16 @@ org_gnome_prefer_plain_multipart_alternative (gpointer ep, EMFormatHookTarget *t
if (display_part && have_plain && nparts == 2) {
g_string_append_printf (t->format->part_id, ".alternative-prefer-plain.%d", displayid);
- em_format_part_as (t->format, t->stream, display_part, "text/html");
+ /* FIXME Not passing a GCancellable here. */
+ em_format_part_as (
+ t->format, t->stream,
+ display_part, "text/html", NULL);
g_string_truncate (t->format->part_id, partidlen);
} else {
- t->item->handler.old->handler (t->format, t->stream, t->part, t->item->handler.old, FALSE);
+ /* FIXME Not passing a GCancellable here. */
+ t->item->handler.old->handler (
+ t->format, t->stream, t->part,
+ t->item->handler.old, NULL, FALSE);
}
return;
} else if (!CAMEL_IS_MULTIPART (mp)) {
@@ -179,7 +192,10 @@ org_gnome_prefer_plain_multipart_alternative (gpointer ep, EMFormatHookTarget *t
/* if we found a text part, show it */
if (display_part) {
g_string_append_printf(t->format->part_id, ".alternative-prefer-plain.%d", displayid);
- em_format_part_as(t->format, t->stream, display_part, "text/plain");
+ /* FIXME Not passing a GCancellable here. */
+ em_format_part_as (
+ t->format, t->stream,
+ display_part, "text/plain", NULL);
g_string_truncate (t->format->part_id, partidlen);
}
diff --git a/plugins/pst-import/pst-importer.c b/plugins/pst-import/pst-importer.c
index 6455ff42f7..7bd0138618 100644
--- a/plugins/pst-import/pst-importer.c
+++ b/plugins/pst-import/pst-importer.c
@@ -251,7 +251,8 @@ get_suggested_foldername (EImportTargetURI *target)
g_string_append (foldername, "outlook_data");
}
- if (mail_tool_uri_to_folder (foldername->str, 0, NULL) != NULL) {
+ /* FIXME Not passing a GCancellable or GError here. */
+ if (mail_tool_uri_to_folder (foldername->str, 0, NULL, NULL) != NULL) {
CamelFolder *folder;
/* Folder exists - add a number */
@@ -261,7 +262,8 @@ get_suggested_foldername (EImportTargetURI *target)
for (i=1; i<10000; i++) {
g_string_truncate (foldername, len);
g_string_append_printf (foldername, "_%d", i);
- if ((folder=mail_tool_uri_to_folder (foldername->str, 0, NULL)) == NULL) {
+ /* FIXME Not passing a GCancellable or GError here. */
+ if ((folder=mail_tool_uri_to_folder (foldername->str, 0, NULL, NULL)) == NULL) {
/* Folder does not exist */
break;
}
@@ -452,7 +454,9 @@ pst_import_file (PstImporter *m)
camel_operation_start (NULL, _("Importing '%s'"), filename);
if (GPOINTER_TO_INT (g_datalist_get_data (&m->target->data, "pst-do-mail"))) {
- mail_tool_uri_to_folder (m->parent_uri, CAMEL_STORE_FOLDER_CREATE, &m->base.error);
+ mail_tool_uri_to_folder (
+ m->parent_uri, CAMEL_STORE_FOLDER_CREATE,
+ m->base.cancellable, &m->base.error);
}
ret = pst_init (&m->pst, filename);
@@ -703,7 +707,9 @@ pst_create_folder (PstImporter *m)
*pos = '\0';
- folder = mail_tool_uri_to_folder (dest, CAMEL_STORE_FOLDER_CREATE, &m->base.error);
+ folder = mail_tool_uri_to_folder (
+ dest, CAMEL_STORE_FOLDER_CREATE,
+ m->base.cancellable, &m->base.error);
g_object_unref (folder);
*pos = '/';
}
@@ -715,8 +721,9 @@ pst_create_folder (PstImporter *m)
g_object_unref (m->folder);
}
- m->folder = mail_tool_uri_to_folder (m->folder_uri, CAMEL_STORE_FOLDER_CREATE, &m->base.error);
-
+ m->folder = mail_tool_uri_to_folder (
+ m->folder_uri, CAMEL_STORE_FOLDER_CREATE,
+ m->base.cancellable, &m->base.error);
}
/**
@@ -916,12 +923,14 @@ pst_process_email (PstImporter *m, pst_item *item)
if (item->flags & 0x08)
camel_message_info_set_flags (info, CAMEL_MESSAGE_DRAFT, ~0);
+ /* FIXME Not passing a GCancellable or GError here. */
success = camel_folder_append_message (
- m->folder, msg, info, NULL, NULL);
+ m->folder, msg, info, NULL, NULL, NULL);
camel_message_info_free (info);
g_object_unref (msg);
- camel_folder_sync (m->folder, FALSE, NULL);
+ /* FIXME Not passing a GCancellable or GError here. */
+ camel_folder_sync (m->folder, FALSE, NULL, NULL);
camel_folder_thaw (m->folder);
if (!success) {
diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c
index 6b0857875e..83dd985402 100644
--- a/plugins/templates/templates.c
+++ b/plugins/templates/templates.c
@@ -565,8 +565,9 @@ build_template_menus_recurse (GtkUIManager *ui_manager,
gchar *path;
guint ii;
+ /* FIXME Not passing a GCancellable or GError here. */
folder = camel_store_get_folder (
- store, folder_info->full_name, 0, NULL);
+ store, folder_info->full_name, 0, NULL, NULL);
folder_name = camel_folder_get_name (folder);
action_name = g_strdup_printf (
@@ -612,7 +613,9 @@ build_template_menus_recurse (GtkUIManager *ui_manager,
if (flags & CAMEL_MESSAGE_DELETED)
continue;
- template = camel_folder_get_message (folder, uid, NULL);
+ /* FIXME Not passing a GCancellable or GError here. */
+ template = camel_folder_get_message (
+ folder, uid, NULL, NULL);
g_object_ref (template);
action_label =
@@ -764,10 +767,11 @@ update_actions_cb (EShellView *shell_view)
templates_folder = e_mail_local_get_folder (E_MAIL_FOLDER_TEMPLATES);
full_name = camel_folder_get_full_name (templates_folder);
+ /* FIXME Not passing a GCancellable or GError here. */
folder_info = camel_store_get_folder_info (
store, full_name,
CAMEL_STORE_FOLDER_INFO_RECURSIVE |
- CAMEL_STORE_FOLDER_INFO_FAST, NULL);
+ CAMEL_STORE_FOLDER_INFO_FAST, NULL, NULL);
build_template_menus_recurse (
ui_manager, action_group,
diff --git a/plugins/tnef-attachments/tnef-plugin.c b/plugins/tnef-attachments/tnef-plugin.c
index 03577a4667..648c48a856 100644
--- a/plugins/tnef-attachments/tnef-plugin.c
+++ b/plugins/tnef-attachments/tnef-plugin.c
@@ -165,9 +165,15 @@ org_gnome_format_tnef (gpointer ep, EMFormatHookTarget *t)
g_string_append_printf(t->format->part_id, ".tnef");
if (camel_multipart_get_number (mp) > 0)
- em_format_part_as(t->format, t->stream, mainpart, "multipart/mixed");
+ /* FIXME Not passing a GCancellable here. */
+ em_format_part_as (
+ t->format, t->stream, mainpart,
+ "multipart/mixed", NULL);
else if (t->item->handler.old)
- t->item->handler.old->handler (t->format, t->stream, t->part, t->item->handler.old, FALSE);
+ /* FIXME Not passing a GCancellable here. */
+ t->item->handler.old->handler (
+ t->format, t->stream, t->part,
+ t->item->handler.old, NULL, FALSE);
g_string_truncate (t->format->part_id, len);
@@ -177,7 +183,10 @@ org_gnome_format_tnef (gpointer ep, EMFormatHookTarget *t)
goto ok;
fail:
if (t->item->handler.old)
- t->item->handler.old->handler (t->format, t->stream, t->part, t->item->handler.old, FALSE);
+ /* FIXME Not passing a GCancellable here. */
+ t->item->handler.old->handler (
+ t->format, t->stream, t->part,
+ t->item->handler.old, NULL, FALSE);
ok:
g_free (name);
g_free (tmpdir);