diff options
author | Not Zed <NotZed@HelixCode.com> | 2000-11-21 22:28:06 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2000-11-21 22:28:06 +0800 |
commit | 8d9d1e00dd89221488084e51b4940469e8db4f4e (patch) | |
tree | a1a7ad3abf0c916f4cd0a828a324126b27b9d4eb | |
parent | a34a4b15b8e5ab5f0a145c17ef0969da9666d8d0 (diff) | |
download | gsoc2013-evolution-8d9d1e00dd89221488084e51b4940469e8db4f4e.tar.gz gsoc2013-evolution-8d9d1e00dd89221488084e51b4940469e8db4f4e.tar.zst gsoc2013-evolution-8d9d1e00dd89221488084e51b4940469e8db4f4e.zip |
IF we dont find a source, clear the exception and ignore it silently. for
2000-11-21 Not Zed <NotZed@HelixCode.com>
* mail-vfolder.c (vfolder_uri_to_folder): IF we dont find a
source, clear the exception and ignore it silently. for e.g. if
the user reconfigured their mailboxes and one of them no longer
exists.
* message-list.c:
(message_list_set_folder): If we get set a new folder, unhook any
events before unrefing the folder too (the folder is never reset
currently, but this would cause problems).
(subtree_unread): Check for uid null, wont crash, but its a bug.
(ml_tree_value_at): If the uid is null, then fake an obviously bad
line.
(build_subtree): Yeah well, we can't like freeze/thaw here,
because this is called recursive, and freeze/thaw isn't
recursive, like pre model and post model change was.
(build_tree): Maybe we can try it here, although i dont think
it'll help much.
(build_flat): And this is also a tree. yes a tree.
(build_tree): Added changes arg. If set, then try the 'diff'
approach, unless the tree is already empty.
(message_list_set_threaded): Dont clear the tree here.
(message_list_set_search): Or here.
svn path=/trunk/; revision=6629
-rw-r--r-- | mail/ChangeLog | 22 | ||||
-rw-r--r-- | mail/mail-vfolder.c | 4 | ||||
-rw-r--r-- | mail/message-list.c | 38 |
3 files changed, 50 insertions, 14 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index d1b08601e7..4afc22ac4c 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,9 @@ +2000-11-21 Not Zed <NotZed@HelixCode.com> + + * mail-vfolder.c (vfolder_uri_to_folder): IF we dont find a + source, clear the exception and ignore it silently. for e.g. if + the user reconfigured their mailboxes and one of them no longer + exists. 2000-11-21 Radek Doulik <rodo@helixcode.com> * mail-display.c: #include <gtkhtml/gtkhtml-embedded.h> @@ -14,6 +20,22 @@ (build_subtree_diff): (do_regenerate_messagelist): (cleanup_regenerate_messagelist): Changed to use camel-folder-thread. + (message_list_set_folder): If we get set a new folder, unhook any + events before unrefing the folder too (the folder is never reset + currently, but this would cause problems). + (subtree_unread): Check for uid null, wont crash, but its a bug. + (ml_tree_value_at): If the uid is null, then fake an obviously bad + line. + (build_subtree): Yeah well, we can't like freeze/thaw here, + because this is called recursive, and freeze/thaw isn't + recursive, like pre model and post model change was. + (build_tree): Maybe we can try it here, although i dont think + it'll help much. + (build_flat): And this is also a tree. yes a tree. + (build_tree): Added changes arg. If set, then try the 'diff' + approach, unless the tree is already empty. + (message_list_set_threaded): Dont clear the tree here. + (message_list_set_search): Or here. 2000-11-20 Not Zed <NotZed@HelixCode.com> diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c index d97e907d0f..a9ad3ff561 100644 --- a/mail/mail-vfolder.c +++ b/mail/mail-vfolder.c @@ -202,11 +202,15 @@ vfolder_uri_to_folder(const char *uri, CamelException *ex) while ( (sourceuri = vfolder_rule_next_source(rule, sourceuri)) ) { d(printf("adding vfolder source: %s\n", sourceuri)); sourcefolder = mail_tool_uri_to_folder (sourceuri, ex); + printf("source folder = %p\n", sourcefolder); if (sourcefolder) { sources++; mail_tool_camel_lock_up (); camel_vee_folder_add_folder(folder, sourcefolder); mail_tool_camel_lock_down (); + } else { + /* we'll just silently ignore now-missing sources */ + camel_exception_clear(ex); } } /* if we didn't have any sources, just use Inbox as the default */ diff --git a/mail/message-list.c b/mail/message-list.c index b48a46e590..2245288ddc 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -618,7 +618,9 @@ subtree_unread(MessageList *ml, ETreePath *node) while (node) { ETreePath *child; uid = e_tree_model_node_get_data((ETreeModel *)ml->table_model, node); - if (id_is_uid(uid)) { + if (uid == NULL) { + g_warning("I got a NULL uid at node %p", node); + } else if (id_is_uid(uid)) { info = camel_folder_get_message_info(ml->folder, id_uid(uid)); if (!(info->flags & CAMEL_MESSAGE_SEEN)) return TRUE; @@ -670,6 +672,10 @@ ml_tree_value_at (ETreeModel *etm, ETreePath *path, int col, void *model_data) /* retrieve the message information array */ uid = e_tree_model_node_get_data (etm, path); + if (uid == NULL) { + uid="s ERROR ERROR - UNKNOWN ROW IN TREE"; + goto fake; + } if (!id_is_uid(uid)) goto fake; uid = id_uid(uid); @@ -1344,7 +1350,7 @@ static void build_subtree (MessageList *ml, ETreePath *parent, CamelFolderThread static void build_subtree_diff (MessageList *ml, ETreePath *parent, ETreePath *path, CamelFolderThreadNode *c, int *row, GHashTable *expanded_nodes); static void -build_tree (MessageList *ml, CamelFolderThread *thread) +build_tree (MessageList *ml, CamelFolderThread *thread, CamelFolderChangeInfo *changes) { int row = 0; GHashTable *expanded_nodes; @@ -1371,10 +1377,13 @@ build_tree (MessageList *ml, CamelFolderThread *thread) ml->tree_root = e_tree_model_node_insert(etm, NULL, 0, NULL); e_tree_model_node_set_expanded(etm, ml->tree_root, TRUE); } - + top = e_tree_model_node_get_first_child(etm, ml->tree_root); - if (top == NULL) { + if (top == NULL || changes == NULL) { + e_tree_model_freeze(etm); + clear_tree (ml); build_subtree(ml, ml->tree_root, thread->tree, &row, expanded_nodes); + e_tree_model_thaw(etm); } else { build_subtree_diff(ml, ml->tree_root, top, thread->tree, &row, expanded_nodes); } @@ -1428,8 +1437,6 @@ build_subtree (MessageList *ml, ETreePath *parent, CamelFolderThreadNode *c, int char *id; int expanded = FALSE; - e_tree_model_freeze (tree); - while (c) { if (c->message) { id = new_id_from_uid(c->message->uid); @@ -1457,8 +1464,6 @@ build_subtree (MessageList *ml, ETreePath *parent, CamelFolderThreadNode *c, int } c = c->next; } - - e_tree_model_thaw (tree); } /* compares a thread tree node with the etable tree node to see if they point to @@ -1704,14 +1709,14 @@ build_flat (MessageList *ml, GPtrArray *uids, CamelFolderChangeInfo *changes) if (changes) { build_flat_diff(ml, changes); } else { - e_table_model_pre_change(ml->table_model); + e_tree_model_freeze(tree); clear_tree (ml); for (i = 0; i < uids->len; i++) { uid = new_id_from_uid(uids->pdata[i]); node = e_tree_model_node_insert (tree, ml->tree_root, -1, uid); g_hash_table_insert (ml->uid_rowmap, id_uid(uid), GINT_TO_POINTER (i)); } - e_table_model_changed(ml->table_model); + e_tree_model_thaw(tree); } #ifdef TIMEIT @@ -1914,8 +1919,13 @@ message_list_set_folder (MessageList *message_list, CamelFolder *camel_folder) camel_exception_init (&ex); - if (message_list->folder) + if (message_list->folder) { + camel_object_unhook_event((CamelObject *)message_list->folder, "folder_changed", + folder_changed, message_list); + camel_object_unhook_event((CamelObject *)message_list->folder, "message_changed", + message_changed, message_list); camel_object_unref (CAMEL_OBJECT (message_list->folder)); + } message_list->folder = camel_folder; @@ -2044,7 +2054,7 @@ message_list_set_threaded(MessageList *ml, gboolean threaded) if (ml->threaded ^ threaded) { ml->threaded = threaded; - clear_tree(ml); + /*clear_tree(ml);*/ mail_do_regenerate_messagelist(ml, ml->search, NULL); } } @@ -2059,7 +2069,7 @@ message_list_set_search(MessageList *ml, const char *search) if (search != NULL && ml->search !=NULL && strcmp(search, ml->search)==0) return; - clear_tree(ml); + /*clear_tree(ml);*/ mail_do_regenerate_messagelist(ml, search, NULL); } @@ -2146,7 +2156,7 @@ static void cleanup_regenerate_messagelist (gpointer in_data, gpointer op_data, } if (input->dotree) - build_tree(input->ml, data->tree); + build_tree(input->ml, data->tree, input->changes); else build_flat(input->ml, data->uids, input->changes); |