diff options
author | Dan Winship <danw@src.gnome.org> | 2000-09-19 23:35:40 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2000-09-19 23:35:40 +0800 |
commit | 053af645da6e5f74474d13c19ce73d236d9b76a9 (patch) | |
tree | 1ebbe95f9fcefc904dddde9faa0aea3a03391a82 /mail/mail-callbacks.c | |
parent | c09bcfdc4332454675f3ee5bb070f5cd702a065e (diff) | |
download | gsoc2013-evolution-053af645da6e5f74474d13c19ce73d236d9b76a9.tar.gz gsoc2013-evolution-053af645da6e5f74474d13c19ce73d236d9b76a9.tar.zst gsoc2013-evolution-053af645da6e5f74474d13c19ce73d236d9b76a9.zip |
Deal with NULL composer.
* 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.
svn path=/trunk/; revision=5502
Diffstat (limited to 'mail/mail-callbacks.c')
-rw-r--r-- | mail/mail-callbacks.c | 23 |
1 files changed, 15 insertions, 8 deletions
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); |