diff options
author | Larry Ewing <lewing@ximian.com> | 2001-10-05 13:15:09 +0800 |
---|---|---|
committer | Larry Ewing <lewing@src.gnome.org> | 2001-10-05 13:15:09 +0800 |
commit | 45a6a71ecd4802c52df2207b60c539f36399f214 (patch) | |
tree | 26c274f71a85072a0573c02930e35e51366e7a49 /composer | |
parent | 0f0efa5e7719eeedf3ca62eeddc87348e87747bf (diff) | |
download | gsoc2013-evolution-45a6a71ecd4802c52df2207b60c539f36399f214.tar gsoc2013-evolution-45a6a71ecd4802c52df2207b60c539f36399f214.tar.gz gsoc2013-evolution-45a6a71ecd4802c52df2207b60c539f36399f214.tar.bz2 gsoc2013-evolution-45a6a71ecd4802c52df2207b60c539f36399f214.tar.lz gsoc2013-evolution-45a6a71ecd4802c52df2207b60c539f36399f214.tar.xz gsoc2013-evolution-45a6a71ecd4802c52df2207b60c539f36399f214.tar.zst gsoc2013-evolution-45a6a71ecd4802c52df2207b60c539f36399f214.zip |
change to return a CamelMimePart.
2001-10-04 Larry Ewing <lewing@ximian.com>
* e-msg-composer-attachment-bar.c
(e_msg_composer_attachment_bar_find_content_id): change to return
a CamelMimePart.
* e-msg-composer-attachment-bar.h: update prototype.
svn path=/trunk/; revision=13437
Diffstat (limited to 'composer')
-rw-r--r-- | composer/ChangeLog | 6 | ||||
-rw-r--r-- | composer/e-msg-composer-attachment-bar.c | 33 | ||||
-rw-r--r-- | composer/e-msg-composer-attachment-bar.h | 4 |
3 files changed, 40 insertions, 3 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog index b6d8046620..236068c0da 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,5 +1,11 @@ 2001-10-04 Larry Ewing <lewing@ximian.com> + * e-msg-composer-attachment-bar.c + (e_msg_composer_attachment_bar_find_content_id): change to return + a CamelMimePart. + + * e-msg-composer-attachment-bar.h: update prototype. + * e-msg-composer-attachment-bar.c (e_msg_composer_attachment_bar_find_content_id): look up an attachment by it's content id. diff --git a/composer/e-msg-composer-attachment-bar.c b/composer/e-msg-composer-attachment-bar.c index f5e90bf820..ed79beb77d 100644 --- a/composer/e-msg-composer-attachment-bar.c +++ b/composer/e-msg-composer-attachment-bar.c @@ -819,6 +819,33 @@ e_msg_composer_attachment_bar_attach_mime_part (EMsgComposerAttachmentBar *bar, add_from_mime_part (bar, part); } +CamelMimePart * +e_msg_composer_attachment_bar_find_content_id (EMsgComposerAttachmentBar *bar, char *content_id) +{ + EMsgComposerAttachmentBarPrivate *priv; + GList *p; + + g_return_val_if_fail (E_IS_MSG_COMPOSER_ATTACHMENT_BAR (bar), NULL); + g_return_val_if_fail (content_id != NULL, NULL); + + priv = bar->priv; + + 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); + + g_warning ("content_id: %s, part_id: %s\n", content_id, part_id); + if (part_id && !strcmp (part_id, content_id)) + return attachment->body; + } + + return NULL; +} + +#if 0 EMsgComposerAttachment * e_msg_composer_attachment_bar_find_content_id (EMsgComposerAttachmentBar *bar, char *content_id) { @@ -830,7 +857,7 @@ e_msg_composer_attachment_bar_find_content_id (EMsgComposerAttachmentBar *bar, c priv = bar->priv; - if (priv->attachments == NULL) + if (priv->attachments) g_warning ("NO ATTACHMENTS"); for (p = priv->attachments; p != NULL; p = p->next) { @@ -847,4 +874,8 @@ e_msg_composer_attachment_bar_find_content_id (EMsgComposerAttachmentBar *bar, c return NULL; } +#endif + + + diff --git a/composer/e-msg-composer-attachment-bar.h b/composer/e-msg-composer-attachment-bar.h index c68592e6e3..658e29108d 100644 --- a/composer/e-msg-composer-attachment-bar.h +++ b/composer/e-msg-composer-attachment-bar.h @@ -68,8 +68,8 @@ void e_msg_composer_attachment_bar_to_multipart (EMsgComposerAttachmentBar *bar, guint e_msg_composer_attachment_bar_get_num_attachments (EMsgComposerAttachmentBar *bar); void e_msg_composer_attachment_bar_attach (EMsgComposerAttachmentBar *bar, const gchar *file_name); void e_msg_composer_attachment_bar_attach_mime_part (EMsgComposerAttachmentBar *bar, CamelMimePart *part); -EMsgComposerAttachment *e_msg_composer_attachment_bar_find_content_id (EMsgComposerAttachmentBar *bar, - char *content_id); +CamelMimePart *e_msg_composer_attachment_bar_find_content_id (EMsgComposerAttachmentBar *bar, + char *content_id); #ifdef __cplusplus } |