]> git.mxchange.org Git - flightgear.git/commitdiff
Version the navache filename.
authorJames Turner <zakalawe@mac.com>
Thu, 21 Feb 2013 17:42:06 +0000 (17:42 +0000)
committerJames Turner <zakalawe@mac.com>
Thu, 21 Feb 2013 17:42:06 +0000 (17:42 +0000)
Be friendly to people switching between 2.10 and dev (2.11), don't force a rebuild each time.

src/Navaids/NavDataCache.cxx

index 1f1dc251a70cc7d8fb164b173eec852c5e1b29ee..0f1137c3121d0f5214656211510d33f771ff3097 100644 (file)
@@ -1089,7 +1089,16 @@ NavDataCache::NavDataCache()
 {
   const int MAX_TRIES = 3;
   SGPath homePath(globals->get_fg_home());
-  homePath.append("navdata.cache");
+  
+  std::ostringstream os;
+  string_list versionParts = simgear::strutils::split(VERSION, ".");
+  if (versionParts.size() < 2) {
+    os << "navdata.cache";
+  } else {
+    os << "navdata_" << versionParts[0] << "_" << versionParts[1] << ".cache";
+  }
+    
+  homePath.append(os.str());
   
   for (int t=0; t < MAX_TRIES; ++t) {
     try {