MSVC fix.
This commit is contained in:
parent
f6174d2bf0
commit
3986347f37
2 changed files with 16 additions and 1 deletions
|
@ -191,11 +191,19 @@ do_exit (const SGPropertyNode * arg)
|
||||||
{
|
{
|
||||||
SG_LOG(SG_INPUT, SG_INFO, "Program exit requested.");
|
SG_LOG(SG_INPUT, SG_INFO, "Program exit requested.");
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
char* envp = ::getenv( "APPDATA" );
|
||||||
|
#else
|
||||||
char* envp = ::getenv( "HOME" );
|
char* envp = ::getenv( "HOME" );
|
||||||
|
#endif
|
||||||
if ( envp != NULL ) {
|
if ( envp != NULL ) {
|
||||||
SGPath config( globals->get_fg_root() );
|
SGPath config( globals->get_fg_root() );
|
||||||
config.set( envp );
|
config.set( envp );
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
config.append( "flightgear.org" );
|
||||||
|
#else
|
||||||
config.append( ".fgfs" );
|
config.append( ".fgfs" );
|
||||||
|
#endif
|
||||||
config.append( "preferences.xml" );
|
config.append( "preferences.xml" );
|
||||||
config.create_dir( 0700 );
|
config.create_dir( 0700 );
|
||||||
SG_LOG(SG_IO, SG_INFO, "Saving user preferences");
|
SG_LOG(SG_IO, SG_INFO, "Saving user preferences");
|
||||||
|
|
|
@ -607,12 +607,19 @@ bool fgInitConfig ( int argc, char **argv ) {
|
||||||
SG_LOG( SG_INPUT, SG_ALERT, "No default aircraft specified" );
|
SG_LOG( SG_INPUT, SG_ALERT, "No default aircraft specified" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
char* envp = ::getenv( "APPDATA" );
|
||||||
|
#else
|
||||||
char* envp = ::getenv( "HOME" );
|
char* envp = ::getenv( "HOME" );
|
||||||
|
#endif
|
||||||
if ( envp != NULL ) {
|
if ( envp != NULL ) {
|
||||||
SGPath config( globals->get_fg_root() );
|
SGPath config( globals->get_fg_root() );
|
||||||
config.set( envp );
|
config.set( envp );
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
config.append( "flightgear.org" );
|
||||||
|
#else
|
||||||
config.append( ".fgfs" );
|
config.append( ".fgfs" );
|
||||||
|
#endif
|
||||||
config.append( "preferences.xml" );
|
config.append( "preferences.xml" );
|
||||||
SG_LOG(SG_INPUT, SG_INFO, "Reading user preferences");
|
SG_LOG(SG_INPUT, SG_INFO, "Reading user preferences");
|
||||||
fgLoadProps(config.str().c_str(), globals->get_props(), false, SGPropertyNode::USERARCHIVE);
|
fgLoadProps(config.str().c_str(), globals->get_props(), false, SGPropertyNode::USERARCHIVE);
|
||||||
|
|
Loading…
Add table
Reference in a new issue