mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-22 04:24:23 +00:00
- Updated number of unread news of RSS folders after a feed is moved from one folder to another
This commit is contained in:
parent
48b14d1066
commit
f2d2e70967
@ -5,7 +5,8 @@
|
||||
- FEATURE: Save old RSS item to hard disk to remember them on start up
|
||||
- FEATURE: Display free disk space in torrent addition dialog
|
||||
- FEATURE: In torrent addition from URL, paste clipboard content if it contains an URL
|
||||
- FEATURE: RSS Feeds URLs can now be copied to clipboard
|
||||
- FEATURE: RSS feeds URLs can now be copied to clipboard
|
||||
- FEATURE: RSS feeds can now be grouped into folders
|
||||
- FEATURE: If a torrent contains a torrent file, process downloaded torrent file too
|
||||
- BUGFIX: torrent resume code rewrited
|
||||
- COSMETIC: Redesigned RSS tab to improve usability
|
||||
|
@ -10,7 +10,8 @@
|
||||
#include <QUrl>
|
||||
#include "rss.h"
|
||||
|
||||
class FeedList : public QTreeWidget {
|
||||
class FeedList: public QTreeWidget {
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
RssManager *rssmanager;
|
||||
@ -73,6 +74,9 @@ public:
|
||||
return current_feed;
|
||||
}
|
||||
|
||||
signals:
|
||||
void foldersAltered(QList<QTreeWidgetItem*> folders);
|
||||
|
||||
protected slots:
|
||||
void updateCurrentFeed(QTreeWidgetItem* new_item) {
|
||||
if(getItemType(new_item) == RssFile::STREAM)
|
||||
@ -91,20 +95,30 @@ protected:
|
||||
|
||||
void dropEvent(QDropEvent *event) {
|
||||
qDebug("dropEvent");
|
||||
QList<QTreeWidgetItem*> folders_altered;
|
||||
QTreeWidgetItem *dest_folder_item = itemAt(event->pos());
|
||||
RssFolder *dest_folder;
|
||||
if(dest_folder_item)
|
||||
if(dest_folder_item) {
|
||||
dest_folder = (RssFolder*)getRSSItem(dest_folder_item);
|
||||
else
|
||||
folders_altered << dest_folder_item;
|
||||
} else {
|
||||
dest_folder = rssmanager;
|
||||
}
|
||||
QList<QTreeWidgetItem *> src_items = selectedItems();
|
||||
foreach(QTreeWidgetItem *src_item, src_items) {
|
||||
QTreeWidgetItem *parent_folder = src_item->parent();
|
||||
if(parent_folder && !folders_altered.contains(parent_folder))
|
||||
folders_altered << parent_folder;
|
||||
// Actually move the file
|
||||
RssFile *file = getRSSItem(src_item);
|
||||
rssmanager->moveFile(file, dest_folder);
|
||||
}
|
||||
QTreeWidget::dropEvent(event);
|
||||
if(dest_folder_item)
|
||||
dest_folder_item->setExpanded(true);
|
||||
// Emit signal for update
|
||||
if(!folders_altered.empty())
|
||||
emit foldersAltered(folders_altered);
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -396,6 +396,17 @@ void RSSImp::restoreSlidersPosition() {
|
||||
}
|
||||
}
|
||||
|
||||
void RSSImp::updateItemsInfos(QList<QTreeWidgetItem *> items) {
|
||||
foreach(QTreeWidgetItem* item, items) {
|
||||
updateItemInfos(item);
|
||||
}
|
||||
}
|
||||
|
||||
void RSSImp::updateItemInfos(QTreeWidgetItem *item) {
|
||||
RssFile *rss_item = listStreams->getRSSItem(item);
|
||||
item->setText(0, rss_item->getName() + QString::fromUtf8(" (") + QString::number(rss_item->getNbUnRead(), 10)+ QString(")"));
|
||||
}
|
||||
|
||||
void RSSImp::updateFeedIcon(QString url, QString icon_path){
|
||||
QTreeWidgetItem *item = listStreams->getTreeItemFromUrl(url);
|
||||
item->setData(0,Qt::DecorationRole, QVariant(QIcon(icon_path)));
|
||||
@ -447,6 +458,8 @@ 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(listStreams, SIGNAL(foldersAltered(QList<QTreeWidgetItem*>)), this, SLOT(updateItemsInfos(QList<QTreeWidgetItem*>)));
|
||||
|
||||
connect(listNews, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(refreshTextBrowser(QListWidgetItem *)));
|
||||
connect(listNews, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(downloadTorrent()));
|
||||
|
||||
|
@ -63,6 +63,8 @@ protected slots:
|
||||
void refreshTextBrowser(QListWidgetItem *);
|
||||
void updateFeedIcon(QString url, QString icon_path);
|
||||
void updateFeedInfos(QString url, QString aliasOrUrl, unsigned int nbUnread);
|
||||
void updateItemsInfos(QList<QTreeWidgetItem*> items);
|
||||
void updateItemInfos(QTreeWidgetItem *item);
|
||||
void openNewsUrl();
|
||||
void downloadTorrent();
|
||||
void fillFeedsList(QTreeWidgetItem *parent=0, RssFolder *rss_parent=0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user