UGLY workaround is UGLY
This commit is contained in:
parent
c230b83679
commit
e5be8db114
1 changed files with 17 additions and 1 deletions
|
@ -35,7 +35,7 @@ local require, getmetatable = require, getmetatable
|
|||
|
||||
--- LuCI UCI model library.
|
||||
-- @cstyle instance
|
||||
module("luci.model.uci")
|
||||
module "luci.model.uci"
|
||||
|
||||
--- Create a new UCI-Cursor.
|
||||
-- @class function
|
||||
|
@ -148,6 +148,22 @@ function Cursor.set_list(self, config, section, option, value)
|
|||
end
|
||||
|
||||
|
||||
Cursor._changes = Cursor.changes
|
||||
function Cursor.changes(self, config)
|
||||
if config then
|
||||
return Cursor._changes(self, config)
|
||||
else
|
||||
local changes = {}
|
||||
for k,v in pairs(require "luci.fs".dir(self:get_savedir())) do
|
||||
if v ~= "." and v ~= ".." then
|
||||
util.update(changes, Cursor._changes(self, v))
|
||||
end
|
||||
end
|
||||
return changes
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--- Add an anonymous section.
|
||||
-- @class function
|
||||
-- @name Cursor.add
|
||||
|
|
Loading…
Reference in a new issue