diff --git a/src/blackmisc/simulation/xplane/xplaneutil.cpp b/src/blackmisc/simulation/xplane/xplaneutil.cpp index 35809ac91..3c1f4d59a 100644 --- a/src/blackmisc/simulation/xplane/xplaneutil.cpp +++ b/src/blackmisc/simulation/xplane/xplaneutil.cpp @@ -95,9 +95,24 @@ namespace BlackMisc return getLastExistingPathFromFile(xplaneInstallFilePath); } + QString CXPlaneUtil::xplane11Dir() + { + QString xplaneInstallFilePath; + QString xplaneInstallFile = QStringLiteral("/x-plane_install_11.txt"); +#if defined(Q_OS_WIN) + xplaneInstallFilePath = getWindowsLocalAppDataPath() + xplaneInstallFile; +#elif defined (Q_OS_LINUX) + xplaneInstallFilePath = QDir::homePath() + QStringLiteral("/.x-plane") + xplaneInstallFile; +#elif defined (Q_OS_OSX) + xplaneInstallFilePath = QDir::homePath() + QStringLiteral("/Library/Preferences") + xplaneInstallFile; +#endif + return getLastExistingPathFromFile(xplaneInstallFilePath); + } + QString CXPlaneUtil::xplaneRootDir() { - if (!xplane10Dir().isEmpty()) { return xplane10Dir(); } + if (!xplane11Dir().isEmpty()) { return xplane11Dir(); } + else if (!xplane10Dir().isEmpty()) { return xplane10Dir(); } else if (!xplane9Dir().isEmpty()) { return xplane9Dir(); } else { return {}; } } diff --git a/src/blackmisc/simulation/xplane/xplaneutil.h b/src/blackmisc/simulation/xplane/xplaneutil.h index 5461ab14c..3619d77ed 100644 --- a/src/blackmisc/simulation/xplane/xplaneutil.h +++ b/src/blackmisc/simulation/xplane/xplaneutil.h @@ -35,6 +35,9 @@ namespace BlackMisc //! XPlane 10 directory static QString xplane10Dir(); + //! XPlane 11 directory + static QString xplane11Dir(); + //! XPlane root directory //! In case more then one XPlane version is found, the path to the highest version is used static QString xplaneRootDir();