From e6297959d909906ec4beef16be6b23cd7d71c7b0 Mon Sep 17 00:00:00 2001 From: James Turner Date: Thu, 21 Feb 2013 17:42:06 +0000 Subject: [PATCH] Version the navache filename. Be friendly to people switching between 2.10 and dev (2.11), don't force a rebuild each time. --- src/Navaids/NavDataCache.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Navaids/NavDataCache.cxx b/src/Navaids/NavDataCache.cxx index 1f1dc251a..0f1137c31 100644 --- a/src/Navaids/NavDataCache.cxx +++ b/src/Navaids/NavDataCache.cxx @@ -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 { -- 2.39.5