Index: mail/ChangeLog
===================================================================
--- mail/ChangeLog	(revision 37132)
+++ mail/ChangeLog	(working copy)
@@ -1,3 +1,12 @@
+2009-01-26  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #337082
+
+	* em-folder-tree.c: (emft_get_folder_info__done):
+	Do not add empty nodes for known folders.
+	* em-folder-tree.c: (emft_tree_row_expanded):
+	Reverted patch from 2008-12-08.
+
 2009-01-19  Milan Crha  <mcrha@redhat.com>
 
 	** Fix for bug #204891
Index: mail/em-folder-tree.c
===================================================================
--- mail/em-folder-tree.c	(revision 37132)
+++ mail/em-folder-tree.c	(working copy)
@@ -1808,9 +1808,12 @@ emft_get_folder_info__done (struct _EMFo
 		int fully_loaded = (m->flags & CAMEL_STORE_FOLDER_INFO_RECURSIVE) ? TRUE : FALSE;
 
 		do {
-			em_folder_tree_model_set_folder_info (priv->model, &iter, si, fi, fully_loaded);
+			gboolean known = g_hash_table_lookup (si->full_hash, fi->full_name) != NULL;
 
-			if ((fi = fi->next) != NULL)
+			if (!known)
+				em_folder_tree_model_set_folder_info (priv->model, &iter, si, fi, fully_loaded);
+
+			if ((fi = fi->next) != NULL && !known)
 				gtk_tree_store_append (model, &iter, &root);
 		} while (fi != NULL);
 	}
@@ -1896,8 +1899,7 @@ emft_tree_row_expanded (GtkTreeView *tre
 		return;
 	}
 
-	/* do not set LOAD_SUBDIRS to FALSE until we are really done with loading */
-	/* gtk_tree_store_set ((GtkTreeStore *)model, root, COL_BOOL_LOAD_SUBDIRS, FALSE, -1); */
+	gtk_tree_store_set ((GtkTreeStore *)model, root, COL_BOOL_LOAD_SUBDIRS, FALSE, -1);
 
 	m = mail_msg_new (&get_folder_info_info);
 	m->root = gtk_tree_row_reference_new (model, tree_path);
