From 09401b9a860e29c8401936a08468f400f31223e3 Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Wed, 7 Mar 2012 12:15:44 +0000 Subject: Bugfix on viewing logfiles. Now acf tries to figure out if a logfile is specified in the configfile --- vlc-model.lua | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'vlc-model.lua') diff --git a/vlc-model.lua b/vlc-model.lua index d2fe0cb..3e6e5f3 100644 --- a/vlc-model.lua +++ b/vlc-model.lua @@ -38,26 +38,16 @@ function getconfigfile() return modelfunctions.getfiledetails(configfile) end -get_filedetails = function (path) +function get_filedetails() local path=logfile - for line in string.gmatch(fs.read_file(configfile), "(.-)\n") do - path=string.match(line,"^VLC_OPTS.*%-%-logfile%s+(%S+)") or path - end - - - local file = path - local st = fs.stat(path) - if st and st.type then - while st.type == "link" do - st = fs.stat(posix.readlink(st.path)) + local path2 + if fs.is_file(configfile) then + for line in string.gmatch(fs.read_file(configfile) or "", "(.-)\n") do + path2=string.match(line,"^VLC_OPTS.*--logfile%s+(%S+)") or path2 end - file = st.path end - - local filedetails = modelfunctions.getfiledetails(file) - filedetails.value.filename.value = path - - return filedetails + if path2 then path=path2 end + return modelfunctions.getfiledetails(path) end function setconfigfile(filedetails) -- cgit v1.2.3