From 96ac2bef8db938769dc47df448513641ae03adc3 Mon Sep 17 00:00:00 2001 From: Tigran Aivazian Date: Tue, 25 Sep 2012 16:54:37 +0100 Subject: [PATCH] Simplify the calling of filechooser. The FileChooser:choose() method returns only a single argument, so we can get rid of the second return value in reader.lua and simplify the code a bit. --- reader.lua | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/reader.lua b/reader.lua index f8d8639d8..b248e88d0 100755 --- a/reader.lua +++ b/reader.lua @@ -1,4 +1,4 @@ -#!./kpdfview +#!./kpdfview.emulator --[[ KindlePDFViewer: a reader implementation Copyright (C) 2011 Hans-Werner Hilse @@ -153,16 +153,11 @@ if ARGV[optind] and lfs.attributes(ARGV[optind], "mode") == "directory" then local running = true FileChooser:setPath(ARGV[optind]) while running do - local file, callback = FileChooser:choose(0, G_height) - if callback then - callback() + local file = FileChooser:choose(0, G_height) + if file then + running = openFile(file) else - if file ~= nil then - running = openFile(file) - print(file) - else - running = false - end + running = false end end elseif ARGV[optind] and lfs.attributes(ARGV[optind], "mode") == "file" then