Perform a final pass, removing any pseudo nodes we added earlier. Quick

2001-01-12  Not Zed  <NotZed@Ximian.com>

        * camel-folder-thread.c (camel_folder_thread_messages_new):
        Perform a final pass, removing any pseudo nodes we added earlier.
        Quick patch to test the idea.

svn path=/trunk/; revision=7424
This commit is contained in:
Not Zed
2001-01-12 02:48:45 +00:00
committed by Michael Zucci
parent a197f59b88
commit fcab7b5779
2 changed files with 33 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2001-01-12 Not Zed <NotZed@Ximian.com>
* camel-folder-thread.c (camel_folder_thread_messages_new):
Perform a final pass, removing any pseudo nodes we added earlier.
Quick patch to test the idea.
2001-01-11 Dan Winship <danw@ximian.com>
* providers/imap/camel-imap-folder.c (camel_imap_folder_selected):

View File

@ -277,6 +277,7 @@ group_root_set(CamelFolderThread *thread, CamelFolderThreadNode **cp)
} else if (c->re && container->re) {
d(printf("subjects are common %p and %p\n", c, container));
/* build a phantom node */
remove_node(cp, container, &clast);
remove_node(cp, c, &clast);
@ -535,6 +536,32 @@ camel_folder_thread_messages_new(CamelFolder *folder, GPtrArray *uids)
sort_thread(&head);
/* remove any phantom nodes, this could possibly be put in group_root_set()? */
c = &head;
while (c->next) {
CamelFolderThreadNode *scan, *newtop;
child = c->next;
if (child->message == NULL) {
newtop = child->child;
/* unlink pseudo node */
c->next = newtop;
/* link its siblings onto the end of its children */
scan = &newtop->child;
while (scan->next)
scan = scan->next;
scan->next = newtop->next;
/* and link the now 'real' node into the list */
newtop->next = child->next;
c = newtop->next;
e_memchunk_free(thread->node_chunks, child);
} else {
c = child;
}
}
thread->tree = head;
#ifdef TIMEIT