From 610cdfa9fd132feda1398c778d5c11643cd6618e Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 25 Feb 2009 11:20:20 +0000 Subject: ** Fix for bug #572268 2009-02-25 Milan Crha ** Fix for bug #572268 * em-subscribe-editor.c: (sub_fill_level): Do not duplicate "Loading..." node when adding to existing node. svn path=/trunk/; revision=37330 --- mail/ChangeLog | 7 +++++++ mail/em-subscribe-editor.c | 11 ++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index 6c48396f08..4043d11b87 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,10 @@ +2009-02-25 Milan Crha + + ** Fix for bug #572268 + + * em-subscribe-editor.c: (sub_fill_level): + Do not duplicate "Loading..." node when adding to existing node. + 2009-02-25 Milan Crha ** Part of fix for bug #563212 diff --git a/mail/em-subscribe-editor.c b/mail/em-subscribe-editor.c index a6ce5d7485..bca062b096 100644 --- a/mail/em-subscribe-editor.c +++ b/mail/em-subscribe-editor.c @@ -288,6 +288,8 @@ sub_fill_level(EMSubscribe *sub, CamelFolderInfo *info, GtkTreeIter *parent, in /* first, fill a level up */ fi = info; while (fi) { + gboolean known = FALSE; + if ((node = g_hash_table_lookup(sub->folders, fi->full_name)) == NULL) { gboolean state; @@ -301,6 +303,7 @@ sub_fill_level(EMSubscribe *sub, CamelFolderInfo *info, GtkTreeIter *parent, in g_hash_table_insert(sub->folders, fi->full_name, node); } else if (node->path) { gtk_tree_model_get_iter(gtk_tree_view_get_model(sub->tree), &iter, node->path); + known = TRUE; } d(printf("flags & CAMEL_FOLDER_NOCHILDREN=%d, f & CAMEL_FOLDER_NOINFERIORS=%d\t fi->full_name=[%s], node->path=%p\n", @@ -315,9 +318,11 @@ sub_fill_level(EMSubscribe *sub, CamelFolderInfo *info, GtkTreeIter *parent, in sub_fill_level(sub, fi->child, &iter, FALSE); } else if (!(fi->flags & CAMEL_FOLDER_NOCHILDREN)) { GtkTreeIter new_iter; - d(printf("flags: CAMEL_FOLDER_NOCHILDREN is not set '%s'\n", fi->full_name)); - gtk_tree_store_append(treestore, &new_iter, &iter); - gtk_tree_store_set(treestore, &new_iter, 0, 0, 1, "Loading...", 2, NULL, -1); + d(printf("flags: CAMEL_FOLDER_NOCHILDREN is not set '%s', known:%d\n", fi->full_name, known?1:0)); + if (!known) { + gtk_tree_store_append(treestore, &new_iter, &iter); + gtk_tree_store_set(treestore, &new_iter, 0, 0, 1, "Loading...", 2, NULL, -1); + } } else { if (pending) -- cgit