Allow a default name when adding subsystems.
This commit is contained in:
parent
93237f1b37
commit
cabb2a419f
1 changed files with 7 additions and 1 deletions
|
@ -124,12 +124,18 @@ do_add_subsystem (const SGPropertyNode * arg)
|
||||||
{
|
{
|
||||||
std::string subsystem(arg->getStringValue("subsystem"));
|
std::string subsystem(arg->getStringValue("subsystem"));
|
||||||
std::string name = arg->getStringValue("name");
|
std::string name = arg->getStringValue("name");
|
||||||
if (subsystem.empty() || name.empty()) {
|
if (subsystem.empty()) {
|
||||||
SG_LOG(SG_GENERAL, SG_ALERT, "do_add_subsystem:"
|
SG_LOG(SG_GENERAL, SG_ALERT, "do_add_subsystem:"
|
||||||
<< "no subsystem/name supplied");
|
<< "no subsystem/name supplied");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (name.empty()) {
|
||||||
|
// default name is simply the subsytem's name
|
||||||
|
name = subsystem;
|
||||||
|
}
|
||||||
|
|
||||||
if (globals->get_subsystem_mgr()->get_subsystem(name)) {
|
if (globals->get_subsystem_mgr()->get_subsystem(name)) {
|
||||||
SG_LOG(SG_GENERAL, SG_ALERT, "do_add_subsystem:"
|
SG_LOG(SG_GENERAL, SG_ALERT, "do_add_subsystem:"
|
||||||
<< "duplicate subsystem name:" << name);
|
<< "duplicate subsystem name:" << name);
|
||||||
|
|
Loading…
Add table
Reference in a new issue