Merge branch 'next' of git://gitorious.org/fg/flightgear into next
This commit is contained in:
commit
4d9439d0c1
4 changed files with 32 additions and 30 deletions
|
@ -129,7 +129,7 @@ fgfs_LDFLAGS = $(fgfs_PLIB_FW) $(fgfs_OSG_FW) $(LDFLAGS)
|
|||
metar_SOURCES = metar_main.cxx
|
||||
|
||||
metar_LDADD = \
|
||||
-lsgenvironment -lsgio -lsgthreads -lsgbucket -lsgmisc -lsgstructure \
|
||||
-lsgenvironment -lsgio -lsgtiming -lsgthreads -lsgbucket -lsgmisc -lsgstructure \
|
||||
-lsgdebug $(network_LIBS) $(thread_LIBS) \
|
||||
-lz $(base_LIBS)
|
||||
|
||||
|
|
|
@ -514,21 +514,8 @@ static SGPath platformDefaultDataPath()
|
|||
#endif
|
||||
|
||||
// Read in configuration (file and command line)
|
||||
bool fgInitConfig ( int argc, char **argv ) {
|
||||
|
||||
flightgear::Options::sharedInstance()->init(argc, argv);
|
||||
|
||||
// Read global preferences from $FG_ROOT/preferences.xml
|
||||
SG_LOG(SG_INPUT, SG_INFO, "Reading global preferences");
|
||||
fgLoadProps("preferences.xml", globals->get_props());
|
||||
SG_LOG(SG_INPUT, SG_INFO, "Finished Reading global preferences");
|
||||
|
||||
// Detect the required language as early as possible
|
||||
if ( !fgDetectLanguage() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
SGPropertyNode autosave;
|
||||
bool fgInitConfig ( int argc, char **argv )
|
||||
{
|
||||
SGPath dataPath = platformDefaultDataPath();
|
||||
|
||||
const char *fg_home = getenv("FG_HOME");
|
||||
|
@ -548,6 +535,21 @@ bool fgInitConfig ( int argc, char **argv ) {
|
|||
home->setStringValue(dataPath.c_str());
|
||||
home->setAttribute(SGPropertyNode::WRITE, false);
|
||||
|
||||
flightgear::Options::sharedInstance()->init(argc, argv, dataPath);
|
||||
|
||||
// Read global preferences from $FG_ROOT/preferences.xml
|
||||
SG_LOG(SG_INPUT, SG_INFO, "Reading global preferences");
|
||||
fgLoadProps("preferences.xml", globals->get_props());
|
||||
SG_LOG(SG_INPUT, SG_INFO, "Finished Reading global preferences");
|
||||
|
||||
// Detect the required language as early as possible
|
||||
if ( !fgDetectLanguage() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
SGPropertyNode autosave;
|
||||
|
||||
|
||||
SGPath autosaveFile = simgear::Dir(dataPath).file("autosave.xml");
|
||||
if (autosaveFile.exists()) {
|
||||
SG_LOG(SG_INPUT, SG_INFO, "Reading user settings from " << autosaveFile.str());
|
||||
|
@ -559,13 +561,6 @@ bool fgInitConfig ( int argc, char **argv ) {
|
|||
}
|
||||
}
|
||||
|
||||
// check for a config file in app data
|
||||
SGPath appDataConfig(dataPath);
|
||||
appDataConfig.append("fgfsrc");
|
||||
if (appDataConfig.exists()) {
|
||||
flightgear::Options::sharedInstance()->readConfig(appDataConfig);
|
||||
}
|
||||
|
||||
// Scan user config files and command line for a specified aircraft.
|
||||
flightgear::Options::sharedInstance()->initAircraft();
|
||||
|
||||
|
|
|
@ -1671,7 +1671,7 @@ Options::~Options()
|
|||
{
|
||||
}
|
||||
|
||||
void Options::init(int argc, char **argv)
|
||||
void Options::init(int argc, char **argv, const SGPath& appDataPath)
|
||||
{
|
||||
fgSetDefaults();
|
||||
|
||||
|
@ -1717,6 +1717,13 @@ void Options::init(int argc, char **argv)
|
|||
readConfig(config);
|
||||
}
|
||||
|
||||
// check for a config file in app data
|
||||
SGPath appDataConfig(appDataPath);
|
||||
appDataConfig.append("fgfsrc");
|
||||
if (appDataConfig.exists()) {
|
||||
readConfig(appDataConfig);
|
||||
}
|
||||
|
||||
// setup FG_ROOT
|
||||
setupRoot();
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
/**
|
||||
* pass command line arguments, read default config files
|
||||
*/
|
||||
void init(int argc, char* argv[]);
|
||||
void init(int argc, char* argv[], const SGPath& appDataPath);
|
||||
|
||||
/**
|
||||
* parse a config file (eg, .fgfsrc)
|
||||
|
|
Loading…
Add table
Reference in a new issue