[RFC, PATCH] Show Matching Articles' Threads + Match Only Unread Articles

Jason Lynch <[email protected]>
Newsgroups gmane.comp.gnome.apps.pan.devel
Message-ID <[email protected]>
I had been experiencing problems with the "Show Matching Articles' 
Threads" and "Match Only Unread Articles" options. In particular, when 
the first article in a particular thread either doesn't exist or I have 
never retrieved it, Pan seems to ignore that thread in the header display.

From my cursory examination of the Pan code, the problem comes up in 
accumulate_descendants in pan/data-impl/my-tree.cc, where it will only 
traverse the tree if the node has an associated article. In many cases 
such as the above, it seems that it doesn't, but it does have child nodes 
which do have articles.

The following patch seems to fix the problem for me, but since I am 
woefully unfamiliar with the Pan code and its nuances, I am unsure if it 
is technically correct or if it will break things that I'm not expecting.

Any comments would be appreciated, of course.
---
 pan/data-impl/my-tree.cc |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/pan/data-impl/my-tree.cc b/pan/data-impl/my-tree.cc
index 0758195..82c7f52 100644
--- a/pan/data-impl/my-tree.cc
+++ b/pan/data-impl/my-tree.cc
@@ -317,7 +317,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);
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.