From f3eafe1007d356f9c37985828d3968ae6a162e32 Mon Sep 17 00:00:00 2001
From: david <david>
Date: Sat, 11 May 2002 00:59:26 +0000
Subject: [PATCH] Property patches from Frederic Bouvier:

The FlightGear patch is to take account the change in the getChildren
function that now returns a vector<SGPropertyNode_ptr>. If the
removeChild functionnality is to be added in FlightGear, all those
SGPropertyNode * floating around should be changed to
SGPropertyNode_ptr.
---
 src/Cockpit/panel_io.cxx | 2 +-
 src/Input/input.cxx      | 4 ++--
 src/Main/logger.cxx      | 4 ++--
 src/Model/model.cxx      | 6 +++---
 src/Model/modelmgr.cxx   | 2 +-
 src/Objects/matlib.cxx   | 2 +-
 src/Sound/fg_sound.cxx   | 2 +-
 7 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/Cockpit/panel_io.cxx b/src/Cockpit/panel_io.cxx
index ed72c47eb..14f4358af 100644
--- a/src/Cockpit/panel_io.cxx
+++ b/src/Cockpit/panel_io.cxx
@@ -183,7 +183,7 @@ readAction (const SGPropertyNode * node, float w_scale, float h_scale)
 
   FGPanelAction * action = new FGPanelAction(button, x, y, w, h);
 
-  vector<const SGPropertyNode *>bindings = node->getChildren("binding");
+  vector<SGPropertyNode_ptr>bindings = node->getChildren("binding");
   for (unsigned int i = 0; i < bindings.size(); i++) {
     SG_LOG(SG_INPUT, SG_INFO, "Reading binding "
 	   << bindings[i]->getStringValue("command"));
diff --git a/src/Input/input.cxx b/src/Input/input.cxx
index 41edac95a..bf6f44617 100644
--- a/src/Input/input.cxx
+++ b/src/Input/input.cxx
@@ -451,7 +451,7 @@ FGInput::_init_keyboard ()
     key_nodes = fgGetNode("/input/keyboard", true);
   }
   
-  vector<SGPropertyNode *> keys = key_nodes->getChildren("key");
+  vector<SGPropertyNode_ptr> keys = key_nodes->getChildren("key");
   for (unsigned int i = 0; i < keys.size(); i++) {
     int index = keys[i]->getIndex();
     SG_LOG(SG_INPUT, SG_DEBUG, "Binding key " << index);
@@ -810,7 +810,7 @@ FGInput::_read_bindings (const SGPropertyNode * node,
 			 int modifiers)
 {
   SG_LOG(SG_INPUT, SG_DEBUG, "Reading all bindings");
-  vector<const SGPropertyNode *> bindings = node->getChildren("binding");
+  vector<SGPropertyNode_ptr> bindings = node->getChildren("binding");
   for (unsigned int i = 0; i < bindings.size(); i++) {
     SG_LOG(SG_INPUT, SG_DEBUG, "Reading binding "
 	   << bindings[i]->getStringValue("command"));
diff --git a/src/Main/logger.cxx b/src/Main/logger.cxx
index 7958300bb..250b4b053 100644
--- a/src/Main/logger.cxx
+++ b/src/Main/logger.cxx
@@ -39,7 +39,7 @@ FGLogger::init ()
   if (logging == 0)
     return;
 
-  vector<SGPropertyNode *> children = logging->getChildren("log");
+  vector<SGPropertyNode_ptr> children = logging->getChildren("log");
   for (unsigned int i = 0; i < children.size(); i++) {
     _logs.push_back(Log());
     Log &log = _logs[_logs.size()-1];
@@ -52,7 +52,7 @@ FGLogger::init ()
       SG_LOG(SG_INPUT, SG_ALERT, "Cannot write log to " << filename);
       continue;
     }
-    vector<SGPropertyNode *> entries = child->getChildren("entry");
+    vector<SGPropertyNode_ptr> entries = child->getChildren("entry");
     (*log.output) << "Time";
     for (unsigned int j = 0; j < entries.size(); j++) {
       SGPropertyNode * entry = entries[j];
diff --git a/src/Model/model.cxx b/src/Model/model.cxx
index 087380128..1baf88673 100644
--- a/src/Model/model.cxx
+++ b/src/Model/model.cxx
@@ -134,7 +134,7 @@ read_interpolation_table (const SGPropertyNode * props)
   const SGPropertyNode * table_node = props->getNode("interpolation");
   if (table_node != 0) {
     SGInterpTable * table = new SGInterpTable();
-    vector<const SGPropertyNode *> entries = table_node->getChildren("entry");
+    vector<SGPropertyNode_ptr> entries = table_node->getChildren("entry");
     for (int i = 0; i < entries.size(); i++)
       table->addEntry(entries[i]->getDoubleValue("ind", 0.0),
 		      entries[i]->getDoubleValue("dep", 0.0));
@@ -223,10 +223,10 @@ FG3DModel::init (const string &path)
   _location = (FGLocation *) new FGLocation;
 
                                 // Load animations
-  vector<SGPropertyNode *> animation_nodes = props.getChildren("animation");
+  vector<SGPropertyNode_ptr> animation_nodes = props.getChildren("animation");
   unsigned int i;
   for (i = 0; i < animation_nodes.size(); i++) {
-    vector<SGPropertyNode *> name_nodes =
+    vector<SGPropertyNode_ptr> name_nodes =
       animation_nodes[i]->getChildren("object-name");
     if (name_nodes.size() < 1) {
       Animation * animation = make_animation(0, animation_nodes[i]);
diff --git a/src/Model/modelmgr.cxx b/src/Model/modelmgr.cxx
index 2a0ecc570..680230897 100644
--- a/src/Model/modelmgr.cxx
+++ b/src/Model/modelmgr.cxx
@@ -28,7 +28,7 @@ FGModelMgr::~FGModelMgr ()
 void
 FGModelMgr::init ()
 {
-  vector<SGPropertyNode *> model_nodes =
+  vector<SGPropertyNode_ptr> model_nodes =
     fgGetNode("/models", true)->getChildren("model");
   for (int i = 0; i < model_nodes.size(); i++) {
     SGPropertyNode * node = model_nodes[i];
diff --git a/src/Objects/matlib.cxx b/src/Objects/matlib.cxx
index 37128ef54..82f496eef 100644
--- a/src/Objects/matlib.cxx
+++ b/src/Objects/matlib.cxx
@@ -86,7 +86,7 @@ bool FGMaterialLib::load( const string& mpath ) {
     if (!strcmp(node->getName(), "material")) {
       FGNewMat * m = new FGNewMat(node);
 
-      vector<const SGPropertyNode *>names = node->getChildren("name");
+      vector<SGPropertyNode_ptr>names = node->getChildren("name");
       for (unsigned int j = 0; j < names.size(); j++) {
 	string name = names[j]->getStringValue();
 	m->ref();
diff --git a/src/Sound/fg_sound.cxx b/src/Sound/fg_sound.cxx
index 3701766c1..51b7ecb72 100644
--- a/src/Sound/fg_sound.cxx
+++ b/src/Sound/fg_sound.cxx
@@ -116,7 +116,7 @@ FGSound::init(SGPropertyNode *node)
    //
    unsigned int i;
    float v = 0.0;
-   vector<SGPropertyNode *> kids = node->getChildren("volume");
+   vector<SGPropertyNode_ptr> kids = node->getChildren("volume");
    for (i = 0; (i < kids.size()) && (i < FGSound::MAXPROP); i++) {
       _snd_prop volume;