- Fix overwriting of parent node if PropertyObject::node() is
called for a non-existing node.
- Prevent implicit conversion from const char* and
SGPropertyNode*
- SGPropertyNode* r = _prop ? _prop : static_defaultRoot;
- _prop = r->getNode(_path, aCreate);
+ SGPropertyNode *r = _prop ? _prop : static_defaultRoot,
+ *prop = r->getNode(_path, aCreate);
- if (_prop) {
- // resolve worked, we will cache from now on, so clear _path
+ if( prop )
+ {
+ // resolve worked, we will cache from now on, so clear _path and cache prop
}
SGPropertyNode* PropertyObjectBase::getOrThrow() const
}
SGPropertyNode* PropertyObjectBase::getOrThrow() const
class PropertyObject : PropertyObjectBase
{
public:
class PropertyObject : PropertyObjectBase
{
public:
/**
* Create from path relative to the default root, and option default value
*/
/**
* Create from path relative to the default root, and option default value
*/
- PropertyObject(const char* aChild) :
+ explicit PropertyObject(const char* aChild) :
PropertyObjectBase(aChild)
{ }
/**
* Create from a node, with optional relative path
*/
PropertyObjectBase(aChild)
{ }
/**
* Create from a node, with optional relative path
*/
- PropertyObject(SGPropertyNode* aNode, const char* aChild = NULL) :
+ explicit PropertyObject(SGPropertyNode* aNode, const char* aChild = NULL) :
PropertyObjectBase(aNode, aChild)
{
PropertyObjectBase(aNode, aChild)
{
{
SGPropertyNode* n = PropertyObjectBase::node(true);
if (!n) {
{
SGPropertyNode* n = PropertyObjectBase::node(true);
if (!n) {
+ std::cout << "no node" << std::endl;
class PropertyObject<std::string> : PropertyObjectBase
{
public:
class PropertyObject<std::string> : PropertyObjectBase
{
public:
- PropertyObject(const char* aChild) :
+ explicit PropertyObject(const char* aChild) :
PropertyObjectBase(aChild)
{ }
PropertyObjectBase(aChild)
{ }
- PropertyObject(SGPropertyNode* aNode, const char* aChild = NULL) :
+ explicit PropertyObject(SGPropertyNode* aNode, const char* aChild = NULL) :
PropertyObjectBase(aNode, aChild)
{
PropertyObjectBase(aNode, aChild)
{