From f3ac95321bb74e29bcac8dd33b91bb993ec93bee Mon Sep 17 00:00:00 2001 From: Andrej Shadura Date: Sun, 30 Jan 2022 22:01:28 +0100 Subject: [PATCH] PocketBook: make canAssociateFileExtensions always return true (#8729) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change drops the #koreader signature check. This check prevents KOReader from modifying associations if something else has changed the file without putting a verbatim "#koreader" string back. While this prevents KOReader from interfering with another application or the system trying to own the file, it also leads to hard to diagnose issues, when the user can inadvertently change associations without realising they’re doing so, and being unable to return back. --- frontend/device/pocketbook/device.lua | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/frontend/device/pocketbook/device.lua b/frontend/device/pocketbook/device.lua index f7e142fba..85b689870 100644 --- a/frontend/device/pocketbook/device.lua +++ b/frontend/device/pocketbook/device.lua @@ -34,6 +34,7 @@ local PocketBook = Generic:new{ canPowerOff = yes, needsScreenRefreshAfterResume = no, home_dir = "/mnt/ext1", + canAssociateFileExtensions = yes, -- all devices that have warmth lights use inkview api hasNaturalLightApi = yes, @@ -286,18 +287,6 @@ function PocketBook:setDateTime(year, month, day, hour, min, sec) end end --- Predicate, so no self -function PocketBook.canAssociateFileExtensions() - local f = io.open(ext_path, "r") - if not f then return true end - local l = f:read("*line") - f:close() - if l and not l:match("^#koreader") then - return false - end - return true -end - function PocketBook:associateFileExtensions(assoc) -- First load the system-wide table, from which we'll snoop file types and icons local info = {}