diff Libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua @ 5:c31ee4251181

Libs Update
author tercio
date Tue, 25 Nov 2014 21:15:10 -0200
parents fc346da3afd9
children 371e14cd2feb
line wrap: on
line diff
--- a/Libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua	Wed Oct 15 11:50:40 2014 -0300
+++ b/Libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua	Tue Nov 25 21:15:10 2014 -0200
@@ -8,8 +8,8 @@
 -- :IterateOptionsTables() (and :GetOptionsTable() if only given one argument) return a function reference that the requesting config handling addon must call with valid "uiType", "uiName".
 -- @class file
 -- @name AceConfigRegistry-3.0
--- @release $Id: AceConfigRegistry-3.0.lua 1045 2011-12-09 17:58:40Z nevcairiel $
-local MAJOR, MINOR = "AceConfigRegistry-3.0", 14
+-- @release $Id: AceConfigRegistry-3.0.lua 1105 2013-12-08 22:11:58Z nevcairiel $
+local MAJOR, MINOR = "AceConfigRegistry-3.0", 15
 local AceConfigRegistry = LibStub:NewLibrary(MAJOR, MINOR)
 
 if not AceConfigRegistry then return end
@@ -288,7 +288,8 @@
 -- @param appName The application name as given to `:RegisterOptionsTable()`
 -- @param options The options table, OR a function reference that generates it on demand. \\
 -- See the top of the page for info on arguments passed to such functions.
-function AceConfigRegistry:RegisterOptionsTable(appName, options)
+-- @param skipValidation Skip options table validation (primarily useful for extremely huge options, with a noticeable slowdown)
+function AceConfigRegistry:RegisterOptionsTable(appName, options, skipValidation)
 	if type(options)=="table" then
 		if options.type~="group" then	-- quick sanity checker
 			error(MAJOR..": RegisterOptionsTable(appName, options): 'options' - missing type='group' member in root group", 2)
@@ -296,7 +297,7 @@
 		AceConfigRegistry.tables[appName] = function(uiType, uiName, errlvl)
 			errlvl=(errlvl or 0)+1
 			validateGetterArgs(uiType, uiName, errlvl)
-			if not AceConfigRegistry.validated[uiType][appName] then
+			if not AceConfigRegistry.validated[uiType][appName] and not skipValidation then
 				AceConfigRegistry:ValidateOptionsTable(options, appName, errlvl)	-- upgradable
 				AceConfigRegistry.validated[uiType][appName] = true
 			end
@@ -307,7 +308,7 @@
 			errlvl=(errlvl or 0)+1
 			validateGetterArgs(uiType, uiName, errlvl)
 			local tab = assert(options(uiType, uiName, appName))
-			if not AceConfigRegistry.validated[uiType][appName] then
+			if not AceConfigRegistry.validated[uiType][appName] and not skipValidation then
 				AceConfigRegistry:ValidateOptionsTable(tab, appName, errlvl)	-- upgradable
 				AceConfigRegistry.validated[uiType][appName] = true
 			end