diff --git a/TODO b/TODO
index 5ad0da047..e8bdeeaf4 100644
--- a/TODO
+++ b/TODO
@@ -61,7 +61,6 @@
- valgrind --tool=memcheck --leak-check=full src/qbittorrent (Looks ok)
- 128m 29m 16m S 4.8 2.9 0:02.28 qbittorrent
* beta 7
- - Add "Mark all as read" feature for RSS
- update doc for plugins (and add screenies)
- update doc for options
- Review torrent content selection
@@ -104,6 +103,7 @@ beta6->beta7 changelog:
- FEATURE: Added an option to set the max number of uploads per torrent
- FEATURE: Added an option to automatically delete torrents when they reach a given ratio (>= 1.0)
- FEATURE: Added an option to display current transfer speeds in title bar
+- FEATURE: Added "Mark all as read" function for RSS feeds
- BUGFIX: In torrent content, it is now easier to filter all torrents using right click menu
- BUGFIX: Updated man page / README / INSTALL
- BUGFIX: Paused torrents could be displayed as connected for a sec after checking
diff --git a/src/rss.h b/src/rss.h
index 5009f1ab4..b8e2a01ed 100644
--- a/src/rss.h
+++ b/src/rss.h
@@ -242,6 +242,14 @@ class RssStream : public QObject{
return listItem.size();
}
+ void markAllAsRead() {
+ RssItem *item;
+ foreach(item, listItem){
+ if(!item->isRead())
+ item->setRead();
+ }
+ }
+
unsigned int getNbUnRead() const{
unsigned int nbUnread=0;
RssItem *item;
diff --git a/src/rss.ui b/src/rss.ui
index d81c3d251..a521dd890 100644
--- a/src/rss.ui
+++ b/src/rss.ui
@@ -13,28 +13,55 @@
Search
-
- 9
-
6
+
+ 9
+
+
+ 9
+
+
+ 9
+
+
+ 9
+
-
-
- 0
-
6
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
-
-
- 0
-
6
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
-
@@ -60,12 +87,21 @@
-
-
- 0
-
6
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
-
@@ -87,18 +123,18 @@
32
-
-
- 32
- 32
-
-
Delete selected streams
+
+
+ 32
+ 32
+
+
-
@@ -109,18 +145,18 @@
32
-
-
- 32
- 32
-
-
Refresh RSS streams
+
+
+ 32
+ 32
+
+
-
@@ -131,18 +167,18 @@
32
-
-
- 55
- 32
-
-
Add a new RSS stream
+
+
+ 55
+ 32
+
+
-
@@ -164,12 +200,21 @@
-
-
- 0
-
6
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
-
@@ -198,12 +243,21 @@
-
-
- 0
-
6
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -236,6 +290,11 @@
Refresh all streams
+
+
+ Mark all as read
+
+
diff --git a/src/rss_imp.cpp b/src/rss_imp.cpp
index a78630329..00740a939 100644
--- a/src/rss_imp.cpp
+++ b/src/rss_imp.cpp
@@ -35,6 +35,7 @@
QTreeWidgetItem* item = listStreams->itemAt(pos);
QList selectedItems = listStreams->selectedItems();
if(item != 0) {
+ myFinishedListMenu.addAction(actionMark_all_as_read);
myFinishedListMenu.addAction(actionDelete);
if(selectedItems.size() == 1)
myFinishedListMenu.addAction(actionRename);
@@ -118,13 +119,24 @@
}
}
+ void RSSImp::on_actionMark_all_as_read_triggered() {
+ QList selectedItems = listStreams->selectedItems();
+ QTreeWidgetItem* item;
+ foreach(item, selectedItems){
+ QString url = item->text(1);
+ RssStream *feed = rssmanager->getFeed(url);
+ feed->markAllAsRead();
+ item->setData(0, Qt::DisplayRole, stream->getAliasOrUrl()+ QString::fromUtf8(" (0)"));
+ }
+ }
+
//right-click somewhere, refresh all the streams
void RSSImp::refreshAllStreams() {
textBrowser->clear();
listNews->clear();
unsigned int nbFeeds = listStreams->topLevelItemCount();
for(unsigned int i=0; itopLevelItem(i)->setData(0,Qt::DecorationRole, QVariant(QIcon(":/Icons/loading.png")));
+ listStreams->topLevelItem(i)->setData(0,Qt::DecorationRole, QVariant(QIcon(":/Icons/loading.png")));
rssmanager->refreshAll();
updateLastRefreshedTimeForStreams();
}
@@ -253,6 +265,7 @@
addStream_button->setIcon(QIcon(QString::fromUtf8(":/Icons/subscribe.png")));
delStream_button->setIcon(QIcon(QString::fromUtf8(":/Icons/unsubscribe.png")));
refreshAll_button->setIcon(QIcon(QString::fromUtf8(":/Icons/refresh.png")));
+ actionMark_all_as_read->setIcon(QIcon(QString::fromUtf8(":/Icons/button_ok.png")));
// icons of right-click menu
actionDelete->setIcon(QIcon(QString::fromUtf8(":/Icons/unsubscribe16.png")));
actionRename->setIcon(QIcon(QString::fromUtf8(":/Icons/log.png")));
diff --git a/src/rss_imp.h b/src/rss_imp.h
index 3cc6854af..401c264e9 100644
--- a/src/rss_imp.h
+++ b/src/rss_imp.h
@@ -57,6 +57,7 @@ class RSSImp : public QWidget, public Ui::RSS{
void selectFirstFeed();
void selectFirstNews();
void updateFeedNbNews(QString url);
+ void on_actionMark_all_as_read_triggered();
public:
RSSImp();