diff options
author | NotZed <NotZed@HelixCode.com> | 2000-05-20 03:59:06 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2000-05-20 03:59:06 +0800 |
commit | ccd4d84234d933ccf05769e71a3372e149d707d1 (patch) | |
tree | 6d70e18401a55716d5d2f2d31383ce671f933ea0 /mail/mail-display.c | |
parent | 2ce4eb74b65f3e9d07a921aad3899a7141b0000f (diff) | |
download | gsoc2013-evolution-ccd4d84234d933ccf05769e71a3372e149d707d1.tar.gz gsoc2013-evolution-ccd4d84234d933ccf05769e71a3372e149d707d1.tar.zst gsoc2013-evolution-ccd4d84234d933ccf05769e71a3372e149d707d1.zip |
Fixes for stream stuff.
2000-05-19 NotZed <NotZed@HelixCode.com>
* mail-format.c: Fixes for stream stuff.
* mail-display.c (save_data_cb): Remove exception stuff on streams.
svn path=/trunk/; revision=3143
Diffstat (limited to 'mail/mail-display.c')
-rw-r--r-- | mail/mail-display.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/mail/mail-display.c b/mail/mail-display.c index 5b455c0c5f..d569ba1f7c 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -45,7 +45,6 @@ save_data_cb (GtkWidget *widget, gpointer user_data) gtk_widget_get_ancestor (widget, GTK_TYPE_FILE_SELECTION); char *name; int fd; - CamelException *ex; name = gtk_file_selection_get_filename (file_select); @@ -72,20 +71,14 @@ save_data_cb (GtkWidget *widget, gpointer user_data) } stream_fs = camel_stream_fs_new_with_fd (fd); - ex = camel_exception_new (); - camel_data_wrapper_write_to_stream (data, stream_fs, ex); - if (!camel_exception_is_set (ex)) - camel_stream_flush (stream_fs, ex); - gtk_object_unref (GTK_OBJECT (stream_fs)); - - if (camel_exception_is_set (ex)) { + if (camel_data_wrapper_write_to_stream (data, stream_fs) == -1 + || camel_stream_flush (stream_fs) == -1) { char *msg; - msg = g_strdup_printf ("Could not write data: %s", - camel_exception_get_description (ex)); + msg = g_strdup_printf ("Could not write data: %s", strerror(errno)); gnome_error_dialog_parented (msg, GTK_WINDOW (file_select)); } - camel_exception_free (ex); + gtk_object_unref (GTK_OBJECT (stream_fs)); gtk_widget_destroy (GTK_WIDGET (file_select)); } @@ -173,7 +166,7 @@ on_url_requested (GtkHTML *html, const char *url, GtkHTMLStreamHandle handle, ba = g_byte_array_new (); stream_mem = camel_stream_mem_new_with_byte_array (ba); - camel_data_wrapper_write_to_stream (data, stream_mem, NULL); + camel_data_wrapper_write_to_stream (data, stream_mem); gtk_html_write (html, handle, ba->data, ba->len); gtk_object_unref (GTK_OBJECT (stream_mem)); } else |