diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-07-30 04:55:01 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-07-30 04:55:01 +0800 |
commit | e8f5c62b0233231a3bdc74a42de062b61e0c15f2 (patch) | |
tree | f2d825276ae0f8da715cf52b2a825390466f8620 /mail | |
parent | 69c904178f72e5eba88159a65f642d9b903a233e (diff) | |
download | gsoc2013-evolution-e8f5c62b0233231a3bdc74a42de062b61e0c15f2.tar gsoc2013-evolution-e8f5c62b0233231a3bdc74a42de062b61e0c15f2.tar.gz gsoc2013-evolution-e8f5c62b0233231a3bdc74a42de062b61e0c15f2.tar.bz2 gsoc2013-evolution-e8f5c62b0233231a3bdc74a42de062b61e0c15f2.tar.lz gsoc2013-evolution-e8f5c62b0233231a3bdc74a42de062b61e0c15f2.tar.xz gsoc2013-evolution-e8f5c62b0233231a3bdc74a42de062b61e0c15f2.tar.zst gsoc2013-evolution-e8f5c62b0233231a3bdc74a42de062b61e0c15f2.zip |
Simplify em_folder_tree_restore_state().
Diffstat (limited to 'mail')
-rw-r--r-- | mail/em-folder-tree.c | 24 |
1 files changed, 10 insertions, 14 deletions
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); |