Quantcast

Updated toc to 3.1

p3lim-52096 [04-17-09 - 15:34]
Updated toc to 3.1
Fixed issues with savedvariables

git-svn-id: svn://svn.wowinterface.com/pError-161/trunk@16 7a612bb6-1b7b-4f5f-b58b-e1cc54d1b6b6
Filename
pError/pError.lua
pError/pError.toc
diff --git a/pError/pError.lua b/pError/pError.lua
index ef5a1d7..4527ff0 100644
--- a/pError/pError.lua
+++ b/pError/pError.lua
@@ -1,10 +1,6 @@
+local next = next
 local find = string.find
 local lower = string.lower
-local format = string.format
-
-local next = next
-local remove = table.remove
-local insert = table.insert

 local orig = UIErrorsFrame:GetScript('OnEvent')

@@ -12,17 +8,11 @@ local function msg(...)
 	print(format('|cffff8080pError:|r %s', ...))
 end

-local function loadDefaults()
-	local revert = pErrorDB2 or {} -- remove at 3.1
-	pErrorDB = setmetatable(pErrorDB or revert, {__index = {all = false, blacklist = {}}})
-end
-
 local function slashCommand(str)
 	str = lower(str)

 	if(str == 'reset') then
-		wipe(pErrorDB)
-		loadDefaults()
+		pErrorDB = {all = false, blacklist = {}}
 		msg('Savedvariables are now reset to default')
 	elseif(str == 'all') then
 		pErrorDB.all = not pErrorDB.all
@@ -45,12 +35,12 @@ local function slashCommand(str)
 		else
 			for k, v in next, pErrorDB.blacklist do
 				if(find(str, v)) then
-					remove(pErrorDB.blacklist, k)
+					tremove(pErrorDB.blacklist, k)
 					return msg(format('Removed |cff95ff95\'%s\'|r from the database', v))
 				end
 			end

-			insert(pErrorDB.blacklist, str)
+			tinsert(pErrorDB.blacklist, str)
 			msg(format('Added |cff95ff95\'%s\'|r to the database', str))
 		end
 	else
@@ -76,13 +66,7 @@ local function onLoad(self, event, addon)
 	if(addon ~= 'pError') then return end
 	self:UnregisterEvent(event)

-	loadDefaults()
-
-	-- rollback function, remove soon!
-	for k, v in next, pErrorDB.blacklist do
-		remove(pErrorDB.blacklist, k)
-		insert(pErrorDB.blacklist, lower(v))
-	end
+	pErrorDB = pErrorDB or {all = false, blacklist = {}}

 	SLASH_pError1 = '/perror'
 	SlashCmdList.pError = slashCommand
diff --git a/pError/pError.toc b/pError/pError.toc
index 45187c7..acac1ec 100644
--- a/pError/pError.toc
+++ b/pError/pError.toc
@@ -1,6 +1,6 @@
-## Interface: 30000
+## Interface: 30100
 ## Author: p3lim
-## Version: 30000.wowi:revision
+## Version: 30100.wowi:revision
 ## Title: |cffff6000p|rError
 ## Notes: Hide those pesky errors!
 ## SavedVariables: pErrorDB