Logo Search packages:      
Sourcecode: akregator version File versions

void Feed::appendArticle ( const MyArticle a  )  [private]

appends article a to the article list

Definition at line 336 of file feed.cpp.

References Akregator::ArticleSequence::append(), Akregator::ArticleSequence::insert(), isExpired(), Akregator::MyArticle::keep(), m_articles, m_unread, Akregator::MyArticle::setFeed(), Akregator::MyArticle::status(), and usesExpiryByAge().

Referenced by appendArticles().

{
    
    if ( a.keep() || ( !usesExpiryByAge() || !isExpired(a) ) ) // if not expired
    {
        if (a.status() != MyArticle::Read)
            m_unread++;
            
        ArticleSequence::Iterator it;
        ArticleSequence::Iterator end = m_articles.end();
        bool inserted = false;    
        it = m_articles.begin();
        
        while ( !inserted && it != end )
            if ( a >= (*it) )
                ++it;       
            else
                inserted = true;
        MyArticle a2(a);    
        a2.setFeed(this);    
        if ( inserted )
            m_articles.insert(it, a2);
        else
            m_articles.append(a2);    
    }    
}


Generated by  Doxygen 1.6.0   Back to index