mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Misc: Get rid of the legacy defaults.lua globals (#9546)
* This removes support for the following deprecated constants: `DTAP_ZONE_FLIPPING`, `DTAP_ZONE_BOOKMARK`, `DCREREADER_CONFIG_DEFAULT_FONT_GAMMA` * The "Advanced settings" panel now highlights modified values in bold (think about:config in Firefox ;)). * LuaData: Isolate global table lookup shenanigans, and fix a few issues in unused-in-prod codepaths. * CodeStyle: Require module locals for Lua/C modules, too. * ScreenSaver: Actually garbage collect our widget on close (ScreenSaver itself is not an instantiated object). * DateTimeWidget: Code cleanups to ensure child widgets can be GC'ed.
This commit is contained in:
@@ -19,6 +19,7 @@ local UIManager = require("ui/uimanager")
|
||||
local ffi = require("ffi")
|
||||
local C = ffi.C
|
||||
local ffiUtil = require("ffi/util")
|
||||
local lfs = require("libs/libkoreader-lfs")
|
||||
local logger = require("logger")
|
||||
local time = require("ui/time")
|
||||
local util = require("util")
|
||||
@@ -106,7 +107,7 @@ function ReaderDictionary:init()
|
||||
if self.ui then
|
||||
self.ui.menu:registerToMainMenu(self)
|
||||
end
|
||||
self.data_dir = STARDICT_DATA_DIR or
|
||||
self.data_dir = G_defaults:readSetting("STARDICT_DATA_DIR") or
|
||||
os.getenv("STARDICT_DATA_DIR") or
|
||||
DataStorage:getDataDir() .. "/data/dict"
|
||||
|
||||
@@ -1051,7 +1052,6 @@ function ReaderDictionary:downloadDictionaryPrep(dict, size)
|
||||
local dummy, filename = util.splitFilePathName(dict.url)
|
||||
local download_location = string.format("%s/%s", self.data_dir, filename)
|
||||
|
||||
local lfs = require("libs/libkoreader-lfs")
|
||||
if lfs.attributes(download_location) then
|
||||
UIManager:show(ConfirmBox:new{
|
||||
text = _("File already exists. Overwrite?"),
|
||||
|
||||
Reference in New Issue
Block a user