mirror of
https://github.com/koreader/koreader.git
synced 2025-12-18 12:02:09 +01:00
use conventional util name and update koreader-base
This commit is contained in:
@@ -9,7 +9,7 @@ local Screen = require("ui/screen")
|
|||||||
local _ = require("gettext")
|
local _ = require("gettext")
|
||||||
local Font = require("ui/font")
|
local Font = require("ui/font")
|
||||||
local UIToolbox = require("ui/uitoolbox")
|
local UIToolbox = require("ui/uitoolbox")
|
||||||
local Util = require("ffi/util")
|
local util = require("ffi/util")
|
||||||
|
|
||||||
local calibre = "metadata.calibre"
|
local calibre = "metadata.calibre"
|
||||||
local koreaderfile = "temp/metadata.koreader"
|
local koreaderfile = "temp/metadata.koreader"
|
||||||
@@ -240,7 +240,7 @@ function Search:find(option)
|
|||||||
s=string.sub(s,n,string.len(s)-j)
|
s=string.sub(s,n,string.len(s)-j)
|
||||||
end
|
end
|
||||||
|
|
||||||
s=string.gsub(s,"\\u([a-f0-9][a-f0-9][a-f0-9][a-f0-9])",function(w) return Util.unichar(tonumber(w, 16)) end)
|
s=string.gsub(s,"\\u([a-f0-9][a-f0-9][a-f0-9][a-f0-9])",function(w) return util.unichar(tonumber(w, 16)) end)
|
||||||
|
|
||||||
return s
|
return s
|
||||||
end
|
end
|
||||||
@@ -568,7 +568,7 @@ function Search:browse(option,run,chosen)
|
|||||||
if run == 1 then
|
if run == 1 then
|
||||||
self.results = {}
|
self.results = {}
|
||||||
if option == "series" then
|
if option == "series" then
|
||||||
for v,n in Util.orderedPairs(self.browse_series) do
|
for v,n in util.orderedPairs(self.browse_series) do
|
||||||
dummy = v
|
dummy = v
|
||||||
if not SEARCH_CASESENSITIVE then dummy = string.upper(dummy) end
|
if not SEARCH_CASESENSITIVE then dummy = string.upper(dummy) end
|
||||||
if string.find(dummy,upsearch,nil,true) then
|
if string.find(dummy,upsearch,nil,true) then
|
||||||
@@ -581,7 +581,7 @@ function Search:browse(option,run,chosen)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
for v,n in Util.orderedPairs(self.browse_tags) do
|
for v,n in util.orderedPairs(self.browse_tags) do
|
||||||
dummy = v
|
dummy = v
|
||||||
if not SEARCH_CASESENSITIVE then dummy = string.upper(dummy) end
|
if not SEARCH_CASESENSITIVE then dummy = string.upper(dummy) end
|
||||||
if string.find(dummy,upsearch,nil,true) then
|
if string.find(dummy,upsearch,nil,true) then
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ local CenterContainer = require("ui/widget/container/centercontainer")
|
|||||||
local Screen = require("ui/screen")
|
local Screen = require("ui/screen")
|
||||||
local Menu = require("ui/widget/menu")
|
local Menu = require("ui/widget/menu")
|
||||||
local Font = require("ui/font")
|
local Font = require("ui/font")
|
||||||
local Util = require("ffi/util")
|
local util = require("ffi/util")
|
||||||
|
|
||||||
local SetDefaults = InputContainer:new{
|
local SetDefaults = InputContainer:new{
|
||||||
defaults_name = {},
|
defaults_name = {},
|
||||||
@@ -62,7 +62,7 @@ function SetDefaults:init()
|
|||||||
|
|
||||||
if not self.already_read then
|
if not self.already_read then
|
||||||
local i = 0
|
local i = 0
|
||||||
for n,v in Util.orderedPairs(_G) do
|
for n,v in util.orderedPairs(_G) do
|
||||||
if (not string.find(tostring(v), "<")) and (not string.find(tostring(v), ": ")) and string.sub(n,1,1) ~= "_" and string.upper(n) == n and n ~= "LIBRARY_PATH" then
|
if (not string.find(tostring(v), "<")) and (not string.find(tostring(v), ": ")) and string.sub(n,1,1) ~= "_" and string.upper(n) == n and n ~= "LIBRARY_PATH" then
|
||||||
i = i + 1
|
i = i + 1
|
||||||
self.defaults_name[i] = n
|
self.defaults_name[i] = n
|
||||||
@@ -177,7 +177,7 @@ function SetDefaults:init()
|
|||||||
_G[self.defaults_name[i]] = MultiInputDialog:getCredential()
|
_G[self.defaults_name[i]] = MultiInputDialog:getCredential()
|
||||||
|
|
||||||
self.defaults_value[i] = "{"
|
self.defaults_value[i] = "{"
|
||||||
for k,v in Util.orderedPairs(_G[self.defaults_name[i]]) do
|
for k,v in util.orderedPairs(_G[self.defaults_name[i]]) do
|
||||||
if tonumber(k) then
|
if tonumber(k) then
|
||||||
self.defaults_value[i] = self.defaults_value[i] .. v .. ", "
|
self.defaults_value[i] = self.defaults_value[i] .. v .. ", "
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ local Geom = require("ui/geometry")
|
|||||||
local Screen = require("ui/screen")
|
local Screen = require("ui/screen")
|
||||||
local DEBUG = require("dbg")
|
local DEBUG = require("dbg")
|
||||||
local _ = require("gettext")
|
local _ = require("gettext")
|
||||||
local Util = require("ffi/util")
|
local util = require("ffi/util")
|
||||||
|
|
||||||
local InfoMessage = require("ui/widget/infomessage")
|
local InfoMessage = require("ui/widget/infomessage")
|
||||||
local input_field
|
local input_field
|
||||||
@@ -32,7 +32,7 @@ function MultiInputDialog:init()
|
|||||||
|
|
||||||
input_field = {}
|
input_field = {}
|
||||||
local k = 0
|
local k = 0
|
||||||
for i,j in Util.orderedPairs(self.field) do
|
for i,j in util.orderedPairs(self.field) do
|
||||||
k = k + 1
|
k = k + 1
|
||||||
input_field[k] = InputText:new{
|
input_field[k] = InputText:new{
|
||||||
text = tostring(i) .. " = " .. tostring(j),
|
text = tostring(i) .. " = " .. tostring(j),
|
||||||
|
|||||||
Submodule koreader-base updated: 77654ebd37...446aa93145
Reference in New Issue
Block a user