mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Minor code quality improvements (#10905)
This commit is contained in:
@@ -287,12 +287,12 @@ function ReaderSearch:onShowSearchDialog(text, direction, regex, case_insensitiv
|
||||
self.wait_button.movable:setMovedOffset(self.search_dialog.movable:getMovedOffset())
|
||||
UIManager:show(self.wait_button)
|
||||
UIManager:tickAfterNext(function()
|
||||
do_search(func, pattern, param, regex, case_insensitive)()
|
||||
do_search(func, pattern, param)()
|
||||
UIManager:close(self.wait_button)
|
||||
end)
|
||||
end
|
||||
else
|
||||
return do_search(func, pattern, param, regex, case_insensitive)
|
||||
return do_search(func, pattern, param)
|
||||
end
|
||||
end
|
||||
self.search_dialog = ButtonDialog:new{
|
||||
@@ -342,14 +342,14 @@ function ReaderSearch:onShowSearchDialog(text, direction, regex, case_insensitiv
|
||||
-- initial position: center of the screen
|
||||
UIManager:show(self.wait_button)
|
||||
UIManager:tickAfterNext(function()
|
||||
do_search(self.searchFromCurrent, text, direction, regex, case_insensitive)()
|
||||
do_search(self.searchFromCurrent, text, direction)()
|
||||
UIManager:close(self.wait_button)
|
||||
UIManager:show(self.search_dialog)
|
||||
--- @todo regional
|
||||
UIManager:setDirty(self.dialog, "partial")
|
||||
end)
|
||||
else
|
||||
do_search(self.searchFromCurrent, text, direction, regex, case_insensitive)()
|
||||
do_search(self.searchFromCurrent, text, direction)()
|
||||
UIManager:show(self.search_dialog)
|
||||
--- @todo regional
|
||||
UIManager:setDirty(self.dialog, "partial")
|
||||
|
||||
@@ -38,7 +38,7 @@ local function computeCacheSlots()
|
||||
|
||||
--- ...otherwise, effectively disable the cache by making it single slot...
|
||||
if mb_size < 8 then
|
||||
logger.dbg(string.format("Setting up a minimal single slot global document cache"))
|
||||
logger.dbg("Setting up a minimal single slot global document cache")
|
||||
return 1
|
||||
else
|
||||
return nil
|
||||
|
||||
@@ -369,7 +369,7 @@ end
|
||||
|
||||
function FocusManager:_verticalStep(dy)
|
||||
local x = self.selected.x
|
||||
if type(self.layout[self.selected.y + dy]) ~= "table" or self.layout[self.selected.y + dy] == {} then
|
||||
if type(self.layout[self.selected.y + dy]) ~= "table" or next(self.layout[self.selected.y + dy]) == nil then
|
||||
logger.err("[FocusManager] : Malformed layout")
|
||||
return false
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user