Logo Search packages:      
Sourcecode: akregator version File versions

void View::slotArticleDelete (  )  [slot]

deletes the currently selected article

Definition at line 1416 of file akregator_view.cpp.

References Akregator::MyArticle::feed(), m_articles, m_articleViewer, Akregator::MyArticle::setDeleted(), and Akregator::ArticleViewer::slotClear().

{

    if ( m_viewMode == CombinedView )
        return;
    
    ArticleListItem* ali = m_articles->selectedItem();

    if (!ali)
        return;

    QString msg = i18n("<qt>Are you sure you want to delete article <b>%1</b>?</qt>").arg(QStyleSheet::escape(ali->article().title()));
                
    if (KMessageBox::warningContinueCancel(0, msg, i18n("Delete Article"), KStdGuiItem::del()) == KMessageBox::Continue)
    {
        MyArticle article = ali->article();
        article.setDeleted();
        if ( ali->nextSibling() )
            ali = ali->nextSibling();
        else
            ali = ali->itemAbove();

        if (ali)
        {
            m_articles->setCurrentItem(ali);
            m_articles->setSelected(ali, true);
        }
        else
        {
            m_articleViewer->slotClear();
        }
        m_articles->slotUpdate();
        Archive::save(article.feed());
    }
}


Generated by  Doxygen 1.6.0   Back to index