Fix problem with missing config items

This commit is contained in:
Gunnar Beutner 2014-11-08 14:24:17 +01:00
parent 8bd091fef0
commit 25ee5dd1fd
1 changed files with 13 additions and 4 deletions

View File

@ -231,11 +231,20 @@ void ConfigItem::Register(void)
{
String name = m_Name;
shared_ptr<NameComposer> nc = dynamic_pointer_cast<NameComposer>(Type::GetByName(m_Type));
/* If this is a non-abstract object we need to figure out
* its real name now - or assign it a temporary name. */
if (!m_Abstract) {
shared_ptr<NameComposer> nc = dynamic_pointer_cast<NameComposer>(Type::GetByName(m_Type));
/* If this is a non-abstract object with a composite name we don't register it. */
if (!m_Abstract && nc)
return;
if (nc) {
name = nc->MakeName(m_Name, Dictionary::Ptr());
ASSERT(name.IsEmpty() || name == m_Name);
if (name.IsEmpty())
name = Utility::NewUniqueID();
}
}
std::pair<String, String> key = std::make_pair(m_Type, name);
ConfigItem::Ptr self = GetSelf();