From 2b53aa7e811e2f96ac29d9b610cb70b523b11005 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sat, 22 Aug 2009 02:43:11 +0000 Subject: [PATCH] - Use clickedItem event to update news read status instead of currentItem one to avoid marking items as read although they were not actually clicked by the user - Use the actual number of unread news instead of (0) when adding a RSS stream to the list since it is now possible that unread news were loaded from hard disk by the class constructor --- src/rss_imp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rss_imp.cpp b/src/rss_imp.cpp index 23764d4c5..f4fabf995 100644 --- a/src/rss_imp.cpp +++ b/src/rss_imp.cpp @@ -228,7 +228,7 @@ void RSSImp::fillFeedsList() { RssStream* stream; foreach(stream, feeds){ QTreeWidgetItem* item = new QTreeWidgetItem(listStreams); - item->setData(0, Qt::DisplayRole, stream->getAliasOrUrl()+ QString::fromUtf8(" (0)")); + item->setData(0, Qt::DisplayRole, stream->getAliasOrUrl()+ QString::fromUtf8(" (")+QString::number(stream->getNbUnRead(), 10)+QString(")")); item->setData(0,Qt::DecorationRole, QVariant(QIcon(QString::fromUtf8(":/Icons/loading.png")))); item->setData(1, Qt::DisplayRole, stream->getUrl()); item->setToolTip(0, QString::fromUtf8("")+tr("Description:")+QString::fromUtf8(" ")+stream->getDescription()+QString::fromUtf8("
")+tr("url:")+QString::fromUtf8(" ")+stream->getUrl()+QString::fromUtf8("
")+tr("Last refresh:")+QString::fromUtf8(" ")+stream->getLastRefreshElapsedString()); @@ -380,7 +380,7 @@ 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(listNews, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(refreshTextBrowser(QListWidgetItem *))); + connect(listNews, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(refreshTextBrowser(QListWidgetItem *))); connect(listNews, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(downloadTorrent())); refreshTimeTimer = new QTimer(this); connect(refreshTimeTimer, SIGNAL(timeout()), this, SLOT(updateLastRefreshedTimeForStreams()));