aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-09-19 23:35:40 +0800
committerDan Winship <danw@src.gnome.org>2000-09-19 23:35:40 +0800
commit053af645da6e5f74474d13c19ce73d236d9b76a9 (patch)
tree1ebbe95f9fcefc904dddde9faa0aea3a03391a82
parentc09bcfdc4332454675f3ee5bb070f5cd702a065e (diff)
downloadgsoc2013-evolution-053af645da6e5f74474d13c19ce73d236d9b76a9.tar
gsoc2013-evolution-053af645da6e5f74474d13c19ce73d236d9b76a9.tar.gz
gsoc2013-evolution-053af645da6e5f74474d13c19ce73d236d9b76a9.tar.bz2
gsoc2013-evolution-053af645da6e5f74474d13c19ce73d236d9b76a9.tar.lz
gsoc2013-evolution-053af645da6e5f74474d13c19ce73d236d9b76a9.tar.xz
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
-rw-r--r--mail/ChangeLog8
-rw-r--r--mail/mail-callbacks.c23
-rw-r--r--mail/mail-format.c7
-rw-r--r--mail/mail-ops.c9
-rw-r--r--mail/mail-view.c5
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);