aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-format-html.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-10-22 04:21:19 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-10-23 02:21:22 +0800
commitc881b5bc5e61d04b18d4ab46ad70533e7340d15b (patch)
treee70a3ed0d2f93dacfe20d856de4d29578beb2e50 /mail/em-format-html.c
parentf0714755e2fa8b06425907c2cf189abd3a1b7119 (diff)
downloadgsoc2013-evolution-c881b5bc5e61d04b18d4ab46ad70533e7340d15b.tar
gsoc2013-evolution-c881b5bc5e61d04b18d4ab46ad70533e7340d15b.tar.gz
gsoc2013-evolution-c881b5bc5e61d04b18d4ab46ad70533e7340d15b.tar.bz2
gsoc2013-evolution-c881b5bc5e61d04b18d4ab46ad70533e7340d15b.tar.lz
gsoc2013-evolution-c881b5bc5e61d04b18d4ab46ad70533e7340d15b.tar.xz
gsoc2013-evolution-c881b5bc5e61d04b18d4ab46ad70533e7340d15b.tar.zst
gsoc2013-evolution-c881b5bc5e61d04b18d4ab46ad70533e7340d15b.zip
Simplify EActivity.
With unintrusive error dialogs gone, we can cut some unnecessary bits out of EActivity. I'm also adding a new enum property called "state", which is one of: E_ACTIVITY_RUNNING E_ACTIVITY_WAITING E_ACTIVITY_CANCELLED E_ACTIVITY_COMPLETED The state of an activity must be explicitly changed. In particular, when the user cancels an activity the state should be set only after confirming the operation has been cancelled and not when cancellation is requested (e.g. after receiving a G_IO_ERROR_CANCELLED, not when the GCancellable emits "cancelled"). EActivityBar and EActivityProxy widgets have been updated to make this distinction clearer in the UI. E_ACTIVITY_WAITING will be used when activities have to be queued and dispatched in sequence, which I haven't written yet.
Diffstat (limited to 'mail/em-format-html.c')
-rw-r--r--mail/em-format-html.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index 1e3c6b9abd..de8c0b5961 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -166,7 +166,9 @@ efh_format_desc (struct _format_msg *m)
}
static void
-efh_format_exec (struct _format_msg *m)
+efh_format_exec (struct _format_msg *m,
+ GCancellable *cancellable,
+ GError **error)
{
EMFormat *format;
struct _EMFormatHTMLJob *job;
@@ -195,7 +197,7 @@ efh_format_exec (struct _format_msg *m)
if (format->mode == EM_FORMAT_MODE_SOURCE) {
em_format_format_source (
format, (CamelStream *) m->estream,
- (CamelMimePart *) m->message, m->base.cancellable);
+ (CamelMimePart *) m->message, cancellable);
} else {
const EMFormatHandler *handle;
const gchar *mime_type;
@@ -207,7 +209,7 @@ efh_format_exec (struct _format_msg *m)
handle->handler (
format, CAMEL_STREAM (m->estream),
CAMEL_MIME_PART (m->message), handle,
- m->base.cancellable, FALSE);
+ cancellable, FALSE);
mime_type = "x-evolution/message/rfc822";
handle = em_format_find_handler (format, mime_type);
@@ -216,10 +218,10 @@ efh_format_exec (struct _format_msg *m)
handle->handler (
format, CAMEL_STREAM (m->estream),
CAMEL_MIME_PART (m->message), handle,
- m->base.cancellable, FALSE);
+ cancellable, FALSE);
}
- camel_stream_flush ((CamelStream *)m->estream, m->base.cancellable, NULL);
+ camel_stream_flush ((CamelStream *)m->estream, cancellable, NULL);
puri_level = format->pending_uri_level;
base = format->base;
@@ -232,13 +234,13 @@ efh_format_exec (struct _format_msg *m)
/* This is an implicit check to see if the gtkhtml has been destroyed */
if (m->format->priv->web_view == NULL)
- g_cancellable_cancel (m->base.cancellable);
+ g_cancellable_cancel (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, m->base.cancellable);
+ job->callback (job, cancellable);
format->base = base;
/* clean up the job */
@@ -257,8 +259,8 @@ efh_format_exec (struct _format_msg *m)
d(printf("out of jobs, closing root stream\n"));
camel_stream_write_string (
(CamelStream *) m->estream,
- "</body>\n</html>\n", m->base.cancellable, NULL);
- camel_stream_close ((CamelStream *)m->estream, m->base.cancellable, NULL);
+ "</body>\n</html>\n", cancellable, NULL);
+ camel_stream_close ((CamelStream *)m->estream, cancellable, NULL);
g_object_unref (m->estream);
m->estream = NULL;
}
@@ -287,7 +289,7 @@ efh_format_free (struct _format_msg *m)
d(printf("formatter freed\n"));
g_object_unref (m->format);
if (m->estream) {
- camel_stream_close ((CamelStream *)m->estream, m->base.cancellable, NULL);
+ camel_stream_close ((CamelStream *)m->estream, NULL, NULL);
g_object_unref (m->estream);
}
if (m->folder)