Error messages when installing property aliases fails.
This commit is contained in:
+33
-7
@@ -778,13 +778,39 @@ SGPropertyNode::~SGPropertyNode ()
|
|||||||
bool
|
bool
|
||||||
SGPropertyNode::alias (SGPropertyNode * target)
|
SGPropertyNode::alias (SGPropertyNode * target)
|
||||||
{
|
{
|
||||||
if (target == 0 || _type == props::ALIAS || _tied)
|
if (target && (_type != props::ALIAS) && (!_tied))
|
||||||
return false;
|
{
|
||||||
clearValue();
|
clearValue();
|
||||||
get(target);
|
get(target);
|
||||||
_value.alias = target;
|
_value.alias = target;
|
||||||
_type = props::ALIAS;
|
_type = props::ALIAS;
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if PROPS_STANDALONE
|
||||||
|
#else
|
||||||
|
if (!target)
|
||||||
|
{
|
||||||
|
SG_LOG(SG_GENERAL, SG_ALERT,
|
||||||
|
"Failed to create alias for " << getPath() << ". "
|
||||||
|
"The target property does not exist.");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (_type == props::ALIAS)
|
||||||
|
{
|
||||||
|
SG_LOG(SG_GENERAL, SG_ALERT,
|
||||||
|
"Failed to create alias at " << target->getPath() << ". "
|
||||||
|
"Source "<< getPath() << " is also an alias. Unsupported recursion.");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (_tied)
|
||||||
|
{
|
||||||
|
SG_LOG(SG_GENERAL, SG_ALERT, "Failed to create alias at " << target->getPath() << ". "
|
||||||
|
"Source " << getPath() << " is a tied property.");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user