Browse Source

- 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
adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
2b53aa7e81
  1. 4
      src/rss_imp.cpp

4
src/rss_imp.cpp

@ -228,7 +228,7 @@ void RSSImp::fillFeedsList() { @@ -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("<b>")+tr("Description:")+QString::fromUtf8("</b> ")+stream->getDescription()+QString::fromUtf8("<br/><b>")+tr("url:")+QString::fromUtf8("</b> ")+stream->getUrl()+QString::fromUtf8("<br/><b>")+tr("Last refresh:")+QString::fromUtf8("</b> ")+stream->getLastRefreshElapsedString());
@ -380,7 +380,7 @@ RSSImp::RSSImp(bittorrent *BTSession) : QWidget(), BTSession(BTSession){ @@ -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()));

Loading…
Cancel
Save