diff options
author | Not Zed <NotZed@Ximian.com> | 2001-01-12 10:48:45 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2001-01-12 10:48:45 +0800 |
commit | fcab7b57790451d252db55a39a2c8d520689a376 (patch) | |
tree | 791e0491d0ccc3a3cc15b740f750d773822c09e3 /camel/camel-folder-thread.c | |
parent | a197f59b88b1c29ec065c4315e23f15591d3d4a0 (diff) | |
download | gsoc2013-evolution-fcab7b57790451d252db55a39a2c8d520689a376.tar gsoc2013-evolution-fcab7b57790451d252db55a39a2c8d520689a376.tar.gz gsoc2013-evolution-fcab7b57790451d252db55a39a2c8d520689a376.tar.bz2 gsoc2013-evolution-fcab7b57790451d252db55a39a2c8d520689a376.tar.lz gsoc2013-evolution-fcab7b57790451d252db55a39a2c8d520689a376.tar.xz gsoc2013-evolution-fcab7b57790451d252db55a39a2c8d520689a376.tar.zst gsoc2013-evolution-fcab7b57790451d252db55a39a2c8d520689a376.zip |
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
Diffstat (limited to 'camel/camel-folder-thread.c')
-rw-r--r-- | camel/camel-folder-thread.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/camel/camel-folder-thread.c b/camel/camel-folder-thread.c index c83c33687d..2e71189946 100644 --- a/camel/camel-folder-thread.c +++ b/camel/camel-folder-thread.c @@ -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 |