Fix —show-aircraft with multiple aircraft dirs
Patch from Jens Thoms Toerring
This commit is contained in:
parent
7b62f6ce2f
commit
73de4aeb86
1 changed files with 23 additions and 7 deletions
|
@ -251,9 +251,11 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void show(const SGPath& path)
|
void show(const vector<SGPath> & path_list)
|
||||||
{
|
{
|
||||||
visitDir(path, 0);
|
for (vector<SGPath>::const_iterator p = path_list.begin();
|
||||||
|
p != path_list.end(); ++p)
|
||||||
|
visitDir(*p, 0);
|
||||||
|
|
||||||
simgear::requestConsole(); // ensure console is shown on Windows
|
simgear::requestConsole(); // ensure console is shown on Windows
|
||||||
|
|
||||||
|
@ -348,10 +350,10 @@ private:
|
||||||
*
|
*
|
||||||
* @parampath the directory to search for configuration files
|
* @parampath the directory to search for configuration files
|
||||||
*/
|
*/
|
||||||
void fgShowAircraft(const SGPath &path)
|
void fgShowAircraft(const vector<SGPath> &path_list)
|
||||||
{
|
{
|
||||||
ShowAircraft s;
|
ShowAircraft s;
|
||||||
s.show(path);
|
s.show(path_list);
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
cout << "Hit a key to continue..." << endl;
|
cout << "Hit a key to continue..." << endl;
|
||||||
|
@ -1994,10 +1996,24 @@ void Options::initAircraft()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p->showAircraft) {
|
if (p->showAircraft) {
|
||||||
|
vector<SGPath> path_list;
|
||||||
|
|
||||||
fgOptLogLevel( "alert" );
|
fgOptLogLevel( "alert" );
|
||||||
SGPath path( globals->get_fg_root() );
|
|
||||||
path.append("Aircraft");
|
// First place to check is the 'Aircraft' sub-directory in $FG_ROOT
|
||||||
fgShowAircraft(path);
|
|
||||||
|
path_list.push_back( SGPath( globals->get_fg_root() ) );
|
||||||
|
path_list.back().append("Aircraft");
|
||||||
|
|
||||||
|
// Additionally, aircraft may also be found in user-defined places
|
||||||
|
// (via $FG_AIRCRAFT or with the '--fg-aircraft' option)
|
||||||
|
|
||||||
|
string_list aircraft_paths = globals->get_aircraft_paths();
|
||||||
|
for (string_list::iterator it = aircraft_paths.begin();
|
||||||
|
it != aircraft_paths.end(); ++it)
|
||||||
|
path_list.push_back( SGPath(*it));
|
||||||
|
|
||||||
|
fgShowAircraft(path_list);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue