WoWInterface SVN UrbanAchiever

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk/Libs/AceDB-3.0
    from Rev 79 to Rev 143
    Reverse comparison

Rev 79 → Rev 143

AceDB-3.0.lua
39,8 → 39,8
-- end
-- @class file
-- @name AceDB-3.0.lua
-- @release $Id: AceDB-3.0.lua 914 2010-03-08 12:09:22Z nevcairiel $
local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 20
-- @release $Id: AceDB-3.0.lua 1035 2011-07-09 03:20:13Z kaelten $
local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 22
local AceDB, oldminor = LibStub:NewLibrary(ACEDB_MAJOR, ACEDB_MINOR)
 
if not AceDB then return end -- No upgrade needed
260,6 → 260,9
local _, raceKey = UnitRace("player")
local factionKey = UnitFactionGroup("player")
local factionrealmKey = factionKey .. " - " .. realmKey
local factionrealmregionKey = factionrealmKey .. " - " .. string.sub(GetCVar("realmList"), 1, 2):upper()
local localeKey = GetLocale():lower()
 
-- Actual database initialization function
local function initdb(sv, defaults, defaultProfile, olddb, parent)
-- Generate the database keys for each section
295,7 → 298,9
["race"] = raceKey,
["faction"] = factionKey,
["factionrealm"] = factionrealmKey,
["factionrealmregion"] = factionrealmregionKey,
["profile"] = profileKey,
["locale"] = localeKey,
["global"] = true,
["profiles"] = true,
}
352,7 → 357,7
for db in pairs(AceDB.db_registry) do
db.callbacks:Fire("OnDatabaseShutdown", db)
db:RegisterDefaults(nil)
 
 
-- cleanup sections that are empty without defaults
local sv = rawget(db, "sv")
for section in pairs(db.keys) do
507,11 → 512,11
error("Cannot delete the active profile in an AceDBObject.", 2)
end
 
if not rawget(self.sv.profiles, name) and not silent then
if not rawget(self.profiles, name) and not silent then
error("Cannot delete profile '" .. name .. "'. It does not exist.", 2)
end
 
self.sv.profiles[name] = nil
self.profiles[name] = nil
 
-- populate to child namespaces
if self.children then
537,7 → 542,7
error("Cannot have the same source and destination profiles.", 2)
end
 
if not rawget(self.sv.profiles, name) and not silent then
if not rawget(self.profiles, name) and not silent then
error("Cannot copy profile '" .. name .. "'. It does not exist.", 2)
end
 
545,7 → 550,7
DBObjectLib.ResetProfile(self, nil, true)
 
local profile = self.profile
local source = self.sv.profiles[name]
local source = self.profiles[name]
 
copyTable(source, profile)