mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 21:14:33 +00:00
- UpdateSelectedItems() now sets loading.png icon for all feeds included in selected folders
This commit is contained in:
parent
e126de8ff5
commit
46c6c4fc9a
@ -50,6 +50,20 @@ public:
|
||||
return feeds_items.values();
|
||||
}
|
||||
|
||||
QList<QTreeWidgetItem*> getAllFeedItems(QTreeWidgetItem* folder) {
|
||||
QList<QTreeWidgetItem*> feeds;
|
||||
int nbChildren = folder->childCount();
|
||||
for(int i=0; i<nbChildren; ++i) {
|
||||
QTreeWidgetItem *item = folder->child(i);
|
||||
if(getItemType(item) == RssFile::STREAM) {
|
||||
feeds << item;
|
||||
} else {
|
||||
feeds.append(getAllFeedItems(item));
|
||||
}
|
||||
}
|
||||
return feeds;
|
||||
}
|
||||
|
||||
RssFile* getRSSItem(QTreeWidgetItem *item) {
|
||||
return mapping[item];
|
||||
}
|
||||
|
@ -252,15 +252,21 @@ void RSSImp::renameFiles() {
|
||||
}
|
||||
|
||||
//right-click on stream : refresh it
|
||||
void RSSImp::refreshSelectedStreams() {
|
||||
void RSSImp::refreshSelectedItems() {
|
||||
QList<QTreeWidgetItem*> selectedItems = listStreams->selectedItems();
|
||||
QTreeWidgetItem* item;
|
||||
foreach(item, selectedItems){
|
||||
foreach(QTreeWidgetItem* item, selectedItems){
|
||||
RssFile* file = listStreams->getRSSItem(item);
|
||||
file->refresh();
|
||||
// FIXME: Should recursively set icons for feeds in a folder
|
||||
if(file->getType() == RssFile::STREAM)
|
||||
// Update icons
|
||||
if(file->getType() == RssFile::STREAM) {
|
||||
item->setData(0,Qt::DecorationRole, QVariant(QIcon(":/Icons/loading.png")));
|
||||
} else {
|
||||
// Update feeds in the folder
|
||||
foreach(QTreeWidgetItem *feed, listStreams->getAllFeedItems(item)) {
|
||||
feed->setData(0,Qt::DecorationRole, QVariant(QIcon(":/Icons/loading.png")));
|
||||
}
|
||||
}
|
||||
// Actually refresh
|
||||
file->refresh();
|
||||
}
|
||||
}
|
||||
|
||||
@ -452,7 +458,7 @@ RSSImp::RSSImp(bittorrent *BTSession) : QWidget(), BTSession(BTSession){
|
||||
// Feeds list actions
|
||||
connect(actionDelete, SIGNAL(triggered()), this, SLOT(deleteSelectedItems()));
|
||||
connect(actionRename, SIGNAL(triggered()), this, SLOT(renameFiles()));
|
||||
connect(actionUpdate, SIGNAL(triggered()), this, SLOT(refreshSelectedStreams()));
|
||||
connect(actionUpdate, SIGNAL(triggered()), this, SLOT(refreshSelectedItems()));
|
||||
connect(actionNew_folder, SIGNAL(triggered()), this, SLOT(askNewFolder()));
|
||||
connect(actionNew_subscription, SIGNAL(triggered()), this, SLOT(on_newFeedButton_clicked()));
|
||||
connect(actionUpdate_all_feeds, SIGNAL(triggered()), this, SLOT(on_updateAllButton_clicked()));
|
||||
|
@ -57,7 +57,7 @@ protected slots:
|
||||
void displayRSSListMenu(const QPoint&);
|
||||
void displayItemsListMenu(const QPoint&);
|
||||
void renameFiles();
|
||||
void refreshSelectedStreams();
|
||||
void refreshSelectedItems();
|
||||
void copySelectedFeedsURL();
|
||||
void refreshNewsList(QTreeWidgetItem* item);
|
||||
void refreshTextBrowser(QListWidgetItem *);
|
||||
|
Loading…
x
Reference in New Issue
Block a user