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.
This commit is contained in:
Tigran Aivazian
2012-09-25 16:54:37 +01:00
parent 67efe2d4ca
commit 96ac2bef8d

View File

@@ -1,4 +1,4 @@
#!./kpdfview
#!./kpdfview.emulator
--[[
KindlePDFViewer: a reader implementation
Copyright (C) 2011 Hans-Werner Hilse <hilse@web.de>
@@ -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