Logo Search packages:      
Sourcecode: akregator version File versions

void Feed::slotDeleteExpiredArticles (  )  [virtual, slot]

deletes expired articles

Implements Akregator::TreeNode.

Definition at line 511 of file feed.cpp.

References isExpired(), m_articles, Akregator::TreeNode::modified(), and usesExpiryByAge().

{
    bool changed = false;
    if ( !usesExpiryByAge() )
        return;

    ArticleSequence::ConstIterator it = m_articles.end();
    ArticleSequence::ConstIterator tmp;
    ArticleSequence::ConstIterator begin = m_articles.begin();
    // when we found an article which is not yet expired, we can stop, since articles are sorted by date
    bool foundNotYetExpired = false;

    while ( !foundNotYetExpired && it != begin )
    {
        --it;
        if (!(*it).keep())
        {
            if ( isExpired(*it) )
            {
                tmp = it;
                m_articles.remove(*tmp);
                changed = true;
            }
            else
                foundNotYetExpired = true;
        }
    }
    if (changed)
        modified();
}


Generated by  Doxygen 1.6.0   Back to index