don't mark the thread todo if the thread is collapsed and you want

to mark the top message todo

svn path=/branches/KDE/3.5/kdepim/; revision=515022
wilder-work
Stephan Kulow 20 years ago
parent 56731232ab
commit d4e25e6cc6
  1. 17
      kmheaders.cpp

@ -1148,13 +1148,28 @@ void KMHeaders::msgHeaderChanged(KMFolder*, int msgId)
//-----------------------------------------------------------------------------
void KMHeaders::setMsgStatus (KMMsgStatus status, bool toggle)
{
kdDebug() << k_funcinfo << endl;
SerNumList serNums;
for (QListViewItemIterator it(this); it.current(); ++it)
QListViewItemIterator it(this, QListViewItemIterator::Selected|QListViewItemIterator::Visible);
while( it.current() ) {
if ( it.current()->isSelected() && it.current()->isVisible() ) {
if ( it.current()->parent() && ( !it.current()->parent()->isOpen() ) ) {
// the item's parent is closed, don't traverse any more of this subtree
QListViewItem * lastAncestorWithSiblings = it.current()->parent();
// travel towards the root until we find an ancestor with siblings
while ( ( lastAncestorWithSiblings->depth() > 0 ) && !lastAncestorWithSiblings->nextSibling() )
lastAncestorWithSiblings = lastAncestorWithSiblings->parent();
// move the iterator to that ancestor's next sibling
it = QListViewItemIterator( lastAncestorWithSiblings->nextSibling() );
continue;
}
HeaderItem *item = static_cast<HeaderItem*>(it.current());
KMMsgBase *msgBase = mFolder->getMsgBase(item->msgId());
serNums.append( msgBase->getMsgSerNum() );
}
++it;
}
if (serNums.empty())
return;

Loading…
Cancel
Save