]> git.mxchange.org Git - flightgear.git/blobdiff - src/Input/FGDeviceConfigurationMap.cxx
TACAN improvements.
[flightgear.git] / src / Input / FGDeviceConfigurationMap.cxx
index 206ae6c4f42b61466669f46fd5b08737155ebef9..d62a32f9e88bd243976fc91fa94e56bc0bdc36cb 100644 (file)
@@ -77,7 +77,7 @@ FGDeviceConfigurationMap::configurationForDeviceName(const std::string& name)
   try {
     readProperties(it->second.str(), result);
     result->setStringValue("source", it->second.c_str());
-  } catch (sg_exception& e) {
+  } catch (sg_exception&) {
     SG_LOG(SG_INPUT, SG_WARN, "parse failure reading:" << it->second);
     return NULL;
   }
@@ -99,10 +99,12 @@ void FGDeviceConfigurationMap::scan_dir(const SGPath & path)
   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 +117,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)
@@ -138,7 +142,7 @@ void FGDeviceConfigurationMap::refreshCacheForFile(const SGPath& path)
   SGPropertyNode_ptr n(new SGPropertyNode);
   try {
     readProperties(path.str(), n);
-  } catch (sg_exception& e) {
+  } catch (sg_exception&) {
     SG_LOG(SG_INPUT, SG_WARN, "parse failure reading:" << path);
     return;
   }