Browse Source

Merge pull request #939 from mavlink/fgfsargumentinit

correctly init argument list for fgfs on connection
QGC4.4
Don Gagne 11 years ago
parent
commit
59f4721c05
  1. 30
      src/comm/QGCFlightGearLink.cc

30
src/comm/QGCFlightGearLink.cc

@ -629,6 +629,21 @@ bool QGCFlightGearLink::connectSimulation() @@ -629,6 +629,21 @@ bool QGCFlightGearLink::connectSimulation()
bool fgSceneryDirOverride = false; // true: User has specified --fg-scenery from ui options
QDir fgAppDir; // Location of main FlightGear application
// Reset the list of arguments which will be provided to FG to the arguments set by the user via the UI
// First split the space seperated command line arguments coming in from the ui into a QStringList since
// that is what QProcess::start needs.
QStringList uiArgList;
bool mismatchedQuotes = parseUIArguments(startupArguments, uiArgList);
if (!mismatchedQuotes) {
MainWindow::instance()->showCriticalMessage(tr("FlightGear settings"), tr("Mismatched quotes in specified command line options"));
return false;
}
#ifdef DEBUG_FLIGHTGEAR_CONNECT
qDebug() << "\nSplit arguments" << uiArgList << "\n";
#endif
// Now set the FG arguments to the arguments from the UI
_fgArgList = uiArgList;
#if defined Q_OS_MACX
// Mac installs will default to the /Applications folder 99% of the time. Anything other than
// that is pretty non-standard so we don't try to get fancy beyond hardcoding that path.
@ -745,21 +760,6 @@ bool QGCFlightGearLink::connectSimulation() @@ -745,21 +760,6 @@ bool QGCFlightGearLink::connectSimulation()
}
#endif
// Split the space seperated command line arguments coming in from the ui into a QStringList since
// that is what QProcess::start needs.
QStringList uiArgList;
bool mismatchedQuotes = parseUIArguments(startupArguments, uiArgList);
if (!mismatchedQuotes) {
MainWindow::instance()->showCriticalMessage(tr("FlightGear settings"), tr("Mismatched quotes in specified command line options"));
return false;
}
// Add the user specified arguments to our argument list
#ifdef DEBUG_FLIGHTGEAR_CONNECT
qDebug() << "\nSplit arguments" << uiArgList << "\n";
#endif
_fgArgList += uiArgList;
// If we have an --fg-root coming in from the ui options, that setting overrides any internal searching of
// proposed locations.
QString argValue;

Loading…
Cancel
Save