aboutsummaryrefslogtreecommitdiffstats
path: root/em-format/em-format-quote.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-07-05 20:16:13 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-09-14 20:08:34 +0800
commitc72aba8f7c13cdc68b1f3dbc1d381be45e0c4cb8 (patch)
treebba5b7220bac55c1f49f23f1deb769ce51b767eb /em-format/em-format-quote.c
parentd9ee2fc9c62739ea7dca2fbe9159e1cec9d2784d (diff)
downloadgsoc2013-evolution-c72aba8f7c13cdc68b1f3dbc1d381be45e0c4cb8.tar
gsoc2013-evolution-c72aba8f7c13cdc68b1f3dbc1d381be45e0c4cb8.tar.gz
gsoc2013-evolution-c72aba8f7c13cdc68b1f3dbc1d381be45e0c4cb8.tar.bz2
gsoc2013-evolution-c72aba8f7c13cdc68b1f3dbc1d381be45e0c4cb8.tar.lz
gsoc2013-evolution-c72aba8f7c13cdc68b1f3dbc1d381be45e0c4cb8.tar.xz
gsoc2013-evolution-c72aba8f7c13cdc68b1f3dbc1d381be45e0c4cb8.tar.zst
gsoc2013-evolution-c72aba8f7c13cdc68b1f3dbc1d381be45e0c4cb8.zip
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.
Diffstat (limited to 'em-format/em-format-quote.c')
-rw-r--r--em-format/em-format-quote.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/em-format/em-format-quote.c b/em-format/em-format-quote.c
index a8f1bf329a..a5a8d0de65 100644
--- a/em-format/em-format-quote.c
+++ b/em-format/em-format-quote.c
@@ -94,8 +94,11 @@ emfq_format_clone (EMFormat *emf,
EM_FORMAT_CLASS (parent_class)->format_clone (
emf, folder, uid, msg, src, cancellable);
+ g_seekable_seek (
+ G_SEEKABLE (emfq->priv->stream),
+ 0, G_SEEK_SET, NULL, NULL);
+
gconf = gconf_client_get_default ();
- camel_stream_reset (emfq->priv->stream, NULL);
if (gconf_client_get_bool (
gconf, "/apps/evolution/mail/composer/top_signature", NULL))
camel_stream_printf (emfq->priv->stream, "<br>\n");
@@ -257,6 +260,9 @@ em_format_quote_new (const gchar *credits,
g_return_val_if_fail (CAMEL_IS_STREAM (stream), NULL);
+ /* Steam must also be seekable so we can reset its position. */
+ g_return_val_if_fail (G_IS_SEEKABLE (stream), NULL);
+
emfq = g_object_new (EM_TYPE_FORMAT_QUOTE, NULL);
emfq->priv->credits = g_strdup (credits);