]> git.mxchange.org Git - flightgear.git/blobdiff - src/Airports/xmlloader.cxx
Interim windows build fix
[flightgear.git] / src / Airports / xmlloader.cxx
index 901d1235f19d34fe566946c6c55862be94b574dc..cdd36271437846b9cff945ead136771715e2a51b 100644 (file)
@@ -17,6 +17,8 @@
 #  include "config.h"
 #endif
 
+#include <cstdio>
+
 #include <simgear/misc/sg_path.hxx>
 #include <simgear/xml/easyxml.hxx>
 #include <simgear/misc/strutils.hxx>
@@ -30,7 +32,7 @@
 #include "runwayprefloader.hxx"
 
 #include "dynamics.hxx"
-#include "simple.hxx"
+#include "airport.hxx"
 #include "runwayprefs.hxx"
 
 #include <Navaids/NavDataCache.hxx>
@@ -47,27 +49,17 @@ void XMLLoader::load(FGAirportDynamics* d)
     return;
   }
 
-  flightgear::NavDataCache* cache = flightgear::NavDataCache::instance();
-  if (!cache->isCachedFileModified(path)) {
-    return;
-  }
-  
-  SG_LOG(SG_GENERAL, SG_INFO, "reading groundnet data from " << path);
+  SG_LOG(SG_NAVAID, SG_INFO, "reading groundnet data from " << path);
   SGTimeStamp t;
+  t.stamp();
   try {
-    cache->beginTransaction();
-    t.stamp();
-    {
       FGAirportDynamicsXMLLoader visitor(d);
       readXML(path.str(), visitor);
-    } // ensure visitor is destroyed so its destructor runs
-    cache->stampCacheFile(path);
-    cache->commitTransaction();
   } catch (sg_exception& e) {
-    cache->abortTransaction();
+    SG_LOG(SG_NAVAID, SG_INFO, "parsing groundnet XML failed:" << e.getFormattedMessage());
   }
 
-  SG_LOG(SG_GENERAL, SG_INFO, "parsing XML took " << t.elapsedMSec());
+  SG_LOG(SG_NAVAID, SG_INFO, "parsing groundnet XML took " << t.elapsedMSec());
 }
 
 void XMLLoader::load(FGRunwayPreference* p) {
@@ -109,7 +101,7 @@ bool XMLLoader::loadAirportXMLDataIntoVisitor(const string& aICAO,
 {
   SGPath path;
   if (!findAirportData(aICAO, aFileName, path)) {
-    SG_LOG(SG_GENERAL, SG_DEBUG, "loadAirportXMLDataIntoVisitor: failed to find data for " << aICAO << "/" << aFileName);
+    SG_LOG(SG_NAVAID, SG_DEBUG, "loadAirportXMLDataIntoVisitor: failed to find data for " << aICAO << "/" << aFileName);
     return false;
   }