mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-08-04 16:22:52 +08:00
refs #917, validate simulator setting
This commit is contained in:
committed by
Mathew Sutcliffe
parent
f816c927ee
commit
d214739912
@@ -54,6 +54,19 @@ namespace BlackCore
|
||||
static const QStringList enabledSimulators(BlackMisc::Simulation::CSimulatorPluginInfo::guessDefaultPlugins());
|
||||
return enabledSimulators;
|
||||
}
|
||||
|
||||
//! Simulator plugin identifiers valid?
|
||||
static bool isValid(const QStringList &pluginIdentifiers)
|
||||
{
|
||||
for (const QString &pluginIdentifier : pluginIdentifiers)
|
||||
{
|
||||
if (!BlackMisc::Simulation::CSimulatorPluginInfo::allIdentifiers().contains(pluginIdentifier))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
//! Uploading of crash dumps is enabled or disabled
|
||||
|
||||
@@ -74,6 +74,18 @@ namespace BlackMisc
|
||||
return s;
|
||||
}
|
||||
|
||||
const QStringList &CSimulatorPluginInfo::allIdentifiers()
|
||||
{
|
||||
static const QStringList identifiers(
|
||||
{
|
||||
fsxPluginIndentifier(),
|
||||
p3dPluginIndentifier(),
|
||||
xplanePluginIndentifier(),
|
||||
fs9PluginIndentifier()
|
||||
});
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
QStringList CSimulatorPluginInfo::guessDefaultPlugins()
|
||||
{
|
||||
if (BlackConfig::CBuildConfig::isRunningOnUnixPlatform())
|
||||
|
||||
@@ -76,6 +76,9 @@ namespace BlackMisc
|
||||
//! Plugin identifier (XPlane)
|
||||
static const QString &xplanePluginIndentifier();
|
||||
|
||||
//! All valid identifiers
|
||||
static const QStringList &allIdentifiers();
|
||||
|
||||
//! Guess default plugins
|
||||
static QStringList guessDefaultPlugins();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user