From 6b8cb273ad31f01251b1363b11d12982ec63a419 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Tue, 12 Jan 2021 17:38:44 +0200 Subject: SidebarWidget: Limit to 100 feed entries Not including separators. --- src/ui/sidebarwidget.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index c31e157c..db00209f 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c @@ -141,16 +141,12 @@ static void updateItems_SidebarWidget_(iSidebarWidget *d) { init_Date(&on, &now); const int thisYear = on.year; iZap(on); + size_t numItems = 0; iConstForEach(PtrArray, i, listEntries_Feeds()) { const iFeedEntry *entry = i.ptr; if (isHidden_FeedEntry(entry)) { continue; /* A hidden entry. */ } - /* For more items, one can always see "about:feeds". A large number of items - is a bit difficult to navigate in the sidebar. */ - if (numItems_ListWidget(d->list) == 100) { - break; - } /* Exclude entries that are too old for Visited to keep track of. */ if (secondsSince_Time(&now, &entry->discovered) > maxAge_Visited) { break; /* the rest are even older */ @@ -185,6 +181,11 @@ static void updateItems_SidebarWidget_(iSidebarWidget *d) { } addItem_ListWidget(d->list, item); iRelease(item); + if (++numItems == 100) { + /* For more items, one can always see "about:feeds". A large number of items + is a bit difficult to navigate in the sidebar. */ + break; + } } d->menu = makeMenu_Widget( as_Widget(d), -- cgit v1.2.3