From c72aba8f7c13cdc68b1f3dbc1d381be45e0c4cb8 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 5 Jul 2011 08:16:13 -0400 Subject: Prefer g_seekable_seek() over camel_stream_reset(). When a stream is obviously a file or memory stream (both of which implement the GSeekable interface), use g_seekable_seek() instead of camel_stream_reset(). This is helping me discover if it's safe to remove camel_stream_reset(). We want to eventually move to GIO streams, which have no reset method. --- em-format/em-format.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'em-format/em-format.c') diff --git a/em-format/em-format.c b/em-format/em-format.c index 1f9634d29f..1c2624f1f6 100644 --- a/em-format/em-format.c +++ b/em-format/em-format.c @@ -1422,7 +1422,8 @@ em_format_format_text (EMFormat *emf, (CamelStream *) filter_stream, cancellable, NULL); camel_stream_flush ((CamelStream *) filter_stream, cancellable, NULL); g_object_unref (filter_stream); - camel_stream_reset (mem_stream, NULL); + + g_seekable_seek (G_SEEKABLE (mem_stream), 0, G_SEEK_SET, NULL, NULL); if (max == -1 || size == -1 || size < (max * 1024) || emf->composer) { camel_stream_write_to_stream ( -- cgit v1.2.3