mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 16:55:36 +08:00
Ref T660, unify FSX and P3D directory generation (from config files)
* removed unused functions * sxSimObjectsDirPlusAddOnXmlSimObjectsPaths * use simulator directory for FSX (same as P3D) * renamings
This commit is contained in:
@@ -1420,7 +1420,7 @@ namespace BlackMisc
|
|||||||
return msgs;
|
return msgs;
|
||||||
}
|
}
|
||||||
|
|
||||||
CStatusMessageList CAircraftModelList::validateFiles(CAircraftModelList &validModels, CAircraftModelList &invalidModels, bool ignoreEmptyFileNames, int stopAtFailedFiles, bool &stopped, const QString &rootDirectory, bool alreadySortedByFn) const
|
CStatusMessageList CAircraftModelList::validateFiles(CAircraftModelList &validModels, CAircraftModelList &invalidModels, bool ignoreEmptyFileNames, int stopAtFailedFiles, bool &stopped, const QString &simRootDirectory, bool alreadySortedByFn) const
|
||||||
{
|
{
|
||||||
stopped = false;
|
stopped = false;
|
||||||
|
|
||||||
@@ -1434,11 +1434,11 @@ namespace BlackMisc
|
|||||||
if (!alreadySortedByFn) { sorted.sortByFileName(); }
|
if (!alreadySortedByFn) { sorted.sortByFileName(); }
|
||||||
|
|
||||||
const bool caseSensitive = CFileUtils::isFileNameCaseSensitive();
|
const bool caseSensitive = CFileUtils::isFileNameCaseSensitive();
|
||||||
const QString rDir = CFileUtils::normalizeFilePathToQtStandard(
|
const QString simRootDir = CFileUtils::normalizeFilePathToQtStandard(
|
||||||
CFileUtils::stripLeadingSlashOrDriveLetter(
|
CFileUtils::stripLeadingSlashOrDriveLetter(
|
||||||
caseSensitive ? rootDirectory : rootDirectory.toLower()
|
caseSensitive ? simRootDirectory : simRootDirectory.toLower()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
for (const CAircraftModel &model : as_const(sorted))
|
for (const CAircraftModel &model : as_const(sorted))
|
||||||
{
|
{
|
||||||
@@ -1467,9 +1467,10 @@ namespace BlackMisc
|
|||||||
|
|
||||||
if (workingFiles.contains(fn) || model.hasExistingCorrespondingFile())
|
if (workingFiles.contains(fn) || model.hasExistingCorrespondingFile())
|
||||||
{
|
{
|
||||||
if (!rootDirectory.isEmpty() && !fn.contains(rDir))
|
if (!simRootDirectory.isEmpty() && !fn.contains(simRootDir))
|
||||||
{
|
{
|
||||||
msgs.push_back(CStatusMessage(this).validationError(u"'%1', not in root directory '%2', '%3' skipped") << model.getModelStringAndDbKey() << rDir << model.getFileName());
|
// check if in root directory
|
||||||
|
msgs.push_back(CStatusMessage(this).validationError(u"'%1', not in root directory '%2', '%3' skipped") << model.getModelStringAndDbKey() << simRootDir << model.getFileName());
|
||||||
failedFiles.insert(fn);
|
failedFiles.insert(fn);
|
||||||
failedFilesCount++;
|
failedFilesCount++;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -484,7 +484,7 @@ namespace BlackMisc
|
|||||||
CStatusMessageList validateDistributors(const CDistributorList &distributors, CAircraftModelList &validModels, CAircraftModelList &invalidModels) const;
|
CStatusMessageList validateDistributors(const CDistributorList &distributors, CAircraftModelList &validModels, CAircraftModelList &invalidModels) const;
|
||||||
|
|
||||||
//! Validate files (file exists etc.)
|
//! Validate files (file exists etc.)
|
||||||
CStatusMessageList validateFiles(CAircraftModelList &validModels, CAircraftModelList &invalidModels, bool ignoreEmptyFileNames, int stopAtFailedFiles, bool &stopped, const QString &rootDirectory, bool alreadySortedByFn = false) const;
|
CStatusMessageList validateFiles(CAircraftModelList &validModels, CAircraftModelList &invalidModels, bool ignoreEmptyFileNames, int stopAtFailedFiles, bool &stopped, const QString &simRootDirectory, bool alreadySortedByFn = false) const;
|
||||||
|
|
||||||
//! To compact JSON format
|
//! To compact JSON format
|
||||||
QJsonObject toMemoizedJson() const;
|
QJsonObject toMemoizedJson() const;
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ namespace BlackMisc
|
|||||||
CStatusMessageList specificTests;
|
CStatusMessageList specificTests;
|
||||||
if (simulator.isMicrosoftOrPrepare3DSimulator() || models.isLikelyFsFamilyModelList())
|
if (simulator.isMicrosoftOrPrepare3DSimulator() || models.isLikelyFsFamilyModelList())
|
||||||
{
|
{
|
||||||
const CStatusMessageList specificTests1 = FsCommon::CFsCommonUtil::validateConfigFiles(models, validModels, invalidModels, ignoreEmpty, stopAtFailedFiles, stopped);
|
const CStatusMessageList specificTests1 = FsCommon::CFsCommonUtil::validateAircraftConfigFiles(models, validModels, invalidModels, ignoreEmpty, stopAtFailedFiles, stopped);
|
||||||
specificTests.push_back(specificTests1);
|
specificTests.push_back(specificTests1);
|
||||||
|
|
||||||
if (simulator.isP3D())
|
if (simulator.isP3D())
|
||||||
@@ -176,7 +176,7 @@ namespace BlackMisc
|
|||||||
}
|
}
|
||||||
else if (simulator.isFSX())
|
else if (simulator.isFSX())
|
||||||
{
|
{
|
||||||
const CStatusMessageList specificTests2 = FsCommon::CFsCommonUtil::validateFSXSimObjectsPath(models, validModels, invalidModels, ignoreEmpty, stopAtFailedFiles, stopped);
|
const CStatusMessageList specificTests2 = FsCommon::CFsCommonUtil::validateFSXSimObjectsPath(models, validModels, invalidModels, ignoreEmpty, stopAtFailedFiles, stopped, simulatorDir);
|
||||||
specificTests.push_back(specificTests2);
|
specificTests.push_back(specificTests2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,14 +216,38 @@ namespace BlackMisc
|
|||||||
return dir;
|
return dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList CFsCommonUtil::p3dSimObjectsDirPlusAddOnSimObjectsDirs(const QString &simObjectsDir, const QString &versionHint)
|
QStringList CFsCommonUtil::fsxSimObjectsDirPlusAddOnXmlSimObjectsPaths(const QString &simObjectsDir)
|
||||||
{
|
{
|
||||||
// finding the user settings only works on P3D machine
|
// finding the user settings only works on P3D machine
|
||||||
const QSet<QString> allP3dAddOnSimObjectPaths = CFsCommonUtil::allP3dAddOnSimObjectPaths(versionHint);
|
QStringList allPaths = CFsCommonUtil::allFsxSimObjectPaths().toList();
|
||||||
QStringList all(allP3dAddOnSimObjectPaths.toList());
|
const QString sod = simObjectsDir.isEmpty() ? CFsCommonUtil::fsxSimObjectsDir() : simObjectsDir;
|
||||||
all.push_front(simObjectsDir.isEmpty() ? p3dSimObjectsDir() : simObjectsDir);
|
if (!sod.isEmpty() && !allPaths.contains(sod, Qt::CaseInsensitive))
|
||||||
all.sort(Qt::CaseInsensitive);
|
{
|
||||||
return all;
|
// case insensitive is important here
|
||||||
|
allPaths.push_front(sod);
|
||||||
|
}
|
||||||
|
|
||||||
|
allPaths.removeAll({}); // remove all empty
|
||||||
|
allPaths.removeDuplicates();
|
||||||
|
allPaths.sort(Qt::CaseInsensitive);
|
||||||
|
return allPaths;
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList CFsCommonUtil::p3dSimObjectsDirPlusAddOnXmlSimObjectsPaths(const QString &simObjectsDir, const QString &versionHint)
|
||||||
|
{
|
||||||
|
// finding the user settings only works on P3D machine
|
||||||
|
QStringList allPaths = CFsCommonUtil::allP3dAddOnXmlSimObjectPaths(versionHint).toList();
|
||||||
|
const QString sod = simObjectsDir.isEmpty() ? CFsCommonUtil::p3dSimObjectsDir() : simObjectsDir;
|
||||||
|
if (!sod.isEmpty() && !allPaths.contains(sod, Qt::CaseInsensitive))
|
||||||
|
{
|
||||||
|
// case insensitive is important here
|
||||||
|
allPaths.push_front(sod);
|
||||||
|
}
|
||||||
|
|
||||||
|
allPaths.removeAll({}); // remove all empty
|
||||||
|
allPaths.removeDuplicates();
|
||||||
|
allPaths.sort(Qt::CaseInsensitive);
|
||||||
|
return allPaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CFsCommonUtil::p3dSimObjectsDirFromSimDir(const QString &simDir)
|
QString CFsCommonUtil::p3dSimObjectsDirFromSimDir(const QString &simDir)
|
||||||
@@ -472,7 +496,7 @@ namespace BlackMisc
|
|||||||
return paths;
|
return paths;
|
||||||
}
|
}
|
||||||
|
|
||||||
QSet<QString> CFsCommonUtil::allP3dAddOnSimObjectPaths(const QStringList &addOnPaths, bool checked)
|
QSet<QString> CFsCommonUtil::allP3dAddOnXmlSimObjectPaths(const QStringList &addOnPaths, bool checked)
|
||||||
{
|
{
|
||||||
if (addOnPaths.isEmpty()) { return QSet<QString>(); }
|
if (addOnPaths.isEmpty()) { return QSet<QString>(); }
|
||||||
QSet<QString> simObjectPaths;
|
QSet<QString> simObjectPaths;
|
||||||
@@ -513,7 +537,7 @@ namespace BlackMisc
|
|||||||
return simObjectPaths;
|
return simObjectPaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
QSet<QString> CFsCommonUtil::allP3dAddOnSimObjectPaths(const QString &versionHint)
|
QSet<QString> CFsCommonUtil::allP3dAddOnXmlSimObjectPaths(const QString &versionHint)
|
||||||
{
|
{
|
||||||
// all add-ons.cfg files
|
// all add-ons.cfg files
|
||||||
const QStringList addOnConfigFiles = CFsCommonUtil::findP3dAddOnConfigFiles(versionHint).toList();
|
const QStringList addOnConfigFiles = CFsCommonUtil::findP3dAddOnConfigFiles(versionHint).toList();
|
||||||
@@ -521,23 +545,14 @@ namespace BlackMisc
|
|||||||
// all PATH values in those files
|
// all PATH values in those files
|
||||||
const QStringList addOnPaths = CFsCommonUtil::allConfigFilesPathValues(addOnConfigFiles, true, {}).toList();
|
const QStringList addOnPaths = CFsCommonUtil::allConfigFilesPathValues(addOnConfigFiles, true, {}).toList();
|
||||||
|
|
||||||
// based on all paths of all config
|
// based on all paths of all config files search the XML files
|
||||||
const QSet<QString> all = CFsCommonUtil::allP3dAddOnSimObjectPaths(addOnPaths, true);
|
const QSet<QString> all = CFsCommonUtil::allP3dAddOnXmlSimObjectPaths(addOnPaths, true);
|
||||||
return all;
|
return all;
|
||||||
}
|
}
|
||||||
|
|
||||||
QSet<QString> CFsCommonUtil::allP3dSimObjectsConfigPaths(const QString &simulatorDir, const QString &versionHint)
|
QSet<QString> CFsCommonUtil::allFsxSimObjectPaths()
|
||||||
{
|
{
|
||||||
const QStringList configFiles = CFsCommonUtil::findP3dSimObjectsConfigFiles(versionHint).toList();
|
return CFsCommonUtil::fsxSimObjectsPaths(CFsCommonUtil::findFsxConfigFiles(), true);
|
||||||
return CFsCommonUtil::allConfigFilesPathValues(configFiles, true, simulatorDir);
|
|
||||||
}
|
|
||||||
|
|
||||||
QSet<QString> CFsCommonUtil::allP3dSimObjectPaths(const QString &simulatorDir, const QString &versionHint)
|
|
||||||
{
|
|
||||||
const QSet<QString> configFiles = CFsCommonUtil::allP3dSimObjectsConfigPaths(simulatorDir, versionHint);
|
|
||||||
const QSet<QString> addOnFiles = CFsCommonUtil::allP3dAddOnSimObjectPaths(versionHint);
|
|
||||||
QSet<QString> all(configFiles);
|
|
||||||
return all.unite(addOnFiles);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList CFsCommonUtil::findFsxConfigFiles()
|
QStringList CFsCommonUtil::findFsxConfigFiles()
|
||||||
@@ -594,13 +609,13 @@ namespace BlackMisc
|
|||||||
return paths;
|
return paths;
|
||||||
}
|
}
|
||||||
|
|
||||||
CStatusMessageList CFsCommonUtil::validateConfigFiles(const CAircraftModelList &models, CAircraftModelList &validModels, CAircraftModelList &invalidModels, bool ignoreEmptyFileNames, int stopAtFailedFiles, bool &stopped)
|
CStatusMessageList CFsCommonUtil::validateAircraftConfigFiles(const CAircraftModelList &models, CAircraftModelList &validModels, CAircraftModelList &invalidModels, bool ignoreEmptyFileNames, int stopAtFailedFiles, bool &stopped)
|
||||||
{
|
{
|
||||||
CStatusMessage m;
|
CStatusMessage m;
|
||||||
CAircraftModelList sorted(models);
|
CAircraftModelList sorted(models);
|
||||||
sorted.sortByFileName();
|
sorted.sortByFileName();
|
||||||
stopped = false;
|
stopped = false;
|
||||||
CStatusMessageList msgs = sorted.validateFiles(validModels, invalidModels, ignoreEmptyFileNames, stopAtFailedFiles, stopped, "", true);
|
CStatusMessageList msgs = sorted.validateFiles(validModels, invalidModels, ignoreEmptyFileNames, stopAtFailedFiles, stopped, QString(), true);
|
||||||
if (stopped || validModels.isEmpty()) { return msgs; }
|
if (stopped || validModels.isEmpty()) { return msgs; }
|
||||||
|
|
||||||
const CAircraftModelList nonFsModels = validModels.findNonFsFamilyModels();
|
const CAircraftModelList nonFsModels = validModels.findNonFsFamilyModels();
|
||||||
@@ -658,14 +673,16 @@ namespace BlackMisc
|
|||||||
|
|
||||||
CStatusMessageList CFsCommonUtil::validateP3DSimObjectsPath(const CAircraftModelList &models, CAircraftModelList &validModels, CAircraftModelList &invalidModels, bool ignoreEmptyFileNames, int stopAtFailedFiles, bool &stopped, const QString &simulatorDir)
|
CStatusMessageList CFsCommonUtil::validateP3DSimObjectsPath(const CAircraftModelList &models, CAircraftModelList &validModels, CAircraftModelList &invalidModels, bool ignoreEmptyFileNames, int stopAtFailedFiles, bool &stopped, const QString &simulatorDir)
|
||||||
{
|
{
|
||||||
const QSet<QString> simObjectDirs = CFsCommonUtil::allP3dSimObjectPaths(simulatorDir, "v4");
|
const QString simObjectsDir = simulatorDir.isEmpty() ? CFsCommonUtil::p3dSimObjectsDir() : CFsCommonUtil::p3dSimObjectsDirFromSimDir(simulatorDir);
|
||||||
return CFsCommonUtil::validateSimObjectsPath(simObjectDirs, models, validModels, invalidModels, ignoreEmptyFileNames, stopAtFailedFiles, stopped);
|
const QSet<QString> simObjectPaths = CFsCommonUtil::p3dSimObjectsDirPlusAddOnXmlSimObjectsPaths(simObjectsDir, "v4").toSet();
|
||||||
|
return CFsCommonUtil::validateSimObjectsPath(simObjectPaths, models, validModels, invalidModels, ignoreEmptyFileNames, stopAtFailedFiles, stopped);
|
||||||
}
|
}
|
||||||
|
|
||||||
CStatusMessageList CFsCommonUtil::validateFSXSimObjectsPath(const CAircraftModelList &models, CAircraftModelList &validModels, CAircraftModelList &invalidModels, bool ignoreEmptyFileNames, int stopAtFailedFiles, bool &stopped)
|
CStatusMessageList CFsCommonUtil::validateFSXSimObjectsPath(const CAircraftModelList &models, CAircraftModelList &validModels, CAircraftModelList &invalidModels, bool ignoreEmptyFileNames, int stopAtFailedFiles, bool &stopped, const QString &simulatorDir)
|
||||||
{
|
{
|
||||||
const QSet<QString> simObjectDirs = CFsCommonUtil::fsxSimObjectsPaths(CFsCommonUtil::findFsxConfigFiles(), true);
|
Q_UNUSED(simulatorDir);
|
||||||
return CFsCommonUtil::validateSimObjectsPath(simObjectDirs, models, validModels, invalidModels, ignoreEmptyFileNames, stopAtFailedFiles, stopped);
|
const QSet<QString> simObjectPaths = CFsCommonUtil::fsxSimObjectsDirPlusAddOnXmlSimObjectsPaths().toSet();
|
||||||
|
return CFsCommonUtil::validateSimObjectsPath(simObjectPaths, models, validModels, invalidModels, ignoreEmptyFileNames, stopAtFailedFiles, stopped);
|
||||||
}
|
}
|
||||||
|
|
||||||
CStatusMessageList CFsCommonUtil::validateSimObjectsPath(
|
CStatusMessageList CFsCommonUtil::validateSimObjectsPath(
|
||||||
@@ -673,22 +690,24 @@ namespace BlackMisc
|
|||||||
CAircraftModelList &validModels, CAircraftModelList &invalidModels,
|
CAircraftModelList &validModels, CAircraftModelList &invalidModels,
|
||||||
bool ignoreEmptyFileNames, int stopAtFailedFiles, bool &stopped)
|
bool ignoreEmptyFileNames, int stopAtFailedFiles, bool &stopped)
|
||||||
{
|
{
|
||||||
CAircraftModelList sorted(models);
|
|
||||||
sorted.sortByFileName();
|
|
||||||
CStatusMessageList msgs;
|
CStatusMessageList msgs;
|
||||||
if (sorted.isEmpty())
|
|
||||||
{
|
|
||||||
msgs.push_back(CStatusMessage(getLogCategories()).validationInfo(u"No models to validate"));
|
|
||||||
return msgs;
|
|
||||||
}
|
|
||||||
if (simObjectDirs.isEmpty())
|
if (simObjectDirs.isEmpty())
|
||||||
{
|
{
|
||||||
msgs.push_back(CStatusMessage(getLogCategories()).validationInfo(u"No SimObject directories from cfg files, skipping validation"));
|
msgs.push_back(CStatusMessage(getLogCategories()).validationInfo(u"No SimObject directories from cfg files, skipping validation"));
|
||||||
return msgs;
|
return msgs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CAircraftModelList sortedModels(models);
|
||||||
|
sortedModels.sortByFileName();
|
||||||
|
if (sortedModels.isEmpty())
|
||||||
|
{
|
||||||
|
msgs.push_back(CStatusMessage(getLogCategories()).validationInfo(u"No models to validate"));
|
||||||
|
return msgs;
|
||||||
|
}
|
||||||
|
|
||||||
// info
|
// info
|
||||||
msgs.push_back(CStatusMessage(getLogCategories()).validationInfo(u"Validating %1 models against %2 SimObject paths: %3") << models.size() << simObjectDirs.size() << joinStringSet(simObjectDirs, ", "));
|
const QString simObjDirs = joinStringSet(simObjectDirs, ", ");
|
||||||
|
msgs.push_back(CStatusMessage(getLogCategories()).validationInfo(u"Validating %1 models against %2 SimObject paths: '%3'") << models.size() << simObjectDirs.size() << simObjDirs);
|
||||||
|
|
||||||
// validate
|
// validate
|
||||||
int failed = 0;
|
int failed = 0;
|
||||||
|
|||||||
@@ -52,6 +52,12 @@ namespace BlackMisc
|
|||||||
//! Exclude directories for simObjects
|
//! Exclude directories for simObjects
|
||||||
static const QStringList &fsxSimObjectsExcludeDirectoryPatterns();
|
static const QStringList &fsxSimObjectsExcludeDirectoryPatterns();
|
||||||
|
|
||||||
|
//! FSX's simObject dir and the add on dirs
|
||||||
|
static QStringList fsxSimObjectsDirPlusAddOnXmlSimObjectsPaths(const QString &simObjectsDir = "");
|
||||||
|
|
||||||
|
//! P3D's simObject dir and the add on dirs
|
||||||
|
static QStringList p3dSimObjectsDirPlusAddOnXmlSimObjectsPaths(const QString &simObjectsDir = "", const QString &versionHint = "v4");
|
||||||
|
|
||||||
//! P3D directory obtained from registry
|
//! P3D directory obtained from registry
|
||||||
static const QString &p3dDirFromRegistry();
|
static const QString &p3dDirFromRegistry();
|
||||||
|
|
||||||
@@ -64,9 +70,6 @@ namespace BlackMisc
|
|||||||
//! P3D's simObject dir, resolved from multiple sources
|
//! P3D's simObject dir, resolved from multiple sources
|
||||||
static const QString &p3dSimObjectsDir();
|
static const QString &p3dSimObjectsDir();
|
||||||
|
|
||||||
//! P3D's simObject dir and the add on dirs
|
|
||||||
static QStringList p3dSimObjectsDirPlusAddOnSimObjectsDirs(const QString &simObjectsDir = "", const QString &versionHint = "v4");
|
|
||||||
|
|
||||||
//! P3D aircraft dir, relative to simulator directory
|
//! P3D aircraft dir, relative to simulator directory
|
||||||
static QString p3dSimObjectsDirFromSimDir(const QString &simDir);
|
static QString p3dSimObjectsDirFromSimDir(const QString &simDir);
|
||||||
|
|
||||||
@@ -113,20 +116,17 @@ namespace BlackMisc
|
|||||||
//! All PATH values from the config files
|
//! All PATH values from the config files
|
||||||
static QSet<QString> allConfigFilesPathValues(const QStringList &configFiles, bool checked, const QString &pathPrefix);
|
static QSet<QString> allConfigFilesPathValues(const QStringList &configFiles, bool checked, const QString &pathPrefix);
|
||||||
|
|
||||||
//! All add-on paths from the config files
|
//! All add-on paths from the XML add-on files "add-on.xml"
|
||||||
static QSet<QString> allP3dAddOnSimObjectPaths(const QStringList &addOnPaths, bool checked);
|
static QSet<QString> allP3dAddOnXmlSimObjectPaths(const QStringList &addOnPaths, bool checked);
|
||||||
|
|
||||||
//! All add-on paths from the config files
|
//! All add-on paths from the XML add-on files "add-on.xml" files, use CFsCommonUtil::findP3dAddOnConfigFiles to find config files
|
||||||
static QSet<QString> allP3dAddOnSimObjectPaths(const QString &versionHint = "v4");
|
static QSet<QString> allP3dAddOnXmlSimObjectPaths(const QString &versionHint = "v4");
|
||||||
|
|
||||||
//! All paths from the simobjects.cfg files
|
//! Get all the SimObjects paths from all config files
|
||||||
static QSet<QString> allP3dSimObjectsConfigPaths(const QString &simulatorDir, const QString &versionHint = "v4");
|
static QSet<QString> allFsxSimObjectPaths();
|
||||||
|
|
||||||
//! All add-on paths from the config files and the simobjects.cfg files
|
|
||||||
static QSet<QString> allP3dSimObjectPaths(const QString &simulatorDir, const QString &versionHint = "v4");
|
|
||||||
|
|
||||||
//! Find the config files (fsx.cfg)
|
//! Find the config files (fsx.cfg)
|
||||||
// C:/Users/Joe Doe/AppData/Roaming/Lockheed Martin/Prepar3D v4
|
// C:/Users/Joe Doe/AppData/Roaming/Microsoft/FSX/fsx.cfg
|
||||||
static QStringList findFsxConfigFiles();
|
static QStringList findFsxConfigFiles();
|
||||||
|
|
||||||
//! Get all the SimObjects paths from fsx.cfg
|
//! Get all the SimObjects paths from fsx.cfg
|
||||||
@@ -137,9 +137,9 @@ namespace BlackMisc
|
|||||||
// SimObjectPaths.0=SimObjects\Airplanes
|
// SimObjectPaths.0=SimObjects\Airplanes
|
||||||
static QSet<QString> fsxSimObjectsPaths(const QString &fsxFile, bool checked);
|
static QSet<QString> fsxSimObjectsPaths(const QString &fsxFile, bool checked);
|
||||||
|
|
||||||
//! Validate aircraft.cfg entries
|
//! Validate aircraft.cfg entries (sometimes also sim.cfg)
|
||||||
//! \remark only for FSX/P3D/FS9 models
|
//! \remark only for FSX/P3D/FS9 models
|
||||||
static CStatusMessageList validateConfigFiles(const CAircraftModelList &models, CAircraftModelList &validModels, CAircraftModelList &invalidModels, bool ignoreEmptyFileNames, int stopAtFailedFiles, bool &stopped);
|
static CStatusMessageList validateAircraftConfigFiles(const CAircraftModelList &models, CAircraftModelList &validModels, CAircraftModelList &invalidModels, bool ignoreEmptyFileNames, int stopAtFailedFiles, bool &stopped);
|
||||||
|
|
||||||
//! Validate if known SimObjects path are used
|
//! Validate if known SimObjects path are used
|
||||||
//! \remark only for P3D
|
//! \remark only for P3D
|
||||||
@@ -147,7 +147,7 @@ namespace BlackMisc
|
|||||||
|
|
||||||
//! Validate if known SimObjects path are used
|
//! Validate if known SimObjects path are used
|
||||||
//! \remark only for FSX
|
//! \remark only for FSX
|
||||||
static CStatusMessageList validateFSXSimObjectsPath(const CAircraftModelList &models, CAircraftModelList &validModels, CAircraftModelList &invalidModels, bool ignoreEmptyFileNames, int stopAtFailedFiles, bool &stopped);
|
static CStatusMessageList validateFSXSimObjectsPath(const CAircraftModelList &models, CAircraftModelList &validModels, CAircraftModelList &invalidModels, bool ignoreEmptyFileNames, int stopAtFailedFiles, bool &stopped, const QString &simulatorDir);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//! Utility functions @{
|
//! Utility functions @{
|
||||||
@@ -155,7 +155,7 @@ namespace BlackMisc
|
|||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
//! Validate if known SimObjects path are used
|
//! Validate if known SimObjects path are used
|
||||||
//! \remark only for P3D
|
//! \remark only for P3D/FSX
|
||||||
static CStatusMessageList validateSimObjectsPath(const QSet<QString> &simObjectDirs, const CAircraftModelList &models, CAircraftModelList &validModels, CAircraftModelList &invalidModels, bool ignoreEmptyFileNames, int stopAtFailedFiles, bool &stopped);
|
static CStatusMessageList validateSimObjectsPath(const QSet<QString> &simObjectDirs, const CAircraftModelList &models, CAircraftModelList &validModels, CAircraftModelList &invalidModels, bool ignoreEmptyFileNames, int stopAtFailedFiles, bool &stopped);
|
||||||
|
|
||||||
//! Log the reading of config files
|
//! Log the reading of config files
|
||||||
|
|||||||
@@ -561,11 +561,13 @@ namespace BlackMisc
|
|||||||
QStringList dirs;
|
QStringList dirs;
|
||||||
switch (m_simulator.getSimulator())
|
switch (m_simulator.getSimulator())
|
||||||
{
|
{
|
||||||
case CSimulatorInfo::FG: dirs = QStringList(CFlightgearUtil::modelDirectoriesFromSimDir(s)); break;
|
case CSimulatorInfo::FG: dirs = QStringList(CFlightgearUtil::modelDirectoriesFromSimDir(s)); break;
|
||||||
case CSimulatorInfo::FS9: dirs = QStringList({CFsCommonUtil::fs9AircraftDirFromSimDir(s)}); break;
|
case CSimulatorInfo::FS9: dirs = QStringList({CFsCommonUtil::fs9AircraftDirFromSimDir(s)}); break;
|
||||||
case CSimulatorInfo::FSX: dirs = QStringList({CFsCommonUtil::fsxSimObjectsDirFromSimDir(s)}); break;
|
case CSimulatorInfo::FSX:
|
||||||
|
dirs = CFsCommonUtil::fsxSimObjectsDirPlusAddOnXmlSimObjectsPaths(CFsCommonUtil::fsxSimObjectsDirFromSimDir(s));
|
||||||
|
break;
|
||||||
case CSimulatorInfo::P3D:
|
case CSimulatorInfo::P3D:
|
||||||
dirs = QStringList(CFsCommonUtil::p3dSimObjectsDirPlusAddOnSimObjectsDirs(CFsCommonUtil::p3dSimObjectsDirFromSimDir(s)));
|
dirs = CFsCommonUtil::p3dSimObjectsDirPlusAddOnXmlSimObjectsPaths(CFsCommonUtil::p3dSimObjectsDirFromSimDir(s));
|
||||||
break;
|
break;
|
||||||
case CSimulatorInfo::XPLANE: dirs = QStringList({CXPlaneUtil::modelDirectoriesFromSimDir(s)}); break;
|
case CSimulatorInfo::XPLANE: dirs = QStringList({CXPlaneUtil::modelDirectoriesFromSimDir(s)}); break;
|
||||||
default: break;
|
default: break;
|
||||||
@@ -645,13 +647,13 @@ namespace BlackMisc
|
|||||||
case CSimulatorInfo::FSX:
|
case CSimulatorInfo::FSX:
|
||||||
{
|
{
|
||||||
if (CFsCommonUtil::fsxSimObjectsDir().isEmpty()) { return e; }
|
if (CFsCommonUtil::fsxSimObjectsDir().isEmpty()) { return e; }
|
||||||
static const QStringList md({ CFsCommonUtil::fsxSimObjectsDir() });
|
static const QStringList md = CFsCommonUtil::fsxSimObjectsDirPlusAddOnXmlSimObjectsPaths();
|
||||||
return md;
|
return md;
|
||||||
}
|
}
|
||||||
case CSimulatorInfo::P3D:
|
case CSimulatorInfo::P3D:
|
||||||
{
|
{
|
||||||
if (CFsCommonUtil::p3dSimObjectsDir().isEmpty()) { return e; }
|
if (CFsCommonUtil::p3dSimObjectsDir().isEmpty()) { return e; }
|
||||||
static const QStringList md = CFsCommonUtil::p3dSimObjectsDirPlusAddOnSimObjectsDirs();
|
static const QStringList md = CFsCommonUtil::p3dSimObjectsDirPlusAddOnXmlSimObjectsPaths();
|
||||||
return md;
|
return md;
|
||||||
}
|
}
|
||||||
case CSimulatorInfo::XPLANE:
|
case CSimulatorInfo::XPLANE:
|
||||||
|
|||||||
Reference in New Issue
Block a user