Skip to content

Commit

Permalink
if user has specific feed selected directly, it can be fetched even i…
Browse files Browse the repository at this point in the history
…f it is disabled
  • Loading branch information
martinrotter committed Nov 7, 2024
1 parent 88203ad commit 3f41aeb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 5 additions & 1 deletion src/librssguard/gui/feedsview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
10 changes: 6 additions & 4 deletions src/librssguard/miscellaneous/feedreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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--);
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/librssguard/miscellaneous/feedreader.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3f41aeb

Please sign in to comment.