From 3f41aeba06f6fbc9a3fc693d8c735fabdd072164 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Thu, 7 Nov 2024 08:32:42 +0100 Subject: [PATCH] if user has specific feed selected directly, it can be fetched even if it is disabled --- src/librssguard/gui/feedsview.cpp | 6 +++++- src/librssguard/miscellaneous/feedreader.cpp | 10 ++++++---- src/librssguard/miscellaneous/feedreader.h | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/librssguard/gui/feedsview.cpp b/src/librssguard/gui/feedsview.cpp index 816d25d86..324cd6b7f 100644 --- a/src/librssguard/gui/feedsview.cpp +++ b/src/librssguard/gui/feedsview.cpp @@ -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() { diff --git a/src/librssguard/miscellaneous/feedreader.cpp b/src/librssguard/miscellaneous/feedreader.cpp index b241a4389..5bfa661dc 100644 --- a/src/librssguard/miscellaneous/feedreader.cpp +++ b/src/librssguard/miscellaneous/feedreader.cpp @@ -73,12 +73,14 @@ QList FeedReader::feedServices() { return m_feedServices; } -void FeedReader::updateFeeds(const QList& feeds) { +void FeedReader::updateFeeds(const QList& 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--); + } } } diff --git a/src/librssguard/miscellaneous/feedreader.h b/src/librssguard/miscellaneous/feedreader.h index d1ed0bdb2..081ea39b5 100644 --- a/src/librssguard/miscellaneous/feedreader.h +++ b/src/librssguard/miscellaneous/feedreader.h @@ -36,7 +36,7 @@ class RSSGUARD_DLLSPEC FeedReader : public QObject { MessagesProxyModel* messagesProxyModel() const; // Update feeds in extra thread. - void updateFeeds(const QList& feeds); + void updateFeeds(const QList& feeds, bool update_switched_off_too = false); // Push back cached message states back to servers in extra thread. void synchronizeMessageData(const QList& caches);