aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/em-folder-tree.c')
-rw-r--r--mail/em-folder-tree.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c
index 12491c857e..0217a7aa58 100644
--- a/mail/em-folder-tree.c
+++ b/mail/em-folder-tree.c
@@ -243,11 +243,21 @@ folder_tree_get_folder_info__done (struct _EMFolderTreeGetFolderInfo *m)
/* get the first child (which will be a dummy node) */
gtk_tree_model_iter_children (model, &iter, &root);
- /* Traverse to the last valid iter */
+ /* Traverse to the last valid iter, or the "Loading..." node */
titer = iter;
- while (gtk_tree_model_iter_next (model, &iter))
+ do {
+ gboolean is_store_node = FALSE, is_folder_node = FALSE;
+
titer = iter; /* Preserve the last valid iter */
+ gtk_tree_model_get (model, &iter, COL_BOOL_IS_STORE, &is_store_node, COL_BOOL_IS_FOLDER, &is_folder_node, -1);
+
+ /* stop on a "Loading..." node */
+ if (!is_store_node && !is_folder_node)
+ break;
+
+ } while (gtk_tree_model_iter_next (model, &iter));
+
iter = titer;
/* FIXME: camel's IMAP code is totally on crack here, @top's