diff options
author | Milan Crha <mcrha@redhat.com> | 2007-11-05 19:49:53 +0800 |
---|---|---|
committer | Milan Crha <mcrha@src.gnome.org> | 2007-11-05 19:49:53 +0800 |
commit | e335802981396bacf6d20a2168853d94ba15df9c (patch) | |
tree | 84ea3d22c04f7ef58edfbb802f75ee15d3cdd25b /mail/em-folder-tree.c | |
parent | af8315fae1717faa91c26a3051b8b6f07f95062c (diff) | |
download | gsoc2013-evolution-e335802981396bacf6d20a2168853d94ba15df9c.tar.gz gsoc2013-evolution-e335802981396bacf6d20a2168853d94ba15df9c.tar.zst gsoc2013-evolution-e335802981396bacf6d20a2168853d94ba15df9c.zip |
** Fix for bug #343011 (restore collapse state of selected folder after
2007-11-05 Milan Crha <mcrha@redhat.com>
** Fix for bug #343011
(restore collapse state of selected folder after start)
* em-folder-tree.c: (emft_maybe_expand_row): Do not expand subtree of
a node, only make it visible.
* em-folder-tree-model.h: (em_folder_tree_model_get_expanded_uri),
(em_folder_tree_model_set_expanded_uri):
* em-folder-tree-model.c: (em_folder_tree_model_get_expanded_uri),
(em_folder_tree_model_set_expanded_uri):
Same as ..._get/_set_expanded, but using 'uri', instead of 'key'.
* em-folder-tree-model.c: (emftm_uri_to_key): New helper function.
* mail-component.c: (impl_createView): Restore collapsed state after
selecting last selected folder, if necessary.
svn path=/trunk/; revision=34503
Diffstat (limited to 'mail/em-folder-tree.c')
-rw-r--r-- | mail/em-folder-tree.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index be97353e42..acf317a15c 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -675,6 +675,7 @@ emft_maybe_expand_row (EMFolderTreeModel *model, GtkTreePath *tree_path, GtkTree char *full_name; char *key; struct _selected_uri *u; + gboolean is_expanded; gtk_tree_model_get ((GtkTreeModel *) model, iter, COL_STRING_FULL_NAME, &full_name, @@ -693,10 +694,18 @@ emft_maybe_expand_row (EMFolderTreeModel *model, GtkTreePath *tree_path, GtkTree key = g_strdup_printf ("local/%s", full_name ? full_name : ""); } + is_expanded = em_folder_tree_model_get_expanded (model, key); u = g_hash_table_lookup(priv->select_uris_table, key); - if (em_folder_tree_model_get_expanded (model, key) || u) { - gtk_tree_view_expand_to_path (priv->treeview, tree_path); - gtk_tree_view_expand_row (priv->treeview, tree_path, FALSE); + if (is_expanded || u) { + if (is_expanded) { + gtk_tree_view_expand_to_path (priv->treeview, tree_path); + gtk_tree_view_expand_row (priv->treeview, tree_path, FALSE); + } else { + char *c = strrchr (key, '/'); + + *c = '\0'; + emft_expand_node (model, key, emft); + } if (u) emft_select_uri(emft, tree_path, u); |