From cb21428ef8f23891a4870886ed1f9dfec3969a61 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Thu, 10 Jun 2004 22:08:41 +0000 Subject: Fixes bug #58825. Ugh. Really Gross Hack (tm). 2004-06-10 Jeffrey Stedfast Fixes bug #58825. Ugh. Really Gross Hack (tm). * em-folder-tree.c (emft_tree_row_expanded): If the store that we are expanding matches the uri that we've been requested to select (e.g. from before the store was added to the tree), then give the uri to the get_folder_info_op. (em_folder_tree_set_selected): If the store for the uri isn't in the tree yet, save the uri for later. * mail-component.c (folder_selected_cb): Set the selected state of the folder-tree and save it. (impl_createControls): Restore the selected state on the folder-tree. * em-folder-tree-model.c (em_folder_tree_model_set_selected): New function to set the selected-uri saved state. (em_folder_tree_model_get_selected): New function to get the selected uri saved state. (em_folder_tree_model_save_state): Renamed. * em-folder-tree.c (emft_update_model_expanded_state): Don't let path be NULL if the node is a store node (path == NULL for any other case is a bug). (emft_maybe_expand_row): Same. svn path=/trunk/; revision=26294 --- mail/em-folder-tree-model.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'mail/em-folder-tree-model.h') diff --git a/mail/em-folder-tree-model.h b/mail/em-folder-tree-model.h index 83d2490c36..db46741657 100644 --- a/mail/em-folder-tree-model.h +++ b/mail/em-folder-tree-model.h @@ -84,7 +84,7 @@ struct _EMFolderTreeModel { GtkTreeStore parent_object; char *filename; /* state filename */ - xmlDocPtr expanded; /* saved expanded state from previous session */ + xmlDocPtr state; /* saved expanded state from previous session */ GHashTable *store_hash; /* maps CamelStore's to store-info's */ GHashTable *uri_hash; /* maps URI's to GtkTreeRowReferences */ @@ -103,13 +103,16 @@ struct _EMFolderTreeModelClass { GtkTreePath *path, GtkTreeIter *iter); - void (* loaded_row) (EMFolderTreeModel *model, - GtkTreePath *path, - GtkTreeIter *iter); + void (* loaded_row) (EMFolderTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter); void (* folder_added) (EMFolderTreeModel *model, const char *path, const char *uri); + + void (* store_added) (EMFolderTreeModel *model, + const char *uri); }; @@ -128,9 +131,13 @@ void em_folder_tree_model_remove_store (EMFolderTreeModel *model, CamelStore *st void em_folder_tree_model_remove_folders (EMFolderTreeModel *model, struct _EMFolderTreeModelStoreInfo *si, GtkTreeIter *toplevel); +char *em_folder_tree_model_get_selected (EMFolderTreeModel *model); +void em_folder_tree_model_set_selected (EMFolderTreeModel *model, const char *uri); + gboolean em_folder_tree_model_get_expanded (EMFolderTreeModel *model, const char *key); void em_folder_tree_model_set_expanded (EMFolderTreeModel *model, const char *key, gboolean expanded); -void em_folder_tree_model_save_expanded (EMFolderTreeModel *model); + +void em_folder_tree_model_save_state (EMFolderTreeModel *model); typedef void (* EMFTModelExpandFunc) (EMFolderTreeModel *model, const char *path, void *user_data); void em_folder_tree_model_expand_foreach (EMFolderTreeModel *model, EMFTModelExpandFunc func, void *user_data); -- cgit