1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-28 23:44:32 +00:00

RSS: Fix parent article count when removing a child feed

This commit is contained in:
Christophe Dumez 2011-10-05 18:41:23 +03:00
parent d744968ea6
commit 6357d6372c

View File

@ -249,11 +249,17 @@ void RSSImp::deleteSelectedItems() {
listArticles->clear(); listArticles->clear();
} }
IRssFile *rss_item = m_feedList->getRSSItem(item); IRssFile *rss_item = m_feedList->getRSSItem(item);
QTreeWidgetItem * parent = item->parent();
// Notify TreeWidget // Notify TreeWidget
m_feedList->itemAboutToBeRemoved(item); m_feedList->itemAboutToBeRemoved(item);
// Actually delete the item // Actually delete the item
rss_item->parent()->removeChild(rss_item->id()); rss_item->parent()->removeChild(rss_item->id());
delete item; delete item;
// Update parents count
while (parent && parent != m_feedList->invisibleRootItem()) {
updateItemInfos (parent);
parent = parent->parent();
}
} }
m_rssManager->saveStreamList(); m_rssManager->saveStreamList();
// Update Unread items // Update Unread items
@ -549,6 +555,9 @@ void RSSImp::updateItemsInfos(const QList<QTreeWidgetItem *> &items) {
void RSSImp::updateItemInfos(QTreeWidgetItem *item) { void RSSImp::updateItemInfos(QTreeWidgetItem *item) {
IRssFile *rss_item = m_feedList->getRSSItem(item); IRssFile *rss_item = m_feedList->getRSSItem(item);
if (!rss_item)
return;
QString name; QString name;
if(rss_item == m_rssManager) if(rss_item == m_rssManager)
name = tr("Unread"); name = tr("Unread");