mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-09 13:35:34 +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 CAircraftModelLoaderXPlane::performParsing(const QString &rootDirectory, const QStringList &excludeDirectories)
|
||||||
{
|
{
|
||||||
CAircraftModelList allModels;
|
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));
|
allModels.push_back(parseFlyableAirplanes(rootDirectory, excludeDirectories));
|
||||||
return allModels;
|
return allModels;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,10 +113,18 @@ namespace BlackMisc
|
|||||||
return QStringList();
|
return QStringList();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CXPlaneUtil::xbusLegacyDir()
|
QString CXPlaneUtil::xbusLegacyDir(const QString &rootDir)
|
||||||
{
|
{
|
||||||
QString legacyPath("/Resources/plugins/xbus/LegacyData");
|
QString legacyPath("/Resources/plugins/xbus/LegacyData");
|
||||||
// Return the first non empty path, we can find.
|
// 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())
|
if (!xplane10Dir().isEmpty())
|
||||||
{
|
{
|
||||||
QString xbusLegacy = xplane10Dir() + legacyPath;
|
QString xbusLegacy = xplane10Dir() + legacyPath;
|
||||||
@@ -125,7 +133,6 @@ namespace BlackMisc
|
|||||||
return xbusLegacy;
|
return xbusLegacy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!xplane9Dir().isEmpty())
|
if (!xplane9Dir().isEmpty())
|
||||||
{
|
{
|
||||||
QString xbusLegacy = xplane9Dir() + legacyPath;
|
QString xbusLegacy = xplane9Dir() + legacyPath;
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ namespace BlackMisc
|
|||||||
static QStringList xplaneModelExcludeDirectoryPatterns();
|
static QStringList xplaneModelExcludeDirectoryPatterns();
|
||||||
|
|
||||||
//! XBus legacy directory
|
//! XBus legacy directory
|
||||||
static QString xbusLegacyDir();
|
static QString xbusLegacyDir(const QString &rootDir);
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
Reference in New Issue
Block a user