]> git.mxchange.org Git - flightgear.git/blobdiff - src/Input/FGEventInput.cxx
Document that property write-protection is not a security measure
[flightgear.git] / src / Input / FGEventInput.cxx
index 4a53a63d0a04ca1dd6ab2bec161d0061797cbbac..29bdc6e1d128a8d40337405b0f50c5fd3aa59938 100644 (file)
@@ -36,6 +36,7 @@ using simgear::PropertyList;
 using std::cout;
 using std::endl;
 using std::map;
+using std::string;
 
 FGEventSetting::FGEventSetting( SGPropertyNode_ptr base ) :
   value(0.0)
@@ -294,7 +295,7 @@ void FGInputDevice::SetName( string name )
 const char * FGEventInput::PROPERTY_ROOT = "/input/event";
 
 FGEventInput::FGEventInput() : 
-  configMap( "Input/Event", fgGetNode( PROPERTY_ROOT, true ), "device-named" )
+  configMap( "Input/Event", fgGetNode(PROPERTY_ROOT, true), "device-named")
 {
 }
 
@@ -329,7 +330,7 @@ unsigned FGEventInput::AddDevice( FGInputDevice * inputDevice )
   SGPropertyNode_ptr deviceNode = NULL;
 
   // look for configuration in the device map
-  if( configMap.count( inputDevice->GetName() ) > 0 ) {
+  if ( configMap.hasConfiguration( inputDevice->GetName() ) ) {
     // found - copy to /input/event/device[n]
 
     // find a free index
@@ -347,7 +348,7 @@ unsigned FGEventInput::AddDevice( FGInputDevice * inputDevice )
     deviceNode = baseNode->getNode( "device", index, true );
 
     // and copy the properties from the configuration tree
-    copyProperties( configMap[ inputDevice->GetName() ], deviceNode );
+    copyProperties( configMap.configurationForDeviceName(inputDevice->GetName()), deviceNode );
 
   }
 
@@ -385,6 +386,6 @@ void FGEventInput::RemoveDevice( unsigned index )
     delete inputDevice;
     
   }
-  deviceNode = baseNode->removeChild("device", index, false);
+  deviceNode = baseNode->removeChild("device", index);
 }