* src/procmsg.c
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Thu, 22 Jan 2004 23:15:46 +0000 (23:15 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Thu, 22 Jan 2004 23:15:46 +0000 (23:15 +0000)
remove redundant code in procmsg_get_thread_tree()

ChangeLog.claws
configure.ac
src/procmsg.c

index 034da51..d155a76 100644 (file)
@@ -1,3 +1,8 @@
+2004-01-23 [alfons]    0.9.8claws43
+
+       * src/procmsg.c
+               remove redundant code in procmsg_get_thread_tree()
+
 2004-01-21 [christoph] 0.9.8claws42
 
        * src/folderview.c
index c00bd0c..42b478d 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=8
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=42
+EXTRA_VERSION=43
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index 9aa9c2e..75e5c1f 100644 (file)
@@ -217,8 +217,7 @@ static GNode *subject_relation_lookup(GRelation *relation, MsgInfo *msginfo)
 /* return the reversed thread tree */
 GNode *procmsg_get_thread_tree(GSList *mlist)
 {
-       GNode *root, *parent, *node, *next, *last;
-       GNode *prev; /* CLAWS */
+       GNode *root, *parent, *node, *next;
        GHashTable *msgid_table;
        GRelation *subject_relation;
        MsgInfo *msginfo;
@@ -251,9 +250,9 @@ GNode *procmsg_get_thread_tree(GSList *mlist)
                }
        }
 
-       /* complete the unfinished threads. record the last encountered node. */
+       /* complete the unfinished threads */
        for (node = root->children; node != NULL; ) {
-               parent = prev = NULL;
+               parent = NULL;
                next = node->next;
                msginfo = (MsgInfo *)node->data;
                if (msginfo->inreplyto) { 
@@ -262,26 +261,23 @@ GNode *procmsg_get_thread_tree(GSList *mlist)
                           be an ancestor of parent (circular reference) */
                        if (parent && parent != node && 
                            !g_node_is_ancestor(node, parent)) {
-                               /* since this node is moved away, the previous
-                                * one is the last recorded one */
-                               prev = node->prev;
                                g_node_unlink(node);
                                g_node_insert_before
                                        (parent, parent->children, node);
                        }                               
                }
-               last = prev ? prev : node;
                node = next;
        }
 
        if (prefs_common.thread_by_subject) {
-               for (node = last; node && node != NULL;) {
-                       next = node->prev;
+               for (node = root->children; node && node != NULL;) {
+                       next = node->next;
                        msginfo = (MsgInfo *) node->data;
                        
                        parent = subject_relation_lookup(subject_relation, msginfo);
                        
-                       /* the node may already be threaded by IN-REPLY-TO, so go up in the tree to 
+                       /* the node may already be threaded by IN-REPLY-TO, so go up 
+                        * in the tree to 
                           find the parent node */
                        if (parent != NULL) {
                                if (g_node_is_ancestor(node, parent))