Logo Search packages:      
Sourcecode: akregator version File versions

void View::slotFeedRemove (  )  [slot]

removes the currently selected feed (ask for confirmation)

Definition at line 941 of file akregator_view.cpp.

References Akregator::TreeNode::isGroup(), m_feedList, m_tree, Akregator::FeedList::rootNode(), and Akregator::TreeNode::title().

{
    TreeNode* selectedNode = m_tree->selectedNode();
    
    // don't delete root element! (safety valve)
    if (!selectedNode || selectedNode == m_feedList->rootNode())
        return;
    
    QString msg;
   
    if (selectedNode->title().isEmpty()) {
        msg = selectedNode->isGroup() ?
            i18n("<qt>Are you sure you want to delete this folder and its feeds and subfolders?</qt>") :
            i18n("<qt>Are you sure you want to delete this feed?</qt>");
    } else {
        msg = selectedNode->isGroup() ?
            i18n("<qt>Are you sure you want to delete folder<br><b>%1</b><br> and its feeds and subfolders?</qt>") :
            i18n("<qt>Are you sure you want to delete feed<br><b>%1</b>?</qt>");
        msg = msg.arg(selectedNode->title());
    }
    if (KMessageBox::warningContinueCancel(0, msg, i18n("Delete Feed"), KStdGuiItem::del()) == KMessageBox::Continue)
    {
        delete selectedNode;
        m_tree->setFocus();
     }
}


Generated by  Doxygen 1.6.0   Back to index