diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-11-27 08:34:15 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-11-27 08:34:15 +0200 |
commit | f4d39068fb1bcacd6773cb00bb36ec84e3ef8f6f (patch) | |
tree | cf9286de361ed1b0047ec0995629715778c18a3b | |
parent | 596f876267e0c719329447ea49bc262eb9ebcc1a (diff) |
Feeds: Removing all entries of a feed
-rw-r--r-- | src/feeds.c | 11 | ||||
-rw-r--r-- | src/feeds.h | 9 |
2 files changed, 16 insertions, 4 deletions
diff --git a/src/feeds.c b/src/feeds.c index 1af42477..211ee353 100644 --- a/src/feeds.c +++ b/src/feeds.c | |||
@@ -457,6 +457,17 @@ void refreshFinished_Feeds(void) { | |||
457 | stopWorker_Feeds_(&feeds_); | 457 | stopWorker_Feeds_(&feeds_); |
458 | } | 458 | } |
459 | 459 | ||
460 | void removeEntries_Feeds(uint32_t feedBookmarkId) { | ||
461 | iFeeds *d = &feeds_; | ||
462 | iForEach(Array, i, &d->entries.values) { | ||
463 | iFeedEntry **entry = i.value; | ||
464 | if ((*entry)->bookmarkId == feedBookmarkId) { | ||
465 | delete_FeedEntry(*entry); | ||
466 | remove_ArrayIterator(&i); | ||
467 | } | ||
468 | } | ||
469 | } | ||
470 | |||
460 | static int cmpTimeDescending_FeedEntryPtr_(const void *a, const void *b) { | 471 | static int cmpTimeDescending_FeedEntryPtr_(const void *a, const void *b) { |
461 | const iFeedEntry * const *e1 = a, * const *e2 = b; | 472 | const iFeedEntry * const *e1 = a, * const *e2 = b; |
462 | return -cmp_Time(&(*e1)->timestamp, &(*e2)->timestamp); | 473 | return -cmp_Time(&(*e1)->timestamp, &(*e2)->timestamp); |
diff --git a/src/feeds.h b/src/feeds.h index eb516690..5d1a47e0 100644 --- a/src/feeds.h +++ b/src/feeds.h | |||
@@ -34,11 +34,12 @@ struct Impl_FeedEntry { | |||
34 | uint32_t bookmarkId; /* note: runtime only, not a persistent ID */ | 34 | uint32_t bookmarkId; /* note: runtime only, not a persistent ID */ |
35 | }; | 35 | }; |
36 | 36 | ||
37 | void init_Feeds (const char *saveDir); | 37 | void init_Feeds (const char *saveDir); |
38 | void deinit_Feeds (void); | 38 | void deinit_Feeds (void); |
39 | void refresh_Feeds (void); | 39 | void refresh_Feeds (void); |
40 | void removeEntries_Feeds (uint32_t feedBookmarkId); | ||
40 | 41 | ||
41 | void refreshFinished_Feeds (void); /* called on "feeds.update.finished" */ | 42 | void refreshFinished_Feeds (void); /* called on "feeds.update.finished" */ |
42 | 43 | ||
43 | const iPtrArray * listEntries_Feeds (void); | 44 | const iPtrArray * listEntries_Feeds (void); |
44 | const iString * entryListPage_Feeds (void); | 45 | const iString * entryListPage_Feeds (void); |