diff options
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 8 | ||||
-rw-r--r-- | mail/mail-callbacks.c | 23 | ||||
-rw-r--r-- | mail/mail-format.c | 7 | ||||
-rw-r--r-- | mail/mail-ops.c | 9 | ||||
-rw-r--r-- | mail/mail-view.c | 5 |
5 files changed, 36 insertions, 16 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index ce5f143a37..bfb27689f2 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,11 @@ +2000-09-19 Dan Winship <danw@helixcode.com> + + * mail-callbacks.c (create_msg_composer, compose_msg, send_to_url, + mail_reply, forward_msg): + * mail-format.c (mail_generate_reply): + * mail-ops.c (cleanup_edit_messages): + * mail-view.c (view_forward_msg): Deal with NULL composer. + 2000-09-18 Dan Winship <danw@helixcode.com> * main.c (main): Call gnome_vfs_init() since the composer now does diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index 59cf1b3f0b..c0aca477ec 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -325,7 +325,7 @@ create_msg_composer (const char *url) MailConfigIdentity *id; gboolean send_html; gchar *sig_file = NULL; - GtkWidget *composer_widget; + EMsgComposer *composer; id = mail_config_get_default_identity (); send_html = mail_config_send_html (); @@ -334,14 +334,13 @@ create_msg_composer (const char *url) sig_file = id->sig; if (url != NULL) - composer_widget = e_msg_composer_new_from_url (url); + composer = e_msg_composer_new_from_url (url); else - composer_widget = e_msg_composer_new_with_sig_file (sig_file); + composer = e_msg_composer_new_with_sig_file (sig_file); + if (composer) + e_msg_composer_set_send_html (composer, send_html); - e_msg_composer_set_send_html (E_MSG_COMPOSER (composer_widget), - send_html); - - return composer_widget; + return (GtkWidget *)composer; } void @@ -353,6 +352,8 @@ compose_msg (GtkWidget *widget, gpointer user_data) return; composer = create_msg_composer (NULL); + if (!composer) + return; gtk_signal_connect (GTK_OBJECT (composer), "send", GTK_SIGNAL_FUNC (composer_send_cb), NULL); @@ -374,6 +375,8 @@ send_to_url (const char *url) return; composer = create_msg_composer (url); + if (!composer) + return; gtk_signal_connect (GTK_OBJECT (composer), "send", GTK_SIGNAL_FUNC (composer_send_cb), NULL); @@ -402,6 +405,8 @@ mail_reply (CamelFolder *folder, CamelMimeMessage *msg, const char *uid, gboolea psd->flags = CAMEL_MESSAGE_ANSWERED; composer = mail_generate_reply (msg, to_all); + if (!composer) + return; gtk_signal_connect (GTK_OBJECT (composer), "send", GTK_SIGNAL_FUNC (composer_send_cb), psd); @@ -450,7 +455,9 @@ forward_msg (GtkWidget *widget, gpointer user_data) if (!check_send_configuration (fb) || !cursor_msg) return; - composer = E_MSG_COMPOSER (e_msg_composer_new ()); + composer = e_msg_composer_new (); + if (!composer) + return; uids = g_ptr_array_new(); message_list_foreach (fb->message_list, enumerate_msg, uids); diff --git a/mail/mail-format.c b/mail/mail-format.c index 21e9773353..93ad41fbcb 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -1616,8 +1616,11 @@ mail_generate_reply (CamelMimeMessage *message, gboolean to_all) MailConfigIdentity *id; gchar *sig_file = NULL; - want_plain = !mail_config_send_html (); + composer = e_msg_composer_new_with_sig_file (sig_file); + if (!composer) + return NULL; + want_plain = !mail_config_send_html (); contents = camel_medium_get_content_object (CAMEL_MEDIUM (message)); text = mail_get_message_body (contents, want_plain, &is_html); @@ -1625,8 +1628,6 @@ mail_generate_reply (CamelMimeMessage *message, gboolean to_all) if (id) sig_file = id->sig; - composer = E_MSG_COMPOSER (e_msg_composer_new_with_sig_file (sig_file)); - /* Set the quoted reply text. */ if (text) { char *repl_text; diff --git a/mail/mail-ops.c b/mail/mail-ops.c index e147709219..0109859349 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -2333,17 +2333,18 @@ cleanup_edit_messages (gpointer in_data, gpointer op_data, int i; for (i = 0; i < data->messages->len; i++) { - GtkWidget *composer; + EMsgComposer *composer; composer = e_msg_composer_new_with_message (data->messages->pdata[i]); + camel_object_unref (CAMEL_OBJECT (data->messages->pdata[i])); + if (!composer) + continue; if (input->signal) gtk_signal_connect (GTK_OBJECT (composer), "send", input->signal, NULL); - gtk_widget_show (composer); - - camel_object_unref (CAMEL_OBJECT (data->messages->pdata[i])); + gtk_widget_show (GTK_WIDGET (composer)); } g_ptr_array_free (input->uids, TRUE); diff --git a/mail/mail-view.c b/mail/mail-view.c index bbdfa87545..45cd4090fa 100644 --- a/mail/mail-view.c +++ b/mail/mail-view.c @@ -102,10 +102,13 @@ view_forward_msg (GtkWidget *widget, gpointer user_data) GPtrArray *uids; EMsgComposer *composer; + composer = e_msg_composer_new (); + if (!composer) + return; + uids = g_ptr_array_new(); g_ptr_array_add (uids, g_strdup (data->uid)); - composer = E_MSG_COMPOSER (e_msg_composer_new ()); gtk_signal_connect (GTK_OBJECT (composer), "send", GTK_SIGNAL_FUNC (composer_send_cb), NULL); |