aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-09-06 01:06:47 +0800
committerMilan Crha <mcrha@redhat.com>2011-09-06 01:06:47 +0800
commit4035b6fe61fcc5e4e2f1949f658e9cf7f148d6d9 (patch)
treed8768fcc4d05d65b3311ef64e2511e8314ddff05
parent07b58617f36d0061adf14046b4baf5299038d61c (diff)
downloadgsoc2013-evolution-4035b6fe61fcc5e4e2f1949f658e9cf7f148d6d9.tar.gz
gsoc2013-evolution-4035b6fe61fcc5e4e2f1949f658e9cf7f148d6d9.tar.zst
gsoc2013-evolution-4035b6fe61fcc5e4e2f1949f658e9cf7f148d6d9.zip
Bug #655568 - Cursor lost after Collapse all threads called
-rw-r--r--mail/message-list.c17
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);