refs #661, default value for enabled simulators

This commit is contained in:
Klaus Basan
2016-05-24 23:47:34 +02:00
parent 0aa916f057
commit 988251b079
3 changed files with 39 additions and 3 deletions

View File

@@ -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

View File

@@ -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();

View File

@@ -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