loading KoptInterface only in pdf and djvu reader

This will save 4MB RAM in crereader which otherwise will load
liblept.so.3 and libk2pdfopt.so.2 automatically for nothing.
This commit is contained in:
chrox
2014-01-22 18:34:41 +08:00
parent 98f1c90d87
commit 8abd8a8a1f
2 changed files with 6 additions and 6 deletions

View File

@@ -2,7 +2,6 @@ local Geom = require("ui/geometry")
local Cache = require("cache")
local CacheItem = require("cacheitem")
local KoptOptions = require("ui/data/koptoptions")
local KoptInterface = require("document/koptinterface")
local Document = require("document/document")
local Configurable = require("ui/reader/configurable")
local DrawContext = require("ffi/drawcontext")
@@ -13,7 +12,7 @@ local DjvuDocument = Document:new{
djvulibre_cache_size = nil,
dc_null = DrawContext.new(),
options = KoptOptions,
koptinterface = KoptInterface,
koptinterface = nil,
}
-- check DjVu magic string to validate
@@ -27,7 +26,8 @@ local function validDjvuFile(filename)
end
function DjvuDocument:init()
require "libs/libkoreader-djvu"
local djvu = require("libs/libkoreader-djvu")
self.koptinterface = require("document/koptinterface")
self.configurable:loadDefaults(self.options)
if not validDjvuFile(self.file) then
self.error_message = "Not a valid DjVu file"