+void FGDeviceConfigurationMap::refreshCacheForFile(const SGPath& path)
+{
+ SG_LOG(SG_INPUT, SG_DEBUG, "Reading joystick 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);
+ return;
+ }
+
+ NamePathMap::iterator it;
+ string_list names;
+ BOOST_FOREACH(SGPropertyNode* nameProp, n->getChildren("name")) {
+ names.push_back(nameProp->getStringValue());
+ // same comment as readCachedData: only insert if not already present
+ it = namePathMap.find(names.back());
+ if (it == namePathMap.end()) {
+ namePathMap.insert(std::make_pair(names.back(), path));
+ }
+ }
+
+ flightgear::NavDataCache* cache = flightgear::NavDataCache::instance();
+ cache->stampCacheFile(path);
+ cache->writeStringListProperty(path.str(), names);
+}