From eadf0c93e1448197178ef71ddba8e1e8f64683ae Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Fri, 25 Sep 2009 21:16:55 +0200 Subject: Caching is controlled by users --- init.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 87056a6..e88e26e 100644 --- a/init.lua +++ b/init.lua @@ -74,8 +74,6 @@ for w, i in pairs(_M) do if w ~= "widgets" and w ~= "helpers" then -- Place widgets in the namespace table widgets[w] = i - -- Enable caching for all widget types - widget_cache[i] = {} end end end @@ -215,6 +213,14 @@ function activate(widget) end -- }}} +-- {{{ Enable caching for a widget +function enable_caching(widget) + if widget_cache[widget] == nil then + widget_cache[widget] = {} + end +end +-- }}} + -- {{{ Update a widget function update(widget, reg, disablecache) -- Check if there are any equal widgets -- cgit v1.2.3