mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 02:45:33 +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());
|
static const QStringList enabledSimulators(BlackMisc::Simulation::CSimulatorPluginInfo::guessDefaultPlugins());
|
||||||
return enabledSimulators;
|
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
|
//! Uploading of crash dumps is enabled or disabled
|
||||||
|
|||||||
@@ -74,6 +74,18 @@ namespace BlackMisc
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QStringList &CSimulatorPluginInfo::allIdentifiers()
|
||||||
|
{
|
||||||
|
static const QStringList identifiers(
|
||||||
|
{
|
||||||
|
fsxPluginIndentifier(),
|
||||||
|
p3dPluginIndentifier(),
|
||||||
|
xplanePluginIndentifier(),
|
||||||
|
fs9PluginIndentifier()
|
||||||
|
});
|
||||||
|
return identifiers;
|
||||||
|
}
|
||||||
|
|
||||||
QStringList CSimulatorPluginInfo::guessDefaultPlugins()
|
QStringList CSimulatorPluginInfo::guessDefaultPlugins()
|
||||||
{
|
{
|
||||||
if (BlackConfig::CBuildConfig::isRunningOnUnixPlatform())
|
if (BlackConfig::CBuildConfig::isRunningOnUnixPlatform())
|
||||||
|
|||||||
@@ -76,6 +76,9 @@ namespace BlackMisc
|
|||||||
//! Plugin identifier (XPlane)
|
//! Plugin identifier (XPlane)
|
||||||
static const QString &xplanePluginIndentifier();
|
static const QString &xplanePluginIndentifier();
|
||||||
|
|
||||||
|
//! All valid identifiers
|
||||||
|
static const QStringList &allIdentifiers();
|
||||||
|
|
||||||
//! Guess default plugins
|
//! Guess default plugins
|
||||||
static QStringList guessDefaultPlugins();
|
static QStringList guessDefaultPlugins();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user