WoWInterface SVN NightWatch

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk/libs/AceDB-3.0
    from Rev 29 to Rev 4
    Reverse comparison

Rev 29 → Rev 4

AceDB-3.0.lua
39,8 → 39,8
-- end
-- @class file
-- @name AceDB-3.0.lua
-- @release $Id: AceDB-3.0.lua 940 2010-06-19 08:01:47Z nevcairiel $
local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 21
-- @release $Id: AceDB-3.0.lua 877 2009-11-02 15:56:50Z nevcairiel $
local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 19
local AceDB, oldminor = LibStub:NewLibrary(ACEDB_MAJOR, ACEDB_MINOR)
 
if not AceDB then return end -- No upgrade needed
346,29 → 346,13
 
-- handle PLAYER_LOGOUT
-- strip all defaults from all databases
-- and cleans up empty sections
local function logoutHandler(frame, event)
if event == "PLAYER_LOGOUT" then
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
if rawget(sv, section) then
-- global is special, all other sections have sub-entrys
-- also don't delete empty profiles on main dbs, only on namespaces
if section ~= "global" and (section ~= "profiles" or rawget(db, "parent")) then
for key in pairs(sv[section]) do
if not next(sv[section][key]) then
sv[section][key] = nil
end
end
end
if not next(sv[section]) then
sv[section] = nil
end
for section, key in pairs(db.keys) do
if db.defaults and db.defaults[section] and rawget(db, section) then
removeDefaults(db[section], db.defaults[section])
end
end
end
507,11 → 491,11
error("Cannot delete the active profile in an AceDBObject.", 2)
end
 
if not rawget(self.profiles, name) and not silent then
if not rawget(self.sv.profiles, name) and not silent then
error("Cannot delete profile '" .. name .. "'. It does not exist.", 2)
end
 
self.profiles[name] = nil
self.sv.profiles[name] = nil
 
-- populate to child namespaces
if self.children then
537,7 → 521,7
error("Cannot have the same source and destination profiles.", 2)
end
 
if not rawget(self.profiles, name) and not silent then
if not rawget(self.sv.profiles, name) and not silent then
error("Cannot copy profile '" .. name .. "'. It does not exist.", 2)
end
 
545,7 → 529,7
DBObjectLib.ResetProfile(self, nil, true)
 
local profile = self.profile
local source = self.profiles[name]
local source = self.sv.profiles[name]
 
copyTable(source, profile)