for (int i = 0; i < _num_entries; i++)
delete[] _entries[i];
- for (int j = 0; j < _num_children; j++) {
+ for (int j = 0; j < _num_children; j++)
if (!_children[j]->nChildren())
_children[j]->removeChangeListener(this);
- }
delete[] _entries;
delete[] _children;
void PropertyList::setValue(const char *s)
{
- SGPropertyNode *p = fgGetNode(s, false);
- if (p)
- setCurrent(p);
+ SGPropertyNode *p;
+ try {
+ p = fgGetNode(s, false);
+ } catch (const stdString& m) {
+ SG_LOG(SG_GENERAL, SG_DEBUG, "property-list: " << m);
+ return;
+ }
+ setCurrent(p);
}
+void PropertyList::setCurrent(SGPropertyNode *p)
+{
+ bool same = (_curr == p);
+ _return = _curr = p;
+ update(same);
+ if (!same)
+ publish(p);
+}
+
~PropertyList();
void update (bool restore_slider_pos = false);
- void setCurrent(SGPropertyNode *p) { _curr = p; update(); publish(p); }
+ void setCurrent(SGPropertyNode *p);
SGPropertyNode *getCurrent() const { return _curr; }
void publish(SGPropertyNode *p) { _return = p; invokeCallback(); }
void toggleFlags() { _flags->setBoolValue(!_flags->getBoolValue()); }