aboutsummaryrefslogtreecommitdiffstats
path: root/composer/e-msg-composer.c
diff options
context:
space:
mode:
authorLarry Ewing <lewing@ximian.com>2001-10-06 00:57:01 +0800
committerLarry Ewing <lewing@src.gnome.org>2001-10-06 00:57:01 +0800
commita1750a292eb31a113a22c0278fb6517d56f78f75 (patch)
treef57113886943ed069664c79914e8ae1533cc1788 /composer/e-msg-composer.c
parent301815b5e307a83e49218e2e2aa5ce9971717bc0 (diff)
downloadgsoc2013-evolution-a1750a292eb31a113a22c0278fb6517d56f78f75.tar
gsoc2013-evolution-a1750a292eb31a113a22c0278fb6517d56f78f75.tar.gz
gsoc2013-evolution-a1750a292eb31a113a22c0278fb6517d56f78f75.tar.bz2
gsoc2013-evolution-a1750a292eb31a113a22c0278fb6517d56f78f75.tar.lz
gsoc2013-evolution-a1750a292eb31a113a22c0278fb6517d56f78f75.tar.xz
gsoc2013-evolution-a1750a292eb31a113a22c0278fb6517d56f78f75.tar.zst
gsoc2013-evolution-a1750a292eb31a113a22c0278fb6517d56f78f75.zip
remove unused variable.
2001-10-05 Larry Ewing <lewing@ximian.com> * e-msg-composer-attachment.c (e_msg_composer_attachment_new): remove unused variable. * e-msg-composer-attachment-bar.c (e_msg_composer_attachment_bar_find_message): generalize this to lookup content locations as well. * e-msg-composer-attachment-bar.h: change prototype to match the new function. * listener.c (impl_event): handle the url_requested event, look up parts in the attachment part and feed them down the stream if it is found. * e-msg-composer.c (handle_multipart_alternative): delay setting the body text. (handle_multipart): delay setting body text (e_msg_composer_new_with_message): set the body text from the object data. Doing this ensures that we will have the attachments processed before we try to look them up. svn path=/trunk/; revision=13445
Diffstat (limited to 'composer/e-msg-composer.c')
-rw-r--r--composer/e-msg-composer.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index fda86508ed..f06fe695d5 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -2453,10 +2453,9 @@ handle_multipart_alternative (EMsgComposer *composer, CamelMultipart *multipart)
contents = camel_medium_get_content_object (CAMEL_MEDIUM (mime_part));
text = mail_get_message_body (contents, FALSE, FALSE);
- if (text) {
- e_msg_composer_set_body_text (composer, text);
- g_free (text);
- }
+
+ if (text)
+ gtk_object_set_data (GTK_OBJECT (composer), "body:text", text);
return;
}
@@ -2502,10 +2501,9 @@ handle_multipart (EMsgComposer *composer, CamelMultipart *multipart, int depth)
contents = camel_medium_get_content_object (CAMEL_MEDIUM (mime_part));
text = mail_get_message_body (contents, FALSE, FALSE);
- if (text) {
- e_msg_composer_set_body_text (composer, text);
- g_free (text);
- }
+
+ if (text)
+ gtk_object_set_data (GTK_OBJECT (composer), "body:text", text);
} else {
/* this is a leaf of the tree, so attach it */
e_msg_composer_attach (composer, mime_part);
@@ -2559,7 +2557,8 @@ is_special_header (const char *hdr_name)
/**
* e_msg_composer_new_with_message:
- *
+ * @msg: The message to use as the source
+ *
* Create a new message composer widget.
*
* Return value: A pointer to the newly created widget
@@ -2571,6 +2570,7 @@ e_msg_composer_new_with_message (CamelMimeMessage *msg)
GList *To = NULL, *Cc = NULL, *Bcc = NULL;
EDestination **Tov, **Ccv, **Bccv;
const char *format, *subject, *account_name;
+ char *body;
CamelContentType *content_type;
struct _header_raw *headers;
EMsgComposer *new;
@@ -2698,12 +2698,20 @@ e_msg_composer_new_with_message (CamelMimeMessage *msg)
contents = camel_medium_get_content_object (CAMEL_MEDIUM (msg));
text = mail_get_message_body (contents, FALSE, FALSE);
- if (text) {
- e_msg_composer_set_body_text (new, text);
- g_free (text);
- }
+
+ if (text)
+ gtk_object_set_data (GTK_OBJECT (new), "body:text", text);
}
+ /* We wait until now to set the body text because we need to ensure that
+ * the attachment bar has all the attachments, before we request them.
+ */
+ body = gtk_object_get_data (GTK_OBJECT (new), "body:text");
+ if (body) {
+ e_msg_composer_set_body_text (new, body);
+ gtk_object_set_data (GTK_OBJECT (new), "body:text", NULL);
+ g_free (body);
+ }
return new;
}
@@ -2967,7 +2975,7 @@ void
e_msg_composer_attach (EMsgComposer *composer, CamelMimePart *attachment)
{
EMsgComposerAttachmentBar *bar;
-
+
g_return_if_fail (E_IS_MSG_COMPOSER (composer));
g_return_if_fail (CAMEL_IS_MIME_PART (attachment));