refs #747 It must be possible to load CSL models from a user-supplied directory.

This commit is contained in:
Mathew Sutcliffe
2016-08-28 02:18:38 +01:00
parent 80dc4ea49a
commit 520f593d51
3 changed files with 12 additions and 4 deletions

View File

@@ -113,10 +113,18 @@ namespace BlackMisc
return QStringList();
}
QString CXPlaneUtil::xbusLegacyDir()
QString CXPlaneUtil::xbusLegacyDir(const QString &rootDir)
{
QString legacyPath("/Resources/plugins/xbus/LegacyData");
// Return the first non empty path, we can find.
if (!rootDir.isEmpty())
{
QString xbusLegacy = rootDir + legacyPath;
if (QDir(xbusLegacy).exists())
{
return xbusLegacy;
}
}
if (!xplane10Dir().isEmpty())
{
QString xbusLegacy = xplane10Dir() + legacyPath;
@@ -125,7 +133,6 @@ namespace BlackMisc
return xbusLegacy;
}
}
if (!xplane9Dir().isEmpty())
{
QString xbusLegacy = xplane9Dir() + legacyPath;