[evolution-patches] mail #61747, go to next unread, ctrl-k not working




oh this is fun, i have no idea what the old code was trying to do, its origins are clearly lost in the mists of time.

but basically we were getting a message-selected event before the message was selected (or the selection changed) so when we went to update the ui we got the old selection instead.

this fixes it, and also reduces a bunch of redundant events as a sideffect.  i actually have no idea how the old code actually managed to change the selection, since it didn't do it explictly.  bizarre.

--
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.3417
diff -u -3 -r1.3417 ChangeLog
--- mail/ChangeLog	21 Jul 2004 15:54:00 -0000	1.3417
+++ mail/ChangeLog	22 Jul 2004 08:26:23 -0000
@@ -1,3 +1,13 @@
+2004-07-22  Not Zed  <NotZed Ximian com>
+
+	** See bug #61747.
+
+	* message-list.c (search_func): don't emit a message_selected here
+	(god knows why we did?).  Don't update cursor_uid either, just
+	clear it.
+	(message_list_select): select the path if we find it here, causing
+	the cascade of selection action.
+
 2004-07-19  Jeffrey Stedfast  <fejj novell com>
 
 	* em-migrate.c (em_migrate_folder): Free uri and name
Index: mail/em-folder-view.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-view.c,v
retrieving revision 1.81
diff -u -3 -r1.81 em-folder-view.c
--- mail/em-folder-view.c	16 Jul 2004 16:03:44 -0000	1.81
+++ mail/em-folder-view.c	22 Jul 2004 08:26:24 -0000
@@ -1632,7 +1632,6 @@
 		disable_mask = ~0;
 	}
 
-
 	name = g_string_new("");
 	for (l = emfv->enable_map; l; l = l->next) {
 		EMFolderViewEnable *map = l->data;
Index: mail/message-list.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/message-list.c,v
retrieving revision 1.394
diff -u -3 -r1.394 message-list.c
--- mail/message-list.c	22 Jun 2004 19:39:20 -0000	1.394
+++ mail/message-list.c	22 Jul 2004 08:26:28 -0000
@@ -465,6 +465,7 @@
 	MessageList *message_list;
 	guint32 flags;
 	guint32 mask;
+	ETreePath path;
 };
 
 static gboolean
@@ -478,12 +479,9 @@
 	info = get_message_info (data->message_list, path);
 	
 	if (info && (info->flags & data->mask) == data->flags) {
-		if (data->message_list->cursor_uid) {
-			g_free (data->message_list->cursor_uid);
-			data->message_list->cursor_uid = g_strdup (camel_message_info_uid (info));
-		}
-		g_signal_emit (GTK_OBJECT (data->message_list), message_list_signals[MESSAGE_SELECTED], 0,
-			       camel_message_info_uid (info));
+		g_free(data->message_list->cursor_uid);
+		data->message_list->cursor_uid = NULL;
+		data->path = path;
 		return TRUE;
 	}
 	return FALSE;
@@ -538,7 +536,8 @@
 	data.message_list = message_list;
 	data.flags = flags;
 	data.mask = mask;
-	
+	data.path = NULL;
+
 	if (direction == MESSAGE_LIST_SELECT_NEXT)
 		params |= E_TREE_FIND_NEXT_FORWARD;
 	else
@@ -547,7 +546,13 @@
 	if (wraparound)
 		params |= E_TREE_FIND_NEXT_WRAP;
 	
-	return e_tree_find_next (message_list->tree, params, (ETreePathFunc) search_func, &data);
+	if (e_tree_find_next (message_list->tree, params, (ETreePathFunc) search_func, &data)) {
+		ETreeSelectionModel *etsm = (ETreeSelectionModel *)e_tree_get_selection_model (message_list->tree);
+
+		e_tree_selection_model_select_single_path(etsm, data.path);
+		return TRUE;
+	} else
+		return FALSE;
 }
 
 
@@ -2956,7 +2961,7 @@
 
 	if (e_tree_model_node_is_root (data->ml->model, path))
 		return;
-	
+
 	uid = get_message_uid(data->ml, path);
 	g_assert(uid != NULL);
 	g_ptr_array_add(data->uids, g_strdup(uid));


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