aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-ops.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-05-11 03:51:03 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-05-11 03:51:03 +0800
commita45637985e29d9249b4b9e74bacccc7603a1855f (patch)
tree0e289dd8e5145e14d9b19eebf63c4f94c299f5a8 /mail/mail-ops.c
parent6fe392b30131574317e2e9715f2cee3eac94f9e7 (diff)
downloadgsoc2013-evolution-a45637985e29d9249b4b9e74bacccc7603a1855f.tar.gz
gsoc2013-evolution-a45637985e29d9249b4b9e74bacccc7603a1855f.tar.zst
gsoc2013-evolution-a45637985e29d9249b4b9e74bacccc7603a1855f.zip
Don't add any shortcuts here. (mail_config_remove_account): And don't
2002-05-10 Jeffrey Stedfast <fejj@ximian.com> * mail-config.c (mail_config_add_account): Don't add any shortcuts here. (mail_config_remove_account): And don't remove them here. This code has never worked properly. * mail-ops.c (save_part_save): Use the exception enum names rather than '1' since it makes the code clearer. svn path=/trunk/; revision=16756
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r--mail/mail-ops.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index f86a013a7a..a864b87569 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -1994,15 +1994,16 @@ save_part_save (struct _mail_msg *mm)
struct _save_part_msg *m = (struct _save_part_msg *)mm;
CamelMimeFilterCharset *charsetfilter;
CamelContentType *content_type;
- CamelStreamFilter *filtered_stream;
+ CamelStream *filtered_stream;
CamelStream *stream_fs;
CamelDataWrapper *data;
const char *charset;
stream_fs = camel_stream_fs_new_with_name (m->path, O_WRONLY | O_CREAT | O_TRUNC, 0600);
if (stream_fs == NULL) {
- camel_exception_setv (&mm->ex, 1, _("Cannot create output file: %s:\n %s"), m->path,
- g_strerror (errno));
+ camel_exception_setv (&mm->ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Cannot create output file: %s:\n %s"),
+ m->path, g_strerror (errno));
return;
}
@@ -2018,24 +2019,23 @@ save_part_save (struct _mail_msg *mm)
&& (charset = header_content_type_param (content_type, "charset"))
&& g_strcasecmp (charset, "utf-8") != 0) {
charsetfilter = camel_mime_filter_charset_new_convert ("utf-8", charset);
- filtered_stream = camel_stream_filter_new_with_stream (stream_fs);
+ filtered_stream = (CamelStream *) camel_stream_filter_new_with_stream (stream_fs);
+ camel_object_unref (CAMEL_OBJECT (stream_fs));
if (charsetfilter) {
- camel_stream_filter_add (filtered_stream, CAMEL_MIME_FILTER (charsetfilter));
+ camel_stream_filter_add (CAMEL_STREAM_FILTER (filtered_stream), CAMEL_MIME_FILTER (charsetfilter));
camel_object_unref (CAMEL_OBJECT (charsetfilter));
}
} else {
- /* no we can't use a CAMEL_BLAH() cast here, since its not true, HOWEVER
- we only treat it as a normal stream from here on, so it is OK */
- filtered_stream = (CamelStreamFilter *)stream_fs;
- camel_object_ref (CAMEL_OBJECT (stream_fs));
+ filtered_stream = stream_fs;
}
- if (camel_data_wrapper_write_to_stream (data, CAMEL_STREAM (filtered_stream)) == -1
- || camel_stream_flush (CAMEL_STREAM (filtered_stream)) == -1)
- camel_exception_setv (&mm->ex, 1, _("Could not write data: %s"), g_strerror (errno));
+ if (camel_data_wrapper_write_to_stream (data, filtered_stream) == -1
+ || camel_stream_flush (filtered_stream) == -1)
+ camel_exception_setv (&mm->ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not write data: %s"),
+ g_strerror (errno));
camel_object_unref (CAMEL_OBJECT (filtered_stream));
- camel_object_unref (CAMEL_OBJECT (stream_fs));
}
static void