2
0
mirror of https://github.com/koreader/koreader synced 2024-11-04 12:00:25 +00:00

update dictionary backend name in kpvbooklet

This commit is contained in:
chrox 2013-04-27 13:30:25 +08:00
parent b53069509a
commit d18b58036f

View File

@ -8,6 +8,7 @@ function ReaderDictionary:init()
if dev_mod == "KindlePaperWhite" or dev_mod == "KindleTouch" then if dev_mod == "KindlePaperWhite" or dev_mod == "KindleTouch" then
require("liblipclua") require("liblipclua")
JSON = require("JSON") JSON = require("JSON")
DEBUG("init lipc handler com.github.koreader.dictionary")
self.lipc_handle = lipc.init("com.github.koreader.dictionary") self.lipc_handle = lipc.init("com.github.koreader.dictionary")
end end
end end
@ -17,13 +18,13 @@ function ReaderDictionary:onLookupWord(word)
--self:quickLookup() --self:quickLookup()
if self.lipc_handle and JSON and word then if self.lipc_handle and JSON and word then
self.lipc_handle:set_string_property( self.lipc_handle:set_string_property(
"com.lab126.booklet.kpvbooklet.dict", "lookup", word) "com.github.koreader.kpvbooklet.dict", "lookup", word)
local results_str = self.lipc_handle:get_string_property( local results_str = self.lipc_handle:get_string_property(
"com.lab126.booklet.kpvbooklet.word", word) "com.github.koreader.kpvbooklet.word", word)
if results_str then if results_str then
--DEBUG("def str:", word, definitions) --DEBUG("def str:", word, definitions)
local ok, results_tab = pcall(JSON.decode, JSON, results_str) local ok, results_tab = pcall(JSON.decode, JSON, results_str)
--DEBUG("lookup result table:", word, results_tab) DEBUG("lookup result table:", word, results_tab)
if results_tab[1] then if results_tab[1] then
self:quickLookup(results_tab[1]) self:quickLookup(results_tab[1])
end end