From a1750a292eb31a113a22c0278fb6517d56f78f75 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Fri, 5 Oct 2001 16:57:01 +0000 Subject: remove unused variable. 2001-10-05 Larry Ewing * 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 --- composer/e-msg-composer-attachment-bar.c | 58 ++++++++++---------------------- 1 file changed, 18 insertions(+), 40 deletions(-) (limited to 'composer/e-msg-composer-attachment-bar.c') diff --git a/composer/e-msg-composer-attachment-bar.c b/composer/e-msg-composer-attachment-bar.c index ed79beb77d..5cb8ed0244 100644 --- a/composer/e-msg-composer-attachment-bar.c +++ b/composer/e-msg-composer-attachment-bar.c @@ -820,62 +820,40 @@ e_msg_composer_attachment_bar_attach_mime_part (EMsgComposerAttachmentBar *bar, } CamelMimePart * -e_msg_composer_attachment_bar_find_content_id (EMsgComposerAttachmentBar *bar, char *content_id) +e_msg_composer_attachment_bar_find_message (EMsgComposerAttachmentBar *bar, char *url) { EMsgComposerAttachmentBarPrivate *priv; GList *p; + char *content_id = NULL; g_return_val_if_fail (E_IS_MSG_COMPOSER_ATTACHMENT_BAR (bar), NULL); - g_return_val_if_fail (content_id != NULL, NULL); + g_return_val_if_fail (url != NULL, NULL); + if (!strncmp ("cid:", url, 4)) + content_id = url + 4; + priv = bar->priv; for (p = priv->attachments; p != NULL; p = p->next) { - EMsgComposerAttachment *attachment; + CamelMimePart *part; const char *part_id; - - attachment = p->data; - part_id = camel_mime_part_get_content_id (attachment->body); - - g_warning ("content_id: %s, part_id: %s\n", content_id, part_id); - if (part_id && !strcmp (part_id, content_id)) - return attachment->body; - } + const char *part_location; - return NULL; -} + part = E_MSG_COMPOSER_ATTACHMENT (p->data)->body; -#if 0 -EMsgComposerAttachment * -e_msg_composer_attachment_bar_find_content_id (EMsgComposerAttachmentBar *bar, char *content_id) -{ - EMsgComposerAttachmentBarPrivate *priv; - GList *p; + part_id = camel_mime_part_get_content_id (part); + g_warning ("content_id: %s, part_id: %s\n", content_id, part_id); - g_return_val_if_fail (E_IS_MSG_COMPOSER_ATTACHMENT_BAR (bar), NULL); - g_return_val_if_fail (content_id != NULL, NULL); + if (content_id && part_id && !strcmp (part_id, content_id)) + return part; - priv = bar->priv; - - if (priv->attachments) - g_warning ("NO ATTACHMENTS"); - - for (p = priv->attachments; p != NULL; p = p->next) { - EMsgComposerAttachment *attachment; - const char *part_id; - - attachment = p->data; - part_id = camel_mime_part_get_content_id (attachment->body); + part_location = camel_mime_part_get_content_location (part); + g_warning ("url: %s, part_id: %s\n", url, part_id); - g_warning ("content_id: %s, part_id: %s\n", content_id, part_id); - if (part_id && !strcmp (part_id, content_id)) - return attachment; + if (part_id && !strcmp (part_location, url)) + return part; + } return NULL; } -#endif - - - - -- cgit