1
0
Fork 0

Version the navache filename.

Be friendly to people switching between 2.10 and dev (2.11), don't force a rebuild each time.
This commit is contained in:
James Turner 2013-02-21 17:42:06 +00:00
parent 1eb8ae1fbf
commit e6297959d9

View 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 {