diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-11-28 14:03:33 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-11-28 14:03:33 +0200 |
commit | 1efe2aab4fdc811c1dd37c76d1f5d37063745649 (patch) | |
tree | 410df70002df7256343a993fc91a9b1dcbb3dbca /src/feeds.c | |
parent | ab44b19cf747c348099c5aa86fcaf8bf0be628c9 (diff) |
Bookmarks: Internal tags have a dot prefix
Internal behavior tags are now written in bookmarks.ini with a dot prefix (like hidden files on Unix), and at runtime they are removed from the tags string.
This makes things more efficient as it isn't necessary to compile regular expressions all the time.
TODO: Add "Edit Feed..." into the Bookmarks context menu, and a new menu item for listing all subscriptions.
IssueID #331
Diffstat (limited to 'src/feeds.c')
-rw-r--r-- | src/feeds.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/feeds.c b/src/feeds.c index 26b3d6db..b7ce739b 100644 --- a/src/feeds.c +++ b/src/feeds.c | |||
@@ -97,8 +97,8 @@ static void init_FeedJob(iFeedJob *d, const iBookmark *bookmark) { | |||
97 | init_PtrArray(&d->results); | 97 | init_PtrArray(&d->results); |
98 | iZap(d->startTime); | 98 | iZap(d->startTime); |
99 | d->isFirstUpdate = iFalse; | 99 | d->isFirstUpdate = iFalse; |
100 | d->checkHeadings = hasTag_Bookmark(bookmark, headings_BookmarkTag); | 100 | d->checkHeadings = (bookmark->flags & headings_BookmarkFlag) != 0; |
101 | d->ignoreWeb = hasTag_Bookmark(bookmark, ignoreWeb_BookmarkTag); | 101 | d->ignoreWeb = (bookmark->flags & ignoreWeb_BookmarkFlag) != 0; |
102 | } | 102 | } |
103 | 103 | ||
104 | static void deinit_FeedJob(iFeedJob *d) { | 104 | static void deinit_FeedJob(iFeedJob *d) { |
@@ -146,13 +146,7 @@ static void submit_FeedJob_(iFeedJob *d) { | |||
146 | 146 | ||
147 | static iBool isSubscribed_(void *context, const iBookmark *bm) { | 147 | static iBool isSubscribed_(void *context, const iBookmark *bm) { |
148 | iUnused(context); | 148 | iUnused(context); |
149 | static iRegExp *pattern_ = NULL; | 149 | return (bm->flags & subscribed_BookmarkFlag) != 0; |
150 | if (!pattern_) { | ||
151 | pattern_ = new_RegExp("\\bsubscribed\\b", caseSensitive_RegExpOption); | ||
152 | } | ||
153 | iRegExpMatch m; | ||
154 | init_RegExpMatch(&m); | ||
155 | return matchString_RegExp(pattern_, &bm->tags, &m); | ||
156 | } | 150 | } |
157 | 151 | ||
158 | static const iPtrArray *listSubscriptions_(void) { | 152 | static const iPtrArray *listSubscriptions_(void) { |