From 201ef5f000326079a34796af26833b61ebdb97e8 Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Tue, 15 Nov 2005 17:08:51 +0000 Subject: Added a function to get all attachments of the attachment bar for plugin 2005-11-15 Srinivasa Ragavan * e-attachment-bar.[ch] (e_attachment_bar_get_all_attachments): Added a function to get all attachments of the attachment bar for plugin purposes. svn path=/trunk/; revision=30620 --- widgets/misc/e-attachment-bar.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'widgets/misc/e-attachment-bar.c') diff --git a/widgets/misc/e-attachment-bar.c b/widgets/misc/e-attachment-bar.c index 2903ee4c88..5de718f914 100644 --- a/widgets/misc/e-attachment-bar.c +++ b/widgets/misc/e-attachment-bar.c @@ -600,6 +600,29 @@ e_attachment_bar_get_attachment (EAttachmentBar *bar, int id) return attachments; } +GSList * +e_attachment_bar_get_all_attachments (EAttachmentBar *bar) +{ + GSList *attachments = NULL; + GList *p; + EAttachment *attachment; + + g_return_val_if_fail (bar != NULL, 0); + g_return_val_if_fail (E_IS_ATTACHMENT_BAR (bar), 0); + + for ( p = bar->priv->attachments; p!= NULL; p = p->next) { + attachment = p->data; + if (attachment && attachment->is_available_local) { + g_object_ref (attachment); + attachments= g_slist_prepend(attachments, attachment); + } + } + + attachments = g_slist_reverse(attachments); + + return attachments; +} + /* Just the GSList has to be freed by the caller */ GSList * e_attachment_bar_get_parts (EAttachmentBar *bar) -- cgit