[evolution-patches] [addressbook] Fix for Bug #332498



Hi, 

The attached patch fixes the bug #332498 – orphaned Category editor
crashes Evo.

Thanks
Devashish Sharma
Index: addressbook/gui/contact-editor/e-contact-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/contact-editor/e-contact-editor.c,v
retrieving revision 1.252
diff -u -p -r1.252 e-contact-editor.c
--- addressbook/gui/contact-editor/e-contact-editor.c	23 Feb 2006 10:56:06 -0000	1.252
+++ addressbook/gui/contact-editor/e-contact-editor.c	27 Feb 2006 06:39:01 -0000
@@ -2635,6 +2635,13 @@ categories_key_press_event( GtkWidget *w
 	return FALSE;
 }
 
+static gint
+editor_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data)
+{
+	gtk_widget_destroy(widget);
+	return TRUE;
+}
+
 static void
 categories_clicked (GtkWidget *button, EContactEditor *editor)
 {
@@ -2656,7 +2663,11 @@ categories_clicked (GtkWidget *button, E
 	g_signal_connect (GTK_WIDGET (dialog), "key-press-event", G_CALLBACK (categories_key_press_event), editor);
 
 	g_signal_connect(dialog, "response",
-			G_CALLBACK (response), editor);	
+			G_CALLBACK (response), editor);
+	
+	/* Close the category dialog if the editor is closed*/
+	g_signal_connect_swapped (EAB_EDITOR (editor), "editor_closed",
+			    G_CALLBACK (editor_delete_event_cb), GTK_WIDGET (dialog));
 	
 	gtk_widget_show(GTK_WIDGET(dialog));
 	g_free (categories);
@@ -3137,7 +3148,7 @@ static gint
 app_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data)
 {
 	EContactEditor *ce;
-
+	
 	ce = E_CONTACT_EDITOR (data);
 
 	/* if we're saving, don't allow the dialog to close */


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