From a0d0dd604b52dfa4d2a2f5378ee384292dfde5cd Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 29 Sep 2009 19:54:09 +0200 Subject: Bug #594015 - Keeps "Loading..." node on the first fetch --- mail/em-folder-tree.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'mail/em-folder-tree.c') 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 -- cgit v1.2.3