From bc272265912a1c521b37959b9ce7822c21d95c22 Mon Sep 17 00:00:00 2001 From: hius07 <62179190+hius07@users.noreply.github.com> Date: Sun, 17 Mar 2024 12:42:01 +0200 Subject: [PATCH] readerbookmark: use ReaderAnnotations for read/save --- .../apps/reader/modules/readerbookmark.lua | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/frontend/apps/reader/modules/readerbookmark.lua b/frontend/apps/reader/modules/readerbookmark.lua index 216537047..262a2bf01 100644 --- a/frontend/apps/reader/modules/readerbookmark.lua +++ b/frontend/apps/reader/modules/readerbookmark.lua @@ -340,31 +340,6 @@ function ReaderBookmark:updateHighlightsIfNeeded(config) end function ReaderBookmark:onReadSettings(config) - self.bookmarks = config:readSetting("bookmarks", {}) - -- Bookmark formats in crengine and mupdf are incompatible. - -- Backup bookmarks when the document is opened with incompatible engine. - if #self.bookmarks > 0 then - local bookmarks_type = type(self.bookmarks[1].page) - if self.ui.rolling and bookmarks_type == "number" then - config:saveSetting("bookmarks_paging", self.bookmarks) - self.bookmarks = config:readSetting("bookmarks_rolling", {}) - config:saveSetting("bookmarks", self.bookmarks) - config:delSetting("bookmarks_rolling") - elseif self.ui.paging and bookmarks_type == "string" then - config:saveSetting("bookmarks_rolling", self.bookmarks) - self.bookmarks = config:readSetting("bookmarks_paging", {}) - config:saveSetting("bookmarks", self.bookmarks) - config:delSetting("bookmarks_paging") - end - else - if self.ui.rolling and config:has("bookmarks_rolling") then - self.bookmarks = config:readSetting("bookmarks_rolling") - config:delSetting("bookmarks_rolling") - elseif self.ui.paging and config:has("bookmarks_paging") then - self.bookmarks = config:readSetting("bookmarks_paging") - config:delSetting("bookmarks_paging") - end - end -- need to do this after initialization because checking xpointer -- may cause segfaults before credocuments are inited. self.ui:registerPostInitCallback(function() @@ -375,7 +350,6 @@ function ReaderBookmark:onReadSettings(config) end function ReaderBookmark:onSaveSettings() - self.ui.doc_settings:saveSetting("bookmarks", self.bookmarks) self.ui.doc_settings:saveSetting("bookmarks_version", 20200615) self.ui.doc_settings:makeTrue("bookmarks_sorted_20220106") self.ui.doc_settings:makeTrue("highlights_imported")