Change default Windows terrasync path
Now use (new) SGPath::documents helper to download to a user-visible location: Document\FlightGear. (Linux & Mac behaviour is unchanged)
This commit is contained in:
parent
3254f54f9e
commit
9f3a2ddbdc
1 changed files with 22 additions and 7 deletions
|
@ -2106,6 +2106,20 @@ string_list Options::valuesForOption(const std::string& key) const
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static string defaultTerrasyncDir()
|
||||||
|
{
|
||||||
|
#if defined(SG_WINDOWS)
|
||||||
|
SGPath p(SGPath::documents());
|
||||||
|
p.append("FlightGear");
|
||||||
|
#else
|
||||||
|
SGPath p(globals->get_fg_home());
|
||||||
|
#endif
|
||||||
|
p.append("TerraSync");
|
||||||
|
return p.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
OptionResult Options::processOptions()
|
OptionResult Options::processOptions()
|
||||||
{
|
{
|
||||||
// establish locale before showing help (this selects the default locale,
|
// establish locale before showing help (this selects the default locale,
|
||||||
|
@ -2169,15 +2183,16 @@ OptionResult Options::processOptions()
|
||||||
// terrasync directory fixup
|
// terrasync directory fixup
|
||||||
string terrasyncDir = fgGetString("/sim/terrasync/scenery-dir");
|
string terrasyncDir = fgGetString("/sim/terrasync/scenery-dir");
|
||||||
if (terrasyncDir.empty()) {
|
if (terrasyncDir.empty()) {
|
||||||
SGPath p(globals->get_fg_home());
|
terrasyncDir = defaultTerrasyncDir();
|
||||||
p.append("TerraSync");
|
// auto-save it for next time
|
||||||
terrasyncDir = p.str();
|
|
||||||
SG_LOG(SG_GENERAL, SG_INFO,
|
SG_LOG(SG_GENERAL, SG_INFO,
|
||||||
"Using default TerraSync dir: " << terrasyncDir);
|
"Using default TerraSync: " << terrasyncDir);
|
||||||
fgSetString("/sim/terrasync/scenery-dir", terrasyncDir);
|
fgSetString("/sim/terrasync/scenery-dir", terrasyncDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
SGPath p(terrasyncDir);
|
SGPath p(terrasyncDir);
|
||||||
|
|
||||||
// following is necessary to ensure NavDataCache sees stable scenery paths from
|
// following is necessary to ensure NavDataCache sees stable scenery paths from
|
||||||
// terrasync. Ensure the Terrain and Objects subdirs exist immediately, rather
|
// terrasync. Ensure the Terrain and Objects subdirs exist immediately, rather
|
||||||
// than waiting for the first tiles to be scheduled.
|
// than waiting for the first tiles to be scheduled.
|
||||||
|
|
Loading…
Add table
Reference in a new issue