Purge .sdr: also remove .old backup file

Otherwise, this .old backup is used when re-opening the document,
and we could never reset docsettings.
This commit is contained in:
poire-z
2017-08-19 16:43:57 +02:00
committed by Frans de Jonge
parent 3159548f3e
commit 3cf419defa

View File

@@ -150,6 +150,9 @@ function FileManager:init()
if file_abs_path then
local autoremove_deleted_items_from_history = G_reader_settings:readSetting("autoremove_deleted_items_from_history") or false
os.remove(DocSettings:getSidecarFile(file_abs_path))
-- also remove backup, otherwise it will be used if we re-open this document
-- (it also allows for the sidecar folder to be empty and removed)
os.remove(DocSettings:getSidecarFile(file_abs_path)..".old")
-- If the sidecar folder is empty, os.remove() can
-- delete it. Otherwise, the following statement has no
-- effect.