mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 15:45:46 +08:00
refs #661, default value for enabled simulators
This commit is contained in:
@@ -65,6 +65,17 @@ namespace BlackConfig
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CBuildConfig::isRunningOnWindows10()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
// QSysInfo::WindowsVersion only available on Win platforms
|
||||
if (!isRunningOnWindowsNtPlatform()) { return false; }
|
||||
return (QSysInfo::WindowsVersion == QSysInfo::WV_10_0);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CBuildConfig::isRunningOnMacOSXPlatform()
|
||||
{
|
||||
#ifdef Q_OS_OSX
|
||||
|
||||
@@ -72,6 +72,9 @@ namespace BlackConfig
|
||||
//! Running on Windows NT platform?
|
||||
static bool isRunningOnWindowsNtPlatform();
|
||||
|
||||
//! Windows 10
|
||||
static bool isRunningOnWindows10();
|
||||
|
||||
//! Running on Mac OS X platform?
|
||||
static bool isRunningOnMacOSXPlatform();
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#define BLACKCORE_SETTINGS_APPLICATION_H
|
||||
|
||||
#include "blackmisc/settingscache.h"
|
||||
#include "blackconfig/buildconfig.h"
|
||||
#include "blackmisc/input/actionhotkeylist.h"
|
||||
#include <QStringList>
|
||||
|
||||
@@ -51,14 +52,35 @@ namespace BlackCore
|
||||
static const QStringList &defaultValue()
|
||||
{
|
||||
// All default simulators
|
||||
static const QStringList enabledSimulators
|
||||
static const QStringList enabledSimulators(defaultValueImpl());
|
||||
return enabledSimulators;
|
||||
}
|
||||
|
||||
private:
|
||||
//! Determine default value
|
||||
static QStringList defaultValueImpl()
|
||||
{
|
||||
if (BlackConfig::CBuildConfig::isRunningOnWindows10())
|
||||
{
|
||||
// On WIN10 we have no direct play, so disable FS9 as per default
|
||||
return QStringList
|
||||
{
|
||||
QStringLiteral("org.swift-project.plugins.simulator.fsx"),
|
||||
QStringLiteral("org.swift-project.plugins.simulator.xplane")
|
||||
};
|
||||
}
|
||||
else if (BlackConfig::CBuildConfig::isRunningOnUnixPlatform())
|
||||
{
|
||||
// On UNIX we likely run XP
|
||||
return QStringList { QStringLiteral("org.swift-project.plugins.simulator.xplane") };
|
||||
}
|
||||
|
||||
return QStringList
|
||||
{
|
||||
QStringLiteral("org.swift-project.plugins.simulator.fs9"),
|
||||
QStringLiteral("org.swift-project.plugins.simulator.fsx"),
|
||||
QStringLiteral("org.swift-project.plugins.simulator.xplane")
|
||||
};
|
||||
|
||||
return enabledSimulators;
|
||||
}
|
||||
};
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user