Kill getDiskSizeInfo() function.

Instead of making an extra function call, packing return values in key'd
values of a table and then use two table indexing operations, just call
util.df(".") directly from FileInfo:formatDiskSizeInfo() and use its two
return values appropriately.
This commit is contained in:
Tigran Aivazian
2012-10-03 19:56:36 +01:00
parent 8308ce0218
commit f3306d5512

View File

@@ -57,17 +57,9 @@ function getUnpackedZipSize(zipfile)
return tonumber(res)
end
function getDiskSizeInfo()
local t, f = util.df(".")
return { total = t, free = f }
end
function FileInfo:formatDiskSizeInfo()
local s = getDiskSizeInfo()
if s then
return self:FormatSize(s.free)..string.format(", %.2f", 100*s.free/s.total).."%"
end
return "?"
local t, f = util.df(".")
return self:FormatSize(f)..string.format(", %.2f", 100*f/t).."%"
end
function FileInfo:getFolderContent()