[pan2] Attempt to fix display of threads with unread articles.



commit e9a1173fe187a1f1bd525e3e326d46256fd717bb
Author: Jason Lynch <jason calindora com>
Date:   Thu Jul 14 21:56:33 2011 -0500

    Attempt to fix display of threads with unread articles.
    
    When using the "Show Matching Articles' Threads" and "Match Only Unread
    Articles" options together, some articles may not be shown at all. In
    particular, when the first article in a particular thread either doesn't exist
    or has never been retrieved, Pan ignores that thread entirely in the display.
    
    The problem seems to stem from accumulate_descendants, which will only traverse
    the tree if the node has an associated article. In many cases, such as above,
    the node doesn't have an article, but it does have child nodes which do have
    articles.
    
    This patch fixes the problem for me, and it has never caused a crash that I am
    aware of, but I am insufficiently familiar with Pan's internals to definitely
    proclaim this the best solution.
    
    Signed-off-by: Jason Lynch <jason calindora com>

 pan/data-impl/my-tree.cc |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/pan/data-impl/my-tree.cc b/pan/data-impl/my-tree.cc
index 6d8d84f..6d584da 100644
--- a/pan/data-impl/my-tree.cc
+++ b/pan/data-impl/my-tree.cc
@@ -450,7 +450,7 @@ DataImpl :: MyTree :: accumulate_descendants (unique_nodes_t& descendants,
   // if this node has an article and wasn't already in `descendants',
   // then add it and its children.
 
-  if (node->_article && descendants.insert(node).second)
+  if (node->_article && descendants.insert(node).second || !node->_article)
     foreach_const (ArticleNode::children_t, node->_children, it)
       accumulate_descendants (descendants, *it);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]