Fixed an error caused by custom Data Objects
PProvost-35627 [04-04-09 - 23:17]
Fixed an error caused by custom Data Objects
diff --git a/NinjaPanel.lua b/NinjaPanel.lua
index 2086950..75e83b0 100644
--- a/NinjaPanel.lua
+++ b/NinjaPanel.lua
@@ -197,28 +197,31 @@ function NinjaPanel:PluginIsDisabled(name)
end
end
+function NinjaPanel:StoreName(name)
+ if not self.pluginNames[name] then
+ self.pluginNames[name] = true
+ table.insert(self.pluginNames, name)
+ end
+end
+
function NinjaPanel:ScanForPlugins()
self.warned = self.warned or {}
for name,dataobj in ldb:DataObjectIterator() do
- -- Make sure we add it to the full list of plugin names
- if not self.pluginNames[name] then
- self.pluginNames[name] = true
- table.insert(self.pluginNames, name)
- end
-
- -- Create any plugins that aren't disabled
- if not self:HasPlugin(name) and not self:PluginIsDisabled(name) then
- if dataobj.type == "data source" or dataobj.text then
- self:SpawnPlugin(name, dataobj, "data source")
- elseif dataobj.type == "launcher" or (dataobj.icon and dataobj.OnClick) then
- self:SpawnPlugin(name, dataobj, "launcher")
- elseif not self.warned[name] then
- print("Skipping unknown broker object for " .. name .. "(" .. tostring(dataobj.type) .. ")")
- self.warned[name] = true
+ -- Create any plugins that aren't disabled
+ if not self:HasPlugin(name) and not self:PluginIsDisabled(name) then
+ if dataobj.type == "data source" or dataobj.text then
+ self:StoreName(name)
+ self:SpawnPlugin(name, dataobj, "data source")
+ elseif dataobj.type == "launcher" or (dataobj.icon and dataobj.OnClick) then
+ self:StoreName(name)
+ self:SpawnPlugin(name, dataobj, "launcher")
+ elseif not self.warned[name] then
+ print("Skipping unknown broker object for " .. name .. "(" .. tostring(dataobj.type) .. ")")
+ self.warned[name] = true
+ end
end
end
- end
self:UpdatePanels()
end