mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-24 05:25:37 +00:00
Merge pull request #6757 from glassez/rss
Forward add/remove child RSS Item event as set of add/remove Articles events
This commit is contained in:
commit
692e4a986a
@ -105,12 +105,6 @@ void Folder::handleItemUnreadCountChanged()
|
||||
emit unreadCountChanged(this);
|
||||
}
|
||||
|
||||
void Folder::handleItemAboutToBeDestroyed(Item *item)
|
||||
{
|
||||
if (item->unreadCount() > 0)
|
||||
emit unreadCountChanged(this);
|
||||
}
|
||||
|
||||
void Folder::cleanup()
|
||||
{
|
||||
foreach (Item *item, items())
|
||||
@ -127,14 +121,23 @@ void Folder::addItem(Item *item)
|
||||
connect(item, &Item::articleRead, this, &Item::articleRead);
|
||||
connect(item, &Item::articleAboutToBeRemoved, this, &Item::articleAboutToBeRemoved);
|
||||
connect(item, &Item::unreadCountChanged, this, &Folder::handleItemUnreadCountChanged);
|
||||
connect(item, &Item::aboutToBeDestroyed, this, &Folder::handleItemAboutToBeDestroyed);
|
||||
emit unreadCountChanged(this);
|
||||
|
||||
for (auto article: item->articles())
|
||||
emit newArticle(article);
|
||||
|
||||
if (item->unreadCount() > 0)
|
||||
emit unreadCountChanged(this);
|
||||
}
|
||||
|
||||
void Folder::removeItem(Item *item)
|
||||
{
|
||||
Q_ASSERT(m_items.contains(item));
|
||||
|
||||
for (auto article: item->articles())
|
||||
emit articleAboutToBeRemoved(article);
|
||||
|
||||
item->disconnect(this);
|
||||
m_items.removeOne(item);
|
||||
emit unreadCountChanged(this);
|
||||
if (item->unreadCount() > 0)
|
||||
emit unreadCountChanged(this);
|
||||
}
|
||||
|
@ -59,7 +59,6 @@ namespace RSS
|
||||
|
||||
private slots:
|
||||
void handleItemUnreadCountChanged();
|
||||
void handleItemAboutToBeDestroyed(Item *item);
|
||||
|
||||
private:
|
||||
void cleanup() override;
|
||||
|
Loading…
x
Reference in New Issue
Block a user