fixed problem where not all selected feeds were updated

This commit is contained in:
Martin Rotter 2023-11-01 09:55:01 +01:00
parent 9eb41f7d61
commit 6eea00e628
1 changed files with 10 additions and 7 deletions

View File

@ -72,14 +72,17 @@ void FeedsView::setSortingEnabled(bool enable) {
} }
QList<Feed*> FeedsView::selectedFeeds() const { QList<Feed*> FeedsView::selectedFeeds() const {
const QModelIndex current_index = currentIndex(); auto its = selectedItems();
auto std_feeds = boolinq::from(its)
.select([](RootItem* it) {
return it->toFeed();
})
.where([](Feed* fd) {
return fd != nullptr;
})
.toStdList();
if (current_index.isValid()) { return FROM_STD_LIST(QList<Feed*>, std_feeds);
return m_sourceModel->feedsForIndex(m_proxyModel->mapToSource(current_index));
}
else {
return QList<Feed*>();
}
} }
RootItem* FeedsView::selectedItem() const { RootItem* FeedsView::selectedItem() const {