if user has specific feed selected directly, it can be fetched even if it is disabled

This commit is contained in:
Martin Rotter 2024-11-07 08:32:42 +01:00
parent 88203ad383
commit 3f41aeba06
3 changed files with 12 additions and 6 deletions

View File

@ -230,7 +230,11 @@ void FeedsView::expandCollapseCurrentItem(bool recursive) {
}
void FeedsView::updateSelectedItems() {
qApp->feedReader()->updateFeeds(selectedFeeds(true));
auto sel_feeds = selectedFeeds(true);
auto sel_items = selectedItems();
bool one_specific_feed_selected = sel_items.size() == 1 && sel_items.constFirst()->kind() == RootItem::Kind::Feed;
qApp->feedReader()->updateFeeds(sel_feeds, one_specific_feed_selected);
}
void FeedsView::clearSelectedItems() {

View File

@ -73,12 +73,14 @@ QList<ServiceEntryPoint*> FeedReader::feedServices() {
return m_feedServices;
}
void FeedReader::updateFeeds(const QList<Feed*>& feeds) {
void FeedReader::updateFeeds(const QList<Feed*>& feeds, bool update_switched_off_too) {
auto my_feeds = feeds;
for (int i = 0; i < my_feeds.size(); i++) {
if (my_feeds.at(i)->isSwitchedOff()) {
my_feeds.removeAt(i--);
if (!update_switched_off_too) {
for (int i = 0; i < my_feeds.size(); i++) {
if (my_feeds.at(i)->isSwitchedOff()) {
my_feeds.removeAt(i--);
}
}
}

View File

@ -36,7 +36,7 @@ class RSSGUARD_DLLSPEC FeedReader : public QObject {
MessagesProxyModel* messagesProxyModel() const;
// Update feeds in extra thread.
void updateFeeds(const QList<Feed*>& feeds);
void updateFeeds(const QList<Feed*>& feeds, bool update_switched_off_too = false);
// Push back cached message states back to servers in extra thread.
void synchronizeMessageData(const QList<CacheForServiceRoot*>& caches);