From: James Turner Date: Mon, 5 Sep 2016 14:45:37 +0000 (+0100) Subject: Adjust behaviour of —no-default-config option X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3636cf57abd98b70d0a5d244b8e991fe53bca358;p=flightgear.git Adjust behaviour of —no-default-config option Still read autosave and preferences.xml in this case, but skip all config files (.fgfsrc, etc) --- diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index eadfa155d..8537fc373 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -462,28 +462,21 @@ int fgInitConfig ( int argc, char **argv, bool reinit ) if (!reinit) { options->init(argc, argv, dataPath); } - - bool loadDefaults = options->shouldLoadDefaultConfig(); - if (loadDefaults) { - // 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"); - - // do not load user settings when reset to default is requested, or if - // told to explicitly ignore - if (options->isOptionSet("restore-defaults") || options->isOptionSet("ignore-autosave")) - { - SG_LOG(SG_GENERAL, SG_ALERT, "Ignoring user settings. Restoring defaults."); - } - else - { - globals->loadUserSettings(dataPath); - } + + // Read global preferences from $FG_ROOT/preferences.xml + SG_LOG(SG_GENERAL, SG_INFO, "Reading global preferences"); + fgLoadProps("preferences.xml", globals->get_props()); + SG_LOG(SG_GENERAL, SG_INFO, "Finished Reading global preferences"); + + // do not load user settings when reset to default is requested, or if + // told to explicitly ignore + if (options->isOptionSet("restore-defaults") || options->isOptionSet("ignore-autosave")) + { + SG_LOG(SG_GENERAL, SG_ALERT, "Ignoring user settings. Restoring defaults."); } else { - SG_LOG(SG_GENERAL, SG_INFO, "not reading default configuration files"); - }// of no-default-config selected - + globals->loadUserSettings(dataPath); + } + return flightgear::FG_OPTIONS_OK; }