Pocketbook misc fixes (#6633)

After the awesome work made by @ezdiy:

- Remove empty dir from release zip
- Remove misc files (txt, md, html, gif) to prevent displaying them in PB library
- Do not asociate executable files (sh and py for the moment), just openable files
- Rename the font sample from html to template (to prevent wiping it during clean)
reviewable/pr6646/r1
Martín Fernández 4 years ago committed by GitHub
parent c28f1b3450
commit 2263931b99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -250,14 +250,15 @@ pbupdate: all
file $(INSTALL_DIR)/koreader/luajit | grep ARM || exit 1
# remove old package if any
rm -f $(PB_PACKAGE)
# Pocketbook launching script
# Pocketbook launching scripts
mkdir -p $(INSTALL_DIR)/applications
mkdir -p $(INSTALL_DIR)/system/bin
mkdir -p $(INSTALL_DIR)/system/config
cp $(POCKETBOOK_DIR)/koreader.app $(INSTALL_DIR)/applications
cp $(POCKETBOOK_DIR)/koreader.app $(INSTALL_DIR)/system/bin
cp -rfL $(INSTALL_DIR)/koreader $(INSTALL_DIR)/applications
find $(INSTALL_DIR)/applications/koreader \
-type f \( -name "*.gif" -o -name "*.html" -o -name "*.md" -o -name "*.txt" \) \
-exec rm -vf {} \;
# create new package
cd $(INSTALL_DIR) && \
zip -9 -r \

@ -397,7 +397,7 @@ If that font happens to be part of this list already, it will be used first.]]),
end
-- Default sample file
local FONT_TEST_DEFAULT_SAMPLE_PATH = "frontend/ui/elements/font-test-sample-default.html"
local FONT_TEST_DEFAULT_SAMPLE_PATH = "frontend/ui/elements/font-test-sample-default.template"
-- Users can set their own sample file, that will be used if found
local FONT_TEST_USER_SAMPLE_PATH = require("datastorage"):getSettingsDir() .. "/font-test-sample.html"
-- This document will be generated in the home or default directory

@ -1,7 +1,13 @@
local Device = require("device")
local DocumentRegistry = require("document/documentregistry")
local _ = require("gettext")
local function getSupportedExtensions()
local t = require("document/documentregistry"):getExtensions()
t["sh"] = nil
t["py"] = nil
return t
end
local ExtAssoc = {
assoc = G_reader_settings:readSetting("file_ext_assoc") or {},
}
@ -10,14 +16,14 @@ function ExtAssoc:commit()
G_reader_settings:saveSetting("file_ext_assoc", self.assoc):flush()
-- Translate the boolean map back to map of providers the OS backend can inquire further
local t = {}
for k, v in pairs(DocumentRegistry:getExtensions()) do
for k, v in pairs(getSupportedExtensions()) do
if self.assoc[k] then t[k] = v end
end
Device:associateFileExtensions(t)
end
function ExtAssoc:setAll(state)
for k, dummy in pairs(DocumentRegistry:getExtensions()) do
for k, dummy in pairs(getSupportedExtensions()) do
self:setOne(k, state)
end
self:commit()
@ -47,7 +53,7 @@ function ExtAssoc:getSettingsMenuTable()
separator = true,
},
}
local exts = DocumentRegistry:getExtensions()
local exts = getSupportedExtensions()
local keys = {}
for k, dummy in pairs(exts) do
table.insert(keys, k)

Loading…
Cancel
Save