diff options
author | Milan Crha <mcrha@redhat.com> | 2011-09-06 01:06:47 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-09-14 20:09:01 +0800 |
commit | 4bb8a86c70feba3036b8eb44c9696f099aa4da53 (patch) | |
tree | a131abfb4d3f41e8961ed71455a6349e096d56f1 | |
parent | ac507b38df11d07fac9641469db16df9c972636e (diff) | |
download | gsoc2013-evolution-4bb8a86c70feba3036b8eb44c9696f099aa4da53.tar.gz gsoc2013-evolution-4bb8a86c70feba3036b8eb44c9696f099aa4da53.tar.zst gsoc2013-evolution-4bb8a86c70feba3036b8eb44c9696f099aa4da53.zip |
Bug #655568 - Cursor lost after Collapse all threads called
-rw-r--r-- | mail/message-list.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/mail/message-list.c b/mail/message-list.c index 1c634b91b8..d98f860f8c 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -3330,13 +3330,28 @@ build_tree (MessageList *ml, tree_equal (ml->model, top, thread->tree); } #endif + if (!saveuid && ml->cursor_uid && g_hash_table_lookup (ml->uid_nodemap, ml->cursor_uid)) { + /* this makes sure a visible node is selected, like when + collapsing all nodes and a children had been selected + */ + saveuid = g_strdup (ml->cursor_uid); + } + if (saveuid) { - ETreePath *node = g_hash_table_lookup (ml->uid_nodemap, saveuid); + ETreePath node = g_hash_table_lookup (ml->uid_nodemap, saveuid); if (node == NULL) { g_free (ml->cursor_uid); ml->cursor_uid = NULL; g_signal_emit (ml, message_list_signals[MESSAGE_SELECTED], 0, NULL); } else { + ETree *tree = E_TREE (ml); + ETreePath parent = node; + + while (parent = e_tree_model_node_get_parent (etm, parent), parent) { + if (!e_tree_node_is_expanded (tree, parent)) + node = parent; + } + e_tree_set_cursor (E_TREE (ml), node); } g_free (saveuid); |