mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-18 11:25:33 +08:00
refs #868 Add CXPlaneUtil::xplane11Dir()
This commit is contained in:
committed by
Mathew Sutcliffe
parent
3432dd56fe
commit
f25d569ae8
@@ -95,9 +95,24 @@ namespace BlackMisc
|
|||||||
return getLastExistingPathFromFile(xplaneInstallFilePath);
|
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()
|
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 if (!xplane9Dir().isEmpty()) { return xplane9Dir(); }
|
||||||
else { return {}; }
|
else { return {}; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,9 @@ namespace BlackMisc
|
|||||||
//! XPlane 10 directory
|
//! XPlane 10 directory
|
||||||
static QString xplane10Dir();
|
static QString xplane10Dir();
|
||||||
|
|
||||||
|
//! XPlane 11 directory
|
||||||
|
static QString xplane11Dir();
|
||||||
|
|
||||||
//! XPlane root directory
|
//! XPlane root directory
|
||||||
//! In case more then one XPlane version is found, the path to the highest version is used
|
//! In case more then one XPlane version is found, the path to the highest version is used
|
||||||
static QString xplaneRootDir();
|
static QString xplaneRootDir();
|
||||||
|
|||||||
Reference in New Issue
Block a user