From 81c6dc5997ace222dd5266af924da099247bf488 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Fri, 13 Apr 2012 20:46:10 +0200 Subject: [PATCH 1/5] commands.map is very large, impacts startup performance on device --- unireader.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unireader.lua b/unireader.lua index 47125b968..86b2cfbbc 100644 --- a/unireader.lua +++ b/unireader.lua @@ -2021,5 +2021,6 @@ function UniReader:addAllCommands() unireader:goto(unireader.pageno) end ) - print("## defined commands "..dump(self.commands.map)) + -- commands.map is very large, impacts startup performance on device + --print("## defined commands "..dump(self.commands.map)) end From ffa663d37d98caeeb4a3d63b75465854dd38f002 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Fri, 13 Apr 2012 20:52:30 +0200 Subject: [PATCH 2/5] added few more keys to inputbox --- inputbox.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/inputbox.lua b/inputbox.lua index ed581899b..1ceea8a0a 100644 --- a/inputbox.lua +++ b/inputbox.lua @@ -208,6 +208,11 @@ function InputBox:addAllCommands() {KEY_1, "1"}, {KEY_2, "2"}, {KEY_3, "3"}, {KEY_4, "4"}, {KEY_5, "5"}, {KEY_6, "6"}, {KEY_7, "7"}, {KEY_8, "8"}, {KEY_9, "9"}, {KEY_0, "0"}, + + {KEY_SPACE, " "}, + + -- DXG keys + {KEY_DOT, "."}, {KEY_SLASH, "/"}, } for k,v in ipairs(INPUT_KEYS) do self.commands:add(v[1], nil, "", From a65090025c1184ba874cc2664445d81cfb44253a Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Fri, 13 Apr 2012 23:53:36 +0200 Subject: [PATCH 3/5] display crash.log on error --- launchpad/kpdf.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launchpad/kpdf.sh b/launchpad/kpdf.sh index a2b714b75..5c0611f2e 100755 --- a/launchpad/kpdf.sh +++ b/launchpad/kpdf.sh @@ -8,7 +8,7 @@ cd /mnt/us/kindlepdfviewer/ grep /mnt/us/kindlepdfviewer/fonts/host /proc/mounts || mount -o bind /usr/java/lib/fonts /mnt/us/kindlepdfviewer/fonts/host -./reader.lua "$1" 2> /mnt/us/kindlepdfviewer/crash.log +./reader.lua "$1" 2> /mnt/us/kindlepdfviewer/crash.log || cat /mnt/us/kindlepdfviewer/crash.log grep /mnt/us/kindlepdfviewer/fonts/host /proc/mounts && umount /mnt/us/kindlepdfviewer/fonts/host From 56ddad6a38872395a7eaa4a19b0d0f1c0e9a54d1 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Fri, 13 Apr 2012 23:54:06 +0200 Subject: [PATCH 4/5] remove page:getPageText debug dump to improve performance on device --- pdfreader.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdfreader.lua b/pdfreader.lua index c6d55d9ad..4c2772104 100644 --- a/pdfreader.lua +++ b/pdfreader.lua @@ -41,7 +41,7 @@ function PDFReader:getText(pageno) return nil end local text = page:getPageText() - print(dump(text)) + --print("## page:getPageText "..dump(text)) -- performance impact on device page:close() return text end From b6d167f8ca3d068e2e90fb95a9acc3ad88348338 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Fri, 13 Apr 2012 23:54:06 +0200 Subject: [PATCH 5/5] remove page:getPageText debug dump to improve performance on device And leave it in unireader if we can't find text on page --- pdfreader.lua | 2 +- unireader.lua | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pdfreader.lua b/pdfreader.lua index c6d55d9ad..4c2772104 100644 --- a/pdfreader.lua +++ b/pdfreader.lua @@ -41,7 +41,7 @@ function PDFReader:getText(pageno) return nil end local text = page:getPageText() - print(dump(text)) + --print("## page:getPageText "..dump(text)) -- performance impact on device page:close() return text end diff --git a/unireader.lua b/unireader.lua index 86b2cfbbc..3026bcb2a 100644 --- a/unireader.lua +++ b/unireader.lua @@ -342,6 +342,8 @@ function UniReader:startHighLightMode() end end + print("## _findFirstWordInView none found in "..dump(t)) + return nil end