diff --git a/src/Main/fg_props.hxx b/src/Main/fg_props.hxx index 0a060d314..9eec5fbdb 100644 --- a/src/Main/fg_props.hxx +++ b/src/Main/fg_props.hxx @@ -850,22 +850,5 @@ fgTie (const char * name, T * obj, int index, "Failed to tie property " << name << " to indexed object methods"); } - -class FGMakeUpperCase : public SGPropertyChangeListener { -public: - void valueChanged(SGPropertyNode *node) { - if (node->getType() != simgear::props::STRING) - return; - - std::string value = node->getStringValue(); - std::string value_orig = value; - std::transform(value.begin(), value.end(), value.begin(), ::toupper); - if (value != value_orig) { - node->setStringValue(value); - } - } -}; - - #endif // __FG_PROPS_HXX diff --git a/src/Main/main.cxx b/src/Main/main.cxx index be56f1e49..b94f1133b 100755 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -485,25 +485,6 @@ void fgInitSecureMode() SGPropertyNode::PROTECTED); } -static void upper_case_property(const char *name) -{ - using namespace simgear; - SGPropertyNode *p = fgGetNode(name, false); - if (!p) { - p = fgGetNode(name, true); - p->setStringValue(""); - } else { - props::Type t = p->getType(); - if (t == props::NONE || t == props::UNSPECIFIED) - p->setStringValue(""); - else - assert(t == props::STRING); - } - SGPropertyChangeListener* muc = new FGMakeUpperCase; - globals->addListenerToCleanup(muc); - p->addChangeListener(muc); -} - // this hack is needed to avoid weird viewport sizing within OSG on Windows. // still required as of March 2017, sad times. // see for example https://sourceforge.net/p/flightgear/codetickets/1958/ @@ -687,9 +668,6 @@ int fgMainInit( int argc, char **argv ) globals->set_channel_options_list( col ); fgValidatePath(globals->get_fg_home(), false); // initialize static variables - upper_case_property("/sim/presets/airport-id"); - upper_case_property("/sim/presets/runway"); - upper_case_property("/sim/tower/airport-id"); if (showLauncher) { // to minimise strange interactions when launcher and config files diff --git a/src/Main/options.cxx b/src/Main/options.cxx index 0ee0ae0d7..038109d90 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -1446,7 +1446,7 @@ fgOptScenario( const char *arg ) static int fgOptAirport( const char *arg ) { - fgSetString("/sim/presets/airport-id", arg ); + fgSetString("/sim/presets/airport-id", simgear::strutils::uppercase({arg}) ); fgSetBool("/sim/presets/airport-requested", true ); return FG_OPTIONS_OK; } @@ -1454,7 +1454,7 @@ fgOptAirport( const char *arg ) static int fgOptRunway( const char *arg ) { - fgSetString("/sim/presets/runway", arg ); + fgSetString("/sim/presets/runway", simgear::strutils::uppercase({arg}) ); fgSetBool("/sim/presets/runway-requested", true ); return FG_OPTIONS_OK; }