upper_case_property("/sim/tower/airport-id");
upper_case_property("/autopilot/route-manager/input");
+// check if the launcher is reuested, since it affects config file parsing
+ bool showLauncher = flightgear::Options::checkForArg(argc, argv, "launcher");
+ // an Info.plist bundle can't define command line arguments, but it can set
+ // environment variables. This avoids needed a wrapper shell-script on OS-X.
+ showLauncher |= (::getenv("FG_LAUNCHER") != 0);
+ if (showLauncher) {
+ // to minimise strange interactions when launcher and config files
+ // set overlaping options, we disable the default files. Users can
+ // still explicitly request config files via --config options if they choose.
+ flightgear::Options::sharedInstance()->setShouldLoadDefaultConfig(false);
+ }
+
// Load the configuration parameters. (Command line options
// override config file options. Config file options override
// defaults.)
}
#if defined(HAVE_QT)
- bool showLauncher = flightgear::Options::checkForArg(argc, argv, "launcher");
- // an Info.plist bundle can't define command line arguments, but it can set
- // environment variables. This avoids needed a wrapper shell-script on OS-X.
- showLauncher |= (::getenv("FG_LAUNCHER") != 0);
-
if (showLauncher) {
flightgear::initApp(argc, argv);
if (!flightgear::runLauncherDialog()) {
return p->shouldLoadDefaultConfig;
}
+void Options::setShouldLoadDefaultConfig(bool load)
+{
+ p->shouldLoadDefaultConfig = load;
+}
+
bool Options::checkForArg(int argc, char* argv[], const char* checkArg)
{
for (int i = 0; i < argc; ++i) {
/**
* should defualt configuration files be loaded and processed or not?
* There's many configuration files we have historically read by default
- * on startup - preferences.xml, fgfs.rc in various places and so on.
+ * on startup - fgfs.rc in various places and so on.
* --no-default-config allows this behaviour to be changed, so only
- * expicitly listed files are read - this is useful for testing. Expose
+ * expicitly listed files are read Expose
* the value of the option here.
*/
bool shouldLoadDefaultConfig() const;
+ /**
+ * when using the built-in launcher, we disable the default config files.
+ * explicitly loaded confg files are still permitted.
+ */
+ void setShouldLoadDefaultConfig(bool load);
+
/**
* check if the arguments array contains a particular string (with a '--' or
* '-' prefix).