summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-01-29 18:46:56 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-01-29 18:46:56 +0200
commit0fe58c59f393473b8b9a56c647e84c27051964f5 (patch)
tree825fb741d898c9500ecfa3eba5257c1b938ee00a
parent16a8b555456fbf32a0f634bef0956f4e91f70c50 (diff)
Allow importing remote bookmarks
Importing bookmarks should be allowed to create local copies of remote bookmarks, so that one can add any locally missing bookmarks from a shared remote source.
-rw-r--r--src/ui/documentwidget.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 68f3c966..87a55dcb 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -2005,8 +2005,14 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd)
2005 /* Find links that aren't already bookmarked. */ 2005 /* Find links that aren't already bookmarked. */
2006 iForEach(PtrArray, i, links) { 2006 iForEach(PtrArray, i, links) {
2007 const iGmRun *run = i.ptr; 2007 const iGmRun *run = i.ptr;
2008 if (findUrl_Bookmarks(bookmarks_App(), linkUrl_GmDocument(d->doc, run->linkId))) { 2008 uint32_t bmid;
2009 remove_PtrArrayIterator(&i); 2009 if ((bmid = findUrl_Bookmarks(bookmarks_App(),
2010 linkUrl_GmDocument(d->doc, run->linkId))) != 0) {
2011 const iBookmark *bm = get_Bookmarks(bookmarks_App(), bmid);
2012 /* We can import local copies of remote bookmarks. */
2013 if (!hasTag_Bookmark(bm, "remote")) {
2014 remove_PtrArrayIterator(&i);
2015 }
2010 } 2016 }
2011 } 2017 }
2012 if (!isEmpty_PtrArray(links)) { 2018 if (!isEmpty_PtrArray(links)) {