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:
parent
1eb8ae1fbf
commit
e6297959d9
1 changed files with 10 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue