- Updated number of unread news of RSS folders after a feed is moved from one folder to another

This commit is contained in:
Christophe Dumez 2009-08-23 12:49:37 +00:00
parent 48b14d1066
commit f2d2e70967
4 changed files with 34 additions and 4 deletions

View file

@ -396,6 +396,17 @@ void RSSImp::restoreSlidersPosition() {
}
}
void RSSImp::updateItemsInfos(QList<QTreeWidgetItem *> items) {
foreach(QTreeWidgetItem* item, items) {
updateItemInfos(item);
}
}
void RSSImp::updateItemInfos(QTreeWidgetItem *item) {
RssFile *rss_item = listStreams->getRSSItem(item);
item->setText(0, rss_item->getName() + QString::fromUtf8(" (") + QString::number(rss_item->getNbUnRead(), 10)+ QString(")"));
}
void RSSImp::updateFeedIcon(QString url, QString icon_path){
QTreeWidgetItem *item = listStreams->getTreeItemFromUrl(url);
item->setData(0,Qt::DecorationRole, QVariant(QIcon(icon_path)));
@ -447,6 +458,8 @@ RSSImp::RSSImp(bittorrent *BTSession) : QWidget(), BTSession(BTSession){
connect(actionDownload_torrent, SIGNAL(triggered()), this, SLOT(downloadTorrent()));
connect(listStreams, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(refreshNewsList(QTreeWidgetItem*)));
connect(listStreams, SIGNAL(foldersAltered(QList<QTreeWidgetItem*>)), this, SLOT(updateItemsInfos(QList<QTreeWidgetItem*>)));
connect(listNews, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(refreshTextBrowser(QListWidgetItem *)));
connect(listNews, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(downloadTorrent()));