From a02934f6a81406fa9509025e94199e9e78ea59a8 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 7 May 2004 20:36:18 +0000 Subject: Fix for bug #57152. 2004-05-07 Jeffrey Stedfast Fix for bug #57152. * em-folder-tree.c (emft_get_folder_info__got): If we queried for a recursive folder-info listing, then pass fully_loaded as TRUE to set_folder_info(). (emft_get_folder_info__got): If we find that a folder doesn't have children, set the expanded state to FALSE. * em-folder-tree-model.c (em_folder_tree_model_set_folder_info): Now takes a "fully_loaded" argument to hint to set_folder_info whether or not folder-info's without child nodes can possibly have children (eg. if fully_loaded is set and fi->child is NULL, then 'load' will be FALSE no matter what fi->flags contains). svn path=/trunk/; revision=25826 --- mail/em-folder-tree-model.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'mail/em-folder-tree-model.c') diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c index 8c81be9735..571ac3042b 100644 --- a/mail/em-folder-tree-model.c +++ b/mail/em-folder-tree-model.c @@ -411,17 +411,18 @@ account_removed (EAccountList *accounts, EAccount *account, gpointer user_data) void em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, GtkTreeIter *iter, struct _EMFolderTreeModelStoreInfo *si, - CamelFolderInfo *fi) + CamelFolderInfo *fi, int fully_loaded) { GtkTreeRowReference *uri_row, *path_row; unsigned int unread; GtkTreePath *path; GtkTreeIter sub; - gboolean load; + gboolean load = FALSE; struct _CamelFolder *folder; gboolean emitted = FALSE; - load = fi->child == NULL && !(fi->flags & (CAMEL_FOLDER_NOCHILDREN | CAMEL_FOLDER_NOINFERIORS)); + if (!fully_loaded) + load = fi->child == NULL && !(fi->flags & (CAMEL_FOLDER_NOCHILDREN | CAMEL_FOLDER_NOINFERIORS)); path = gtk_tree_model_get_path ((GtkTreeModel *) model, iter); uri_row = gtk_tree_row_reference_new ((GtkTreeModel *) model, path); @@ -493,7 +494,7 @@ em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, GtkTreeIter *ite emitted = TRUE; } - em_folder_tree_model_set_folder_info (model, &sub, si, fi); + em_folder_tree_model_set_folder_info (model, &sub, si, fi, fully_loaded); fi = fi->next; } while (fi); } @@ -558,7 +559,7 @@ folder_subscribed (CamelStore *store, CamelFolderInfo *fi, EMFolderTreeModel *mo /* append a new node */ gtk_tree_store_append ((GtkTreeStore *) model, &iter, &parent); - em_folder_tree_model_set_folder_info (model, &iter, si, fi); + em_folder_tree_model_set_folder_info (model, &iter, si, fi, TRUE); g_signal_emit (model, signals[FOLDER_ADDED], 0, fi->path, fi->uri); @@ -701,7 +702,7 @@ folder_renamed (CamelStore *store, CamelRenameInfo *info, EMFolderTreeModel *mod } gtk_tree_store_append ((GtkTreeStore *) model, &iter, &root); - em_folder_tree_model_set_folder_info (model, &iter, si, info->new); + em_folder_tree_model_set_folder_info (model, &iter, si, info->new, TRUE); done: -- cgit