From e8f5c62b0233231a3bdc74a42de062b61e0c15f2 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 29 Jul 2010 16:55:01 -0400 Subject: Simplify em_folder_tree_restore_state(). --- mail/em-folder-tree.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'mail') diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index ce674f2309..d7bbcb7061 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -2888,6 +2888,7 @@ em_folder_tree_restore_state (EMFolderTree *folder_tree, while (valid) { const gchar *key = STATE_KEY_EXPANDED; + gboolean expand_row; gchar *group_name; gchar *uri; @@ -2899,22 +2900,17 @@ em_folder_tree_restore_state (EMFolderTree *folder_tree, group_name = g_strdup_printf ("Store %s", uri); - if (e_shell_get_express_mode (shell)) { - gboolean system = FALSE; - - if (strncmp (uri, "vfolder", 7) == 0 || - strncmp(uri, "mbox", 4) == 0) - system = TRUE; - - if (!system && !g_key_file_has_key (key_file, group_name, key, NULL)) { - GtkTreePath *path; + /* Expand stores that have no "Expanded" key. */ + expand_row = !g_key_file_has_key ( + key_file, group_name, key, NULL); - path = gtk_tree_model_get_path (tree_model, &iter); - gtk_tree_view_expand_row (tree_view, path, FALSE); - gtk_tree_path_free (path); - } + /* Do not expand local stores in Express mode. */ + if (e_shell_get_express_mode (shell)) { + expand_row &= (strncmp (uri, "vfolder", 7) != 0); + expand_row &= (strncmp (uri, "mbox", 4) != 0); + } - } else if (!g_key_file_has_key (key_file, group_name, key, NULL)) { + if (expand_row) { GtkTreePath *path; path = gtk_tree_model_get_path (tree_model, &iter); -- cgit