1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 15:27:54 +00:00

Forward add/remove child RSS Item as add/remove Articles

This commit is contained in:
Vladimir Golovnev (Glassez) 2017-05-07 18:49:21 +03:00
parent f8debdea67
commit a36848b5c0

View File

@ -121,13 +121,23 @@ void Folder::addItem(Item *item)
connect(item, &Item::articleRead, this, &Item::articleRead); connect(item, &Item::articleRead, this, &Item::articleRead);
connect(item, &Item::articleAboutToBeRemoved, this, &Item::articleAboutToBeRemoved); connect(item, &Item::articleAboutToBeRemoved, this, &Item::articleAboutToBeRemoved);
connect(item, &Item::unreadCountChanged, this, &Folder::handleItemUnreadCountChanged); connect(item, &Item::unreadCountChanged, this, &Folder::handleItemUnreadCountChanged);
for (auto article: item->articles())
emit newArticle(article);
if (item->unreadCount() > 0)
emit unreadCountChanged(this); emit unreadCountChanged(this);
} }
void Folder::removeItem(Item *item) void Folder::removeItem(Item *item)
{ {
Q_ASSERT(m_items.contains(item)); Q_ASSERT(m_items.contains(item));
for (auto article: item->articles())
emit articleAboutToBeRemoved(article);
item->disconnect(this); item->disconnect(this);
m_items.removeOne(item); m_items.removeOne(item);
if (item->unreadCount() > 0)
emit unreadCountChanged(this); emit unreadCountChanged(this);
} }