diff options
author | Charles Zhang <charles.zhang@sun.com> | 2003-09-23 16:18:40 +0800 |
---|---|---|
committer | Antonio Xu <anto@src.gnome.org> | 2003-09-23 16:18:40 +0800 |
commit | d652232d8564a74960b212b6a66e97d017592624 (patch) | |
tree | 1e47c01ca9f0665cd80c0c63261581b381f993ff | |
parent | a2d243e391c4e3ecb485bca2238a91812ad8ab07 (diff) | |
download | gsoc2013-evolution-d652232d8564a74960b212b6a66e97d017592624.tar.gz gsoc2013-evolution-d652232d8564a74960b212b6a66e97d017592624.tar.zst gsoc2013-evolution-d652232d8564a74960b212b6a66e97d017592624.zip |
Add some assertion. Send Close response signal to the properties dialog
2003-09-13 Charles Zhang <charles.zhang@sun.com>
* e-msg-composer-attachment-bar.c (remove_attachment): Add some
assertion. Send Close response signal to the properties dialog
while removeing an attachment.
* e-msg-composer-attachment-bar.c (remove_selected): Fix a re-
remove-attachment bug. [#48466]
svn path=/trunk/; revision=22656
-rw-r--r-- | composer/ChangeLog | 8 | ||||
-rw-r--r-- | composer/e-msg-composer-attachment-bar.c | 18 |
2 files changed, 24 insertions, 2 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog index da59d41828..e66876fe19 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,11 @@ +2003-09-13 Charles Zhang <charles.zhang@sun.com> + + * e-msg-composer-attachment-bar.c (remove_attachment): Add some + assertion. Send Close response signal to the properties dialog + while removeing an attachment. + * e-msg-composer-attachment-bar.c (remove_selected): Fix a re- + remove-attachment bug. [#48466] + 2003-09-18 Jeffrey Stedfast <fejj@ximian.com> * e-msg-composer-attachment-bar.c: updated for diff --git a/composer/e-msg-composer-attachment-bar.c b/composer/e-msg-composer-attachment-bar.c index 223c1e5fd9..1d5407bdcd 100644 --- a/composer/e-msg-composer-attachment-bar.c +++ b/composer/e-msg-composer-attachment-bar.c @@ -192,9 +192,16 @@ static void remove_attachment (EMsgComposerAttachmentBar *bar, EMsgComposerAttachment *attachment) { + g_return_if_fail (E_IS_MSG_COMPOSER_ATTACHMENT_BAR (bar)); + g_return_if_fail (g_list_find (bar->priv->attachments, attachment) != NULL); + bar->priv->attachments = g_list_remove (bar->priv->attachments, attachment); bar->priv->num_attachments--; + if (attachment->editor_gui != NULL) { + GtkWidget *dialog = glade_xml_get_widget (attachment->editor_gui, "dialog"); + g_signal_emit_by_name (dialog, "response", GTK_RESPONSE_CLOSE); + } g_object_unref(attachment); @@ -336,8 +343,15 @@ remove_selected (EMsgComposerAttachmentBar *bar) p = gnome_icon_list_get_selection (icon_list); for ( ; p != NULL; p = p->next) { num = GPOINTER_TO_INT (p->data); - attachment = E_MSG_COMPOSER_ATTACHMENT (g_list_nth (bar->priv->attachments, num)->data); - attachment_list = g_list_prepend (attachment_list, attachment); + attachment = E_MSG_COMPOSER_ATTACHMENT (g_list_nth_data (bar->priv->attachments, num)); + + /* 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. */ + + if (g_list_find (attachment_list, attachment) == NULL) { + attachment_list = g_list_prepend (attachment_list, attachment); + } } for (p = attachment_list; p != NULL; p = p->next) |