mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
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:
15
reader.lua
15
reader.lua
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user