1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 07:18:08 +00:00

- Stop displaying items after they were read in "unread" news.

This commit is contained in:
Christophe Dumez 2009-08-28 17:29:34 +00:00
parent 7a59d5e47c
commit e780d83fd0
2 changed files with 13 additions and 0 deletions

View File

@ -201,6 +201,7 @@ void RSSImp::deleteSelectedItems() {
foreach(QTreeWidgetItem *item, selectedItems){
if(listStreams->currentFeed() == item){
textBrowser->clear();
previous_news = 0;
listNews->clear();
}
RssFile *rss_item = listStreams->getRSSItem(item);
@ -412,6 +413,7 @@ void RSSImp::refreshNewsList(QTreeWidgetItem* item) {
news = sortNewsList(rss_item->getNewsList());
// Clear the list first
textBrowser->clear();
previous_news = 0;
listNews->clear();
qDebug("Got the list of news");
foreach(RssItem* article, news){
@ -433,6 +435,14 @@ void RSSImp::refreshNewsList(QTreeWidgetItem* item) {
// display a news
void RSSImp::refreshTextBrowser(QTreeWidgetItem *item) {
if(!item) return;
// Stop displaying previous news if necessary
if(listStreams->currentFeed() == listStreams->getUnreadItem()) {
if(previous_news) {
delete previous_news;
previous_news = 0;
}
previous_news = item;
}
RssStream *stream = listStreams->getRSSItemFromUrl(item->text(1));
RssItem* article = stream->getItem(item->text(0));
QString html;

View File

@ -32,6 +32,8 @@
#define REFRESH_MAX_LATENCY 600000
#include <QPointer>
#include "ui_rss.h"
#include "rss.h"
@ -46,6 +48,7 @@ private:
RssManager *rssmanager;
bittorrent *BTSession;
FeedList *listStreams;
QTreeWidgetItem* previous_news;
public slots:
void deleteSelectedItems();