diff options
-rw-r--r-- | widgets/misc/ChangeLog | 7 | ||||
-rw-r--r-- | widgets/misc/e-attachment-bar.c | 26 |
2 files changed, 33 insertions, 0 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog index 38965e6d96..f061e9ef28 100644 --- a/widgets/misc/ChangeLog +++ b/widgets/misc/ChangeLog @@ -1,3 +1,10 @@ +2005-07-25 Srinivasa Ragavan <sragavan@novell.com> + + * e-attachment-bar,c: (e_attachment_bar_remove_selected) (e_attachment_bar_edit_selected) + (e_attachment_bar_get_attachment) (e_attachment_bar_get_parts) + (e_attachment_bar_get_download_count) (e_attachment_bar_attach_remote_file): Added + checks for the parameters. + 2005-07-20 Vivek Jain <jvivek@novell.com> * e-send-options.h : ESendOptionsDialogClass: has a member new virtual diff --git a/widgets/misc/e-attachment-bar.c b/widgets/misc/e-attachment-bar.c index 202702016a..024d5bd8c7 100644 --- a/widgets/misc/e-attachment-bar.c +++ b/widgets/misc/e-attachment-bar.c @@ -446,6 +446,9 @@ e_attachment_bar_remove_selected (EAttachmentBar *bar) EAttachment *attachment; GList *attachment_list, *p; int num = 0, left, dlen; + + g_return_if_fail (bar != NULL); + g_return_if_fail (E_IS_ATTACHMENT_BAR (bar)); icon_list = GNOME_ICON_LIST (bar); @@ -488,6 +491,9 @@ e_attachment_bar_edit_selected (EAttachmentBar *bar) GnomeIconList *icon_list; GList *selection, *attach; int num; + + g_return_if_fail (bar != NULL); + g_return_if_fail (E_IS_ATTACHMENT_BAR (bar)); icon_list = GNOME_ICON_LIST (bar); @@ -503,6 +509,9 @@ e_attachment_bar_edit_selected (EAttachmentBar *bar) GtkWidget ** e_attachment_bar_get_selector(EAttachmentBar *bar) { + g_return_val_if_fail (bar != NULL, 0); + g_return_val_if_fail (E_IS_ATTACHMENT_BAR (bar), 0); + return &bar->priv->attach; } @@ -512,6 +521,9 @@ e_attachment_bar_get_selected (EAttachmentBar *bar) GSList *attachments = NULL; GList *p; + g_return_val_if_fail (bar != NULL, 0); + g_return_val_if_fail (E_IS_ATTACHMENT_BAR (bar), 0); + p = gnome_icon_list_get_selection((GnomeIconList *)bar); for ( ; p != NULL; p = p->next) { int num = GPOINTER_TO_INT(p->data); @@ -536,6 +548,9 @@ e_attachment_bar_get_attachment (EAttachmentBar *bar, int id) GList *p; EAttachment *attachment; + g_return_val_if_fail (bar != NULL, 0); + g_return_val_if_fail (E_IS_ATTACHMENT_BAR (bar), 0); + /* We need to check if there are duplicated index in the return list of gnome_icon_list_get_selection() because of gnome bugzilla bug #122356. FIXME in the future. */ @@ -569,6 +584,9 @@ e_attachment_bar_get_parts (EAttachmentBar *bar) GList *p = NULL; GSList *part_list = NULL; + 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) @@ -1025,6 +1043,9 @@ void e_attachment_bar_add_attachment (EAttachmentBar *bar, EAttachment *attachment) { + g_return_if_fail (bar != NULL); + g_return_if_fail (E_IS_ATTACHMENT_BAR (bar)); + add_common (bar, attachment); } @@ -1035,6 +1056,9 @@ e_attachment_bar_get_download_count (EAttachmentBar *bar) GList *p; int count=0; + g_return_val_if_fail (bar != NULL, 0); + g_return_val_if_fail (E_IS_ATTACHMENT_BAR (bar), 0); + priv = bar->priv; for (p = priv->attachments; p != NULL; p = p->next) { @@ -1055,6 +1079,7 @@ e_attachment_bar_attach_remote_file (EAttachmentBar *bar, EAttachment *attachment; CamelException ex; + g_return_if_fail ( bar!=NULL ); g_return_if_fail (E_IS_ATTACHMENT_BAR (bar)); if (!bar->priv->path) @@ -1076,6 +1101,7 @@ void e_attachment_bar_attach_mime_part (EAttachmentBar *bar, CamelMimePart *part) { + g_return_if_fail ( bar!=NULL ); g_return_if_fail (E_IS_ATTACHMENT_BAR (bar)); add_from_mime_part (bar, part); |