Fix to the makesingleton function.

This commit is contained in:
BenDol 2014-04-01 17:22:00 +13:00
parent 994f49b3c1
commit 4b24c78f0f
2 changed files with 3 additions and 47 deletions

View File

@ -1,47 +1,3 @@
local config = g_configs.getSettings() g_settings = makesingleton(g_configs.getSettings())
g_settings = makesingleton(config) -- Reserved for future functionality
function g_settings.set(key, value)
config:set(key, value)
end
function g_settings.setDefault(key, value)
return config:setDefault(key, value)
end
function g_settings.get(key, default)
return config:get(key, default)
end
function g_settings.getString(key, default)
return config:getString(key, default)
end
function g_settings.getInteger(key, default)
return config:getInteger(key, default)
end
function g_settings.getNumber(key, default)
return config:getNumber(key, default)
end
function g_settings.getBoolean(key, default)
return config:getBoolean(key, default)
end
function g_settings.getPoint(key, default)
return config:getPoint(key, default)
end
function g_settings.getRect(key, default)
return config:getRect(key, default)
end
function g_settings.getSize(key, default)
return config:getSize(key, default)
end
function g_settings.getColor(key, default)
return config:getColor(key, default)
end

View File

@ -337,7 +337,7 @@ function makesingleton(obj)
if obj.getClassName then if obj.getClassName then
for key,value in pairs(_G[obj:getClassName()]) do for key,value in pairs(_G[obj:getClassName()]) do
if type(value) == 'function' then if type(value) == 'function' then
singleton[key] = function(...) value(obj, ...) end singleton[key] = function(...) return value(obj, ...) end
end end
end end
end end