wxTreeItemId rootNode = m_TypesTree->AddRoot("root");
- bool all = false;
- std::map<String, wxTreeItemId> items;
-
- m_Types.clear();
-
- while (!all) {
- all = true;
+ BOOST_FOREACH(const ApiType::Ptr& type, types) {
+ m_Types[type->Name] = type;
+ }
- BOOST_FOREACH(const ApiType::Ptr& type, types) {
- std::string name = type->Name;
+ BOOST_FOREACH(const ApiType::Ptr& type, types) {
+ if (type->Abstract)
+ continue;
- if (items.find(name) != items.end())
- continue;
+ bool configObject = false;
+ ApiType::Ptr currentType = type;
- all = false;
+ for (;;) {
+ if (currentType->BaseName.IsEmpty())
+ break;
- wxTreeItemId parent;
-
- if (type->BaseName.IsEmpty())
- parent = rootNode;
- else {
- std::map<String, wxTreeItemId>::const_iterator it = items.find(type->BaseName);
+ currentType = m_Types[currentType->BaseName];
- if (it == items.end())
- continue;
+ if (!currentType)
+ break;
- parent = it->second;
+ if (currentType->Name == "ConfigObject") {
+ configObject = true;
+ break;
}
+ }
- m_Types[name] = type;
- items[name] = m_TypesTree->AppendItem(parent, name, 0);
+ if (configObject) {
+ std::string name = type->Name;
+ m_TypesTree->AppendItem(rootNode, name, 0);
}
}
}