mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Centralize one time migration code after updates (#7531)
There have been a couple of these this month, and keeping stuff that should only ever run once piling up in their respective module was getting ugly, especially when it's usually simple stuff (settings, files). So, move everything to a dedicated module, run by reader.lua on startup, and that will actually only do things once, when necessary.
This commit is contained in:
@@ -172,14 +172,13 @@ if Device:hasEinkScreen() then
|
||||
end
|
||||
end
|
||||
|
||||
-- Handle global settings migration
|
||||
local SettingsMigration = require("ui/data/settings_migration")
|
||||
SettingsMigration:migrateSettings(G_reader_settings)
|
||||
|
||||
-- Document renderers canvas
|
||||
local CanvasContext = require("document/canvascontext")
|
||||
CanvasContext:init(Device)
|
||||
|
||||
-- Handle one time migration stuff (settings, deprecation, ...) in case of an upgrade...
|
||||
require("ui/data/onetime_migration")
|
||||
|
||||
-- Touch screen (this may display some widget, on first install on Kobo Touch,
|
||||
-- so have it done after CanvasContext:init() but before Bidi.setup() to not
|
||||
-- have mirroring mess x/y probing).
|
||||
|
||||
Reference in New Issue
Block a user