From e5c859059da1c893a46cd4811a89d63f314d556f Mon Sep 17 00:00:00 2001 From: Tigran Aivazian Date: Wed, 19 Sep 2012 23:34:16 +0100 Subject: [PATCH 1/3] Fix for the crash when deleting highlights, see issue #295. --- unireader.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/unireader.lua b/unireader.lua index 844e38825..ba3ed8342 100644 --- a/unireader.lua +++ b/unireader.lua @@ -1958,7 +1958,6 @@ function UniReader:showHighLight() if #self.highlight[hpage] == 0 then table.remove(self.highlight, hpage) end - table.remove(highlight_page, item_no) table.remove(menu_items, item_no) if #menu_items == 0 then return self:redrawCurrentPage() From b8e29b77bc151568cbd82d75ce638adccf40e1d5 Mon Sep 17 00:00:00 2001 From: Tigran Aivazian Date: Thu, 20 Sep 2012 00:06:08 +0100 Subject: [PATCH 2/3] File Info tidy up: 1. Fix the "Created" field in file info to say "Status changed" as the ctime has nothing to do with creation of a file but with the time of the last modification to its inode (e.g. owner, group, link count, mode, etc.) 2. Added the field "Accessed" which shows the atime. --- fileinfo.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fileinfo.lua b/fileinfo.lua index aadb2c20e..d3507f214 100644 --- a/fileinfo.lua +++ b/fileinfo.lua @@ -73,10 +73,12 @@ function FileInfo:init(path, fname) info_entry = {dir = "Free space", name = FileInfo:FormatSize(util.df("."))} table.insert(self.result, info_entry) - info_entry = {dir = "Created", name = FileInfo:FileCreated(self.pathfile, "change")} + info_entry = {dir = "Status changed", name = FileInfo:FileCreated(self.pathfile, "change")} table.insert(self.result, info_entry) info_entry = {dir = "Modified", name = FileInfo:FileCreated(self.pathfile, "modification")} table.insert(self.result, info_entry) + info_entry = {dir = "Accessed", name = FileInfo:FileCreated(self.pathfile, "access")} + table.insert(self.result, info_entry) -- if the document was already opened local history = DocToHistory(self.pathfile) From b3f8ddf67db04fb98cf3a692abe8557f4915ec84 Mon Sep 17 00:00:00 2001 From: Tigran Aivazian Date: Thu, 20 Sep 2012 00:08:59 +0100 Subject: [PATCH 3/3] Be consistent with the case: "Last Read" -> "Last read". --- fileinfo.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fileinfo.lua b/fileinfo.lua index d3507f214..673862a37 100644 --- a/fileinfo.lua +++ b/fileinfo.lua @@ -84,10 +84,10 @@ function FileInfo:init(path, fname) local history = DocToHistory(self.pathfile) local file, msg = io.open(history, "r") if not file then - info_entry = {dir = "Last Read", name = "Never"} + info_entry = {dir = "Last read", name = "Never"} table.insert(self.result, info_entry) else - info_entry = {dir = "Last Read", name = FileInfo:FileCreated(history, "change")} + info_entry = {dir = "Last read", name = FileInfo:FileCreated(history, "change")} table.insert(self.result, info_entry) local file_type = string.lower(string.match(self.pathfile, ".+%.([^.]+)")) local to_search, add, factor = "[\"last_percent\"]", "%", 100