Re: [evolution-patches] patch for bug 48466



Thank you, Not

It doesn't matter at all. The mistakes I made is serveral times of your.
I think we can get agree with each other this time.
Please see it.

Best Regards
Charles Zhang


Not Zed wrote:
On Fri, 2003-09-19 at 20:11 +0800, Charles Zhang wrote:

  
Hi, Not Zed

I am very sorry I have to ask you for more details.
I wonder if you can spare some to explain your meaning to me.
    


Ok, sorry - my mistake.

I thought gtk2 fixed the destroy thing, but i was sadly mistaken, as i
discovered with a closer look.

Anyway ... uh, i guess forcing a close response is the appropriate
action here.  I'm sorry for all the confusion.

 Michael


  

Index: composer/e-msg-composer-attachment-bar.c
===================================================================
RCS file: /cvs/gnome/evolution/composer/e-msg-composer-attachment-bar.c,v
retrieving revision 1.67.4.4
diff -u -p -r1.67.4.4 e-msg-composer-attachment-bar.c
--- composer/e-msg-composer-attachment-bar.c	30 Jul 2003 12:59:06 -0000	1.67.4.4
+++ composer/e-msg-composer-attachment-bar.c	22 Sep 2003 11:22:44 -0000
@@ -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);
 	
@@ -356,8 +363,15 @@ remove_selected (EMsgComposerAttachmentB
 	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)
Index: composer/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/composer/ChangeLog,v
retrieving revision 1.544.2.13
diff -u -p -r1.544.2.13 ChangeLog
--- composer/ChangeLog	29 Aug 2003 05:57:25 -0000	1.544.2.13
+++ composer/ChangeLog	22 Sep 2003 11:22:48 -0000
@@ -10,6 +10,14 @@
 	and composer icon name to get the path of composer icon.
 	[#47781]
 
+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-08-19  Jeffrey Stedfast  <fejj ximian com>
 
 	* Original patch from David Woodhouse, but modified a bit by me.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]