X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FInput%2FFGDeviceConfigurationMap.cxx;h=d62a32f9e88bd243976fc91fa94e56bc0bdc36cb;hb=5151f7f5e0ba7c7e6688bdfbc4cea365196e1ed3;hp=206ae6c4f42b61466669f46fd5b08737155ebef9;hpb=ae6218ff102b8638a7ce584484748472d347fdd9;p=flightgear.git diff --git a/src/Input/FGDeviceConfigurationMap.cxx b/src/Input/FGDeviceConfigurationMap.cxx index 206ae6c4f..d62a32f9e 100644 --- a/src/Input/FGDeviceConfigurationMap.cxx +++ b/src/Input/FGDeviceConfigurationMap.cxx @@ -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; }