mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
Ref T125, X-Plan utility functions and moved XSwiftBus settings in own file
This commit is contained in:
committed by
Mathew Sutcliffe
parent
104d869c19
commit
65bd2d20ad
@@ -89,6 +89,7 @@ namespace BlackMisc
|
||||
|
||||
QString CXPlaneUtil::xplaneDir(const QString &xplaneInstallFile)
|
||||
{
|
||||
//! \fixme KB 8/17 we could also use the runtime CBuildConfig decision here, which looks nicer (I personally always try to avoid ifdef)
|
||||
#if defined(Q_OS_WIN)
|
||||
return CFileUtils::appendFilePaths(getWindowsLocalAppDataPath(), xplaneInstallFile);
|
||||
#elif defined (Q_OS_LINUX)
|
||||
@@ -108,6 +109,25 @@ namespace BlackMisc
|
||||
else { return {}; }
|
||||
}
|
||||
|
||||
bool CXPlaneUtil::isXplaneRootDirExisting()
|
||||
{
|
||||
const QDir dir(xplaneRootDir());
|
||||
return dir.exists();
|
||||
}
|
||||
|
||||
QString CXPlaneUtil::xplanePluginDir()
|
||||
{
|
||||
const QString xp = xplaneRootDir();
|
||||
if (xp.isEmpty()) { return xp; }
|
||||
return CFileUtils::appendFilePaths(xp, "/Resources/plugins");
|
||||
}
|
||||
|
||||
bool CXPlaneUtil::isXplanePluginDirDirExisting()
|
||||
{
|
||||
const QDir dir(xplanePluginDir());
|
||||
return dir.exists();
|
||||
}
|
||||
|
||||
QStringList CXPlaneUtil::xplaneModelDirectories()
|
||||
{
|
||||
if (xplaneRootDir().isEmpty()) { return QStringList(); }
|
||||
@@ -142,7 +162,6 @@ namespace BlackMisc
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user