[evolution-patches] 66991, mail crash creating new folder




Ok, i've wasted most of an afternoon on this, so this'll have to do for now.

It seems we put the gtktreeview in a funny state where "nothing works", mouse clicks get through but you can't select any folders and all sorts of fun and weird stuff.  I presume its something up with our code, but valgrind shows nothing either.

See the bug for some more details.  This patch just fixes the crash and some internal warnings, but can make things a bit weird in the ui since you select a folder and it doesn't get selected.

--
Michael Zucchi <notzed ximian com>
"born to die, live to work, it's all downhill from here"
Novell's Evolution and Free Software Developer
Index: mail/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3444.2.17
diff -u -3 -r1.3444.2.17 ChangeLog
--- mail/ChangeLog	30 Sep 2004 01:46:32 -0000	1.3444.2.17
+++ mail/ChangeLog	5 Oct 2004 09:23:27 -0000
@@ -1,3 +1,15 @@
+2004-10-05  Not Zed  <NotZed Ximian com>
+
+	* em-folder-tree.c (emft_popup_copy_folder_selected): remove old
+	debug which no longer works.
+
+	** See bug #66991 (related to #64377).
+
+	* em-folder-tree.c (em_folder_tree_set_selected): if we get a NULL
+	uri or "", just clear the list.
+	(emft_tree_button_press): select the new path as well as move the
+	cursor there, otherwise emft_tree_user_event clears the selection.
+
 2004-09-30  David Malcolm  <dmalcolm redhat com>
 
 	* em-migrate.c (upgrade_passwords_1_2): fix uninitialised pointer.
Index: mail/em-folder-selector.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-selector.c,v
retrieving revision 1.30.12.1
diff -u -3 -r1.30.12.1 em-folder-selector.c
--- mail/em-folder-selector.c	1 Sep 2004 04:03:35 -0000	1.30.12.1
+++ mail/em-folder-selector.c	5 Oct 2004 09:23:28 -0000
@@ -141,7 +141,7 @@
 	camel_exception_init (&ex);
 	if (!(store = (CamelStore *) camel_session_get_service (session, uri, CAMEL_PROVIDER_STORE, &ex)))
 		return;
-	
+
 	if (camel_store_folder_uri_equal (store, emfs->created_uri, uri)) {
 		em_folder_tree_set_selected (emfs->emft, uri);
 		g_signal_handler_disconnect (model, emfs->created_id);
Index: mail/em-folder-tree.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-tree.c,v
retrieving revision 1.125.4.3
diff -u -3 -r1.125.4.3 em-folder-tree.c
--- mail/em-folder-tree.c	24 Sep 2004 03:06:01 -0000	1.125.4.3
+++ mail/em-folder-tree.c	5 Oct 2004 09:23:28 -0000
@@ -2154,8 +2154,6 @@
 	
 	priv = cfd->emft->priv;
 	
-	d(printf ("%sing folder '%s' to '%s'\n", cfd->delete ? "move" : "copy", priv->selected_path, uri));
-	
 	camel_exception_init (&ex);
 
 	fromuri = em_folder_tree_get_selected_uri(cfd->emft);
@@ -2754,6 +2752,8 @@
 		return FALSE;
 	
 	/* select/focus the row that was right-clicked or double-clicked */
+	selection = gtk_tree_view_get_selection (treeview);
+	gtk_tree_selection_select_path(selection, tree_path);
 	gtk_tree_view_set_cursor (treeview, tree_path, NULL, FALSE);
 	
 	if (event->button == 1 && event->type == GDK_2BUTTON_PRESS) {
@@ -2765,9 +2765,10 @@
 	gtk_tree_path_free (tree_path);
 	
 	/* FIXME: we really need the folderinfo to build a proper menu */
-	selection = gtk_tree_view_get_selection (treeview);
-	if (!emft_selection_get_selected (selection, &model, &iter))
+	if (!emft_selection_get_selected (selection, &model, &iter)) {
+		printf("nothing selected!\n");
 		return FALSE;
+	}
 	
 	gtk_tree_model_get (model, &iter, COL_POINTER_CAMEL_STORE, &store,
 			    COL_STRING_URI, &uri, COL_STRING_FULL_NAME, &full_name,
@@ -2863,9 +2864,10 @@
 void
 em_folder_tree_set_selected (EMFolderTree *emft, const char *uri)
 {
-	GList *l;
+	GList *l = NULL;
 
-	l = g_list_append(NULL, (void *)uri);
+	if (uri && uri[0])
+		l = g_list_append(l, (void *)uri);
 
 	em_folder_tree_set_selected_list(emft, l);
 	g_list_free(l);


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