Ref T125, X-Plan utility functions and moved XSwiftBus settings in own file

This commit is contained in:
Klaus Basan
2017-08-12 13:21:33 +02:00
committed by Mathew Sutcliffe
parent 104d869c19
commit 65bd2d20ad
4 changed files with 75 additions and 2 deletions

View File

@@ -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