mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
refs #747 It must be possible to load CSL models from a user-supplied directory.
This commit is contained in:
@@ -138,7 +138,8 @@ namespace BlackMisc
|
||||
CAircraftModelList CAircraftModelLoaderXPlane::performParsing(const QString &rootDirectory, const QStringList &excludeDirectories)
|
||||
{
|
||||
CAircraftModelList allModels;
|
||||
allModels.push_back(parseCslPackages(CXPlaneUtil::xbusLegacyDir(), excludeDirectories));
|
||||
allModels.push_back(parseCslPackages(CXPlaneUtil::xbusLegacyDir(rootDirectory), excludeDirectories));
|
||||
allModels.push_back(parseCslPackages(rootDirectory, excludeDirectories));
|
||||
allModels.push_back(parseFlyableAirplanes(rootDirectory, excludeDirectories));
|
||||
return allModels;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace BlackMisc
|
||||
static QStringList xplaneModelExcludeDirectoryPatterns();
|
||||
|
||||
//! XBus legacy directory
|
||||
static QString xbusLegacyDir();
|
||||
static QString xbusLegacyDir(const QString &rootDir);
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user