]> git.mxchange.org Git - flightgear.git/blobdiff - src/Input/FGDeviceConfigurationMap.cxx
Interim windows build fix
[flightgear.git] / src / Input / FGDeviceConfigurationMap.cxx
index 1da399fb5ae5db9dfe38d68fc157cee009b3f69a..7be95cb38953ef3b9cb5862d1e199bc2f00cd6ef 100644 (file)
@@ -96,13 +96,16 @@ bool FGDeviceConfigurationMap::hasConfiguration(const std::string& name) const
 
 void FGDeviceConfigurationMap::scan_dir(const SGPath & path)
 {
+  SG_LOG(SG_INPUT, SG_DEBUG, "Scanning " << path << " for input devices");
   if (!path.exists())
     return;
   
+  flightgear::NavDataCache* cache = flightgear::NavDataCache::instance();
+  flightgear::NavDataCache::Transaction txn(cache);
+  
   simgear::Dir dir(path);
   simgear::PathList children = dir.children(simgear::Dir::TYPE_FILE | 
     simgear::Dir::TYPE_DIR | simgear::Dir::NO_DOT_OR_DOTDOT);
-  flightgear::NavDataCache* cache = flightgear::NavDataCache::instance();
   
   BOOST_FOREACH(SGPath path, children) {
     if (path.isDir()) {
@@ -115,6 +118,8 @@ void FGDeviceConfigurationMap::scan_dir(const SGPath & path)
       } // of cached file stamp is valid
     } // of child is a file with '.xml' extension
   } // of directory children iteration
+  
+  txn.commit();
 }
 
 void FGDeviceConfigurationMap::readCachedData(const SGPath& path)
@@ -134,12 +139,12 @@ void FGDeviceConfigurationMap::readCachedData(const SGPath& path)
 
 void FGDeviceConfigurationMap::refreshCacheForFile(const SGPath& path)
 {
-  SG_LOG(SG_INPUT, SG_DEBUG, "Reading joystick file " << path.str());
+  SG_LOG(SG_INPUT, SG_DEBUG, "Reading device file " << path.str());
   SGPropertyNode_ptr n(new SGPropertyNode);
   try {
     readProperties(path.str(), n);
   } catch (sg_exception&) {
-    SG_LOG(SG_INPUT, SG_WARN, "parse failure reading:" << path);
+    SG_LOG(SG_INPUT, SG_ALERT, "parse failure reading:" << path);
     return;
   }