From 538c028f8a9814797ab602a12b5069763d72e017 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Fri, 21 Aug 2009 17:49:48 +0000 Subject: [PATCH] - Some more RSS polishing --- src/rss.h | 2 ++ src/rss_imp.cpp | 13 +++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/rss.h b/src/rss.h index 812f3d8e1..baae1cbc5 100644 --- a/src/rss.h +++ b/src/rss.h @@ -597,6 +597,8 @@ short readDoc(const QDomDocument& doc) { // All torrents are downloaded from this feed BTSession->downloadUrlAndSkipDialog(item->getTorrentUrl()); } + // Item was downloaded, consider it as Read + item->setRead(); // Clean up delete matching_filter; } diff --git a/src/rss_imp.cpp b/src/rss_imp.cpp index 739f782b9..d0d9fc6a9 100644 --- a/src/rss_imp.cpp +++ b/src/rss_imp.cpp @@ -187,8 +187,8 @@ void RSSImp::on_actionMark_all_as_read_triggered() { feed->markAllAsRead(); item->setData(0, Qt::DisplayRole, feed->getAliasOrUrl()+ QString::fromUtf8(" (0)")); } - if(selectedItems.size()) - refreshNewsList(selectedItems.last()); + /*if(selectedItems.size()) + refreshNewsList(selectedItems.last());*/ } //right-click somewhere, refresh all the streams @@ -258,7 +258,11 @@ void RSSImp::updateLastRefreshedTimeForStreams() { // fills the newsList void RSSImp::refreshNewsList(QTreeWidgetItem* item) { - if(!item) return; + if(!item) { + selectedFeedUrl = QString::null; + listNews->clear(); + return; + } selectedFeedUrl = item->text(1); RssStream *stream = rssmanager->getFeed(selectedFeedUrl); qDebug("Getting the list of news"); @@ -359,6 +363,8 @@ void RSSImp::updateFeedInfos(QString url, QString aliasOrUrl, unsigned int nbUnr RSSImp::RSSImp(bittorrent *BTSession) : QWidget(), BTSession(BTSession){ setupUi(this); + selectedFeedUrl = QString::null; + // icons of bottom buttons addStream_button->setIcon(QIcon(QString::fromUtf8(":/Icons/oxygen/subscribe.png"))); delStream_button->setIcon(QIcon(QString::fromUtf8(":/Icons/oxygen/unsubscribe.png"))); @@ -415,7 +421,6 @@ void RSSImp::selectFirstFeed(){ if(listStreams->topLevelItemCount()){ QTreeWidgetItem *first = listStreams->topLevelItem(0); listStreams->setCurrentItem(first); - selectedFeedUrl = first->text(1); } }