From 0aff4103df1254d345c3120dfd590436a6360865 Mon Sep 17 00:00:00 2001 From: Andreas Antener Date: Sun, 1 Nov 2015 13:35:24 +0100 Subject: [PATCH] check for new and old flightgear path --- src/comm/QGCFlightGearLink.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/comm/QGCFlightGearLink.cc b/src/comm/QGCFlightGearLink.cc index 7528cf7bc..3fb78aad7 100644 --- a/src/comm/QGCFlightGearLink.cc +++ b/src/comm/QGCFlightGearLink.cc @@ -133,7 +133,7 @@ void QGCFlightGearLink::run() // On Windows we need to full qualify the location of the excecutable. The call to setWorkingDirectory only // sets the QProcess context, not the QProcess::start context. For some strange reason this is not the case on // OSX. - QDir fgProcessFullyQualified(_fgProcessWorkingDirPath); + QDir fgProcessFullyQualified(_fgProcessWorkingDirPath); _fgProcessName = fgProcessFullyQualified.absoluteFilePath(_fgProcessName); #endif @@ -663,8 +663,14 @@ bool QGCFlightGearLink::connectSimulation() // that is pretty non-standard so we don't try to get fancy beyond hardcoding that path. fgAppDir.setPath("/Applications"); fgAppName = "FlightGear.app"; + // new path _fgProcessName = "./fgfs"; _fgProcessWorkingDirPath = "/Applications/FlightGear.app/Contents/MacOS/"; + if(!QFileInfo(_fgProcessWorkingDirPath + _fgProcessName).exists()){ + // old path + _fgProcessName = "./fgfs.sh"; + _fgProcessWorkingDirPath = "/Applications/FlightGear.app/Contents/Resources/"; + } fgRootPathProposedList += "/Applications/FlightGear.app/Contents/Resources/data/"; #elif defined Q_OS_WIN32 _fgProcessName = "fgfs.exe"; -- 2.22.0