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/ui/util.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/ui/util.c')
-rw-r--r-- | src/ui/util.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/ui/util.c b/src/ui/util.c index baa05082..6f5eced3 100644 --- a/src/ui/util.c +++ b/src/ui/util.c | |||
@@ -2908,16 +2908,16 @@ static iBool handleBookmarkCreationCommands_SidebarWidget_(iWidget *editor, cons | |||
2908 | const uint32_t id = add_Bookmarks(bookmarks_App(), url, title, tags, first_String(icon)); | 2908 | const uint32_t id = add_Bookmarks(bookmarks_App(), url, title, tags, first_String(icon)); |
2909 | iBookmark * bm = get_Bookmarks(bookmarks_App(), id); | 2909 | iBookmark * bm = get_Bookmarks(bookmarks_App(), id); |
2910 | if (!isEmpty_String(icon)) { | 2910 | if (!isEmpty_String(icon)) { |
2911 | addTagIfMissing_Bookmark(bm, userIcon_BookmarkTag); | 2911 | bm->flags |= userIcon_BookmarkFlag; |
2912 | } | 2912 | } |
2913 | if (isSelected_Widget(findChild_Widget(editor, "bmed.tag.home"))) { | 2913 | if (isSelected_Widget(findChild_Widget(editor, "bmed.tag.home"))) { |
2914 | addTag_Bookmark(bm, homepage_BookmarkTag); | 2914 | bm->flags |= homepage_BookmarkFlag; |
2915 | } | 2915 | } |
2916 | if (isSelected_Widget(findChild_Widget(editor, "bmed.tag.remote"))) { | 2916 | if (isSelected_Widget(findChild_Widget(editor, "bmed.tag.remote"))) { |
2917 | addTag_Bookmark(bm, remoteSource_BookmarkTag); | 2917 | bm->flags |= remoteSource_BookmarkFlag; |
2918 | } | 2918 | } |
2919 | if (isSelected_Widget(findChild_Widget(editor, "bmed.tag.linksplit"))) { | 2919 | if (isSelected_Widget(findChild_Widget(editor, "bmed.tag.linksplit"))) { |
2920 | addTag_Bookmark(bm, linkSplit_BookmarkTag); | 2920 | bm->flags |= linkSplit_BookmarkFlag; |
2921 | } | 2921 | } |
2922 | bm->parentId = folder ? id_Bookmark(folder) : 0; | 2922 | bm->parentId = folder ? id_Bookmark(folder) : 0; |
2923 | setRecentFolder_Bookmarks(bookmarks_App(), bm->parentId); | 2923 | setRecentFolder_Bookmarks(bookmarks_App(), bm->parentId); |
@@ -2983,9 +2983,9 @@ static iBool handleFeedSettingCommands_(iWidget *dlg, const char *cmd) { | |||
2983 | iBookmark *bm = get_Bookmarks(bookmarks_App(), id); | 2983 | iBookmark *bm = get_Bookmarks(bookmarks_App(), id); |
2984 | iAssert(bm); | 2984 | iAssert(bm); |
2985 | set_String(&bm->title, feedTitle); | 2985 | set_String(&bm->title, feedTitle); |
2986 | addOrRemoveTag_Bookmark(bm, subscribed_BookmarkTag, iTrue); | 2986 | bm->flags |= subscribed_BookmarkFlag; |
2987 | addOrRemoveTag_Bookmark(bm, headings_BookmarkTag, headings); | 2987 | iChangeFlags(bm->flags, headings_BookmarkFlag, headings); |
2988 | addOrRemoveTag_Bookmark(bm, ignoreWeb_BookmarkTag, ignoreWeb); | 2988 | iChangeFlags(bm->flags, ignoreWeb_BookmarkFlag, ignoreWeb); |
2989 | postCommand_App("bookmarks.changed"); | 2989 | postCommand_App("bookmarks.changed"); |
2990 | setupSheetTransition_Mobile(dlg, iFalse); | 2990 | setupSheetTransition_Mobile(dlg, iFalse); |
2991 | destroy_Widget(dlg); | 2991 | destroy_Widget(dlg); |
@@ -3048,13 +3048,13 @@ iWidget *makeFeedSettings_Widget(uint32_t bookmarkId) { | |||
3048 | setText_InputWidget(findChild_Widget(dlg, "feedcfg.title"), | 3048 | setText_InputWidget(findChild_Widget(dlg, "feedcfg.title"), |
3049 | bm ? &bm->title : feedTitle_DocumentWidget(document_App())); | 3049 | bm ? &bm->title : feedTitle_DocumentWidget(document_App())); |
3050 | setFlags_Widget(findChild_Widget(dlg, | 3050 | setFlags_Widget(findChild_Widget(dlg, |
3051 | hasTag_Bookmark(bm, headings_BookmarkTag) | 3051 | bm->flags & headings_BookmarkFlag |
3052 | ? "feedcfg.type.headings" | 3052 | ? "feedcfg.type.headings" |
3053 | : "feedcfg.type.gemini"), | 3053 | : "feedcfg.type.gemini"), |
3054 | selected_WidgetFlag, | 3054 | selected_WidgetFlag, |
3055 | iTrue); | 3055 | iTrue); |
3056 | setToggle_Widget(findChild_Widget(dlg, "feedcfg.ignoreweb"), | 3056 | setToggle_Widget(findChild_Widget(dlg, "feedcfg.ignoreweb"), |
3057 | hasTag_Bookmark(bm, ignoreWeb_BookmarkTag)); | 3057 | bm->flags & ignoreWeb_BookmarkFlag); |
3058 | setCommandHandler_Widget(dlg, handleFeedSettingCommands_); | 3058 | setCommandHandler_Widget(dlg, handleFeedSettingCommands_); |
3059 | } | 3059 | } |
3060 | setupSheetTransition_Mobile(dlg, incoming_TransitionFlag); | 3060 | setupSheetTransition_Mobile(dlg, incoming_TransitionFlag); |