Browse Source

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

adaptive-webui-19844
Vladimir Golovnev (Glassez) 8 years ago
parent
commit
a36848b5c0
  1. 10
      src/base/rss/rss_folder.cpp

10
src/base/rss/rss_folder.cpp

@ -121,13 +121,23 @@ void Folder::addItem(Item *item) @@ -121,13 +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);
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);
if (item->unreadCount() > 0)
emit unreadCountChanged(this);
}

Loading…
Cancel
Save