mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 19:25:49 +08:00
refs #661, default value for enabled simulators
This commit is contained in:
@@ -65,6 +65,17 @@ namespace BlackConfig
|
|||||||
#endif
|
#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()
|
bool CBuildConfig::isRunningOnMacOSXPlatform()
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_OSX
|
#ifdef Q_OS_OSX
|
||||||
|
|||||||
@@ -72,6 +72,9 @@ namespace BlackConfig
|
|||||||
//! Running on Windows NT platform?
|
//! Running on Windows NT platform?
|
||||||
static bool isRunningOnWindowsNtPlatform();
|
static bool isRunningOnWindowsNtPlatform();
|
||||||
|
|
||||||
|
//! Windows 10
|
||||||
|
static bool isRunningOnWindows10();
|
||||||
|
|
||||||
//! Running on Mac OS X platform?
|
//! Running on Mac OS X platform?
|
||||||
static bool isRunningOnMacOSXPlatform();
|
static bool isRunningOnMacOSXPlatform();
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#define BLACKCORE_SETTINGS_APPLICATION_H
|
#define BLACKCORE_SETTINGS_APPLICATION_H
|
||||||
|
|
||||||
#include "blackmisc/settingscache.h"
|
#include "blackmisc/settingscache.h"
|
||||||
|
#include "blackconfig/buildconfig.h"
|
||||||
#include "blackmisc/input/actionhotkeylist.h"
|
#include "blackmisc/input/actionhotkeylist.h"
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
@@ -51,14 +52,35 @@ namespace BlackCore
|
|||||||
static const QStringList &defaultValue()
|
static const QStringList &defaultValue()
|
||||||
{
|
{
|
||||||
// All default simulators
|
// 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.fs9"),
|
||||||
QStringLiteral("org.swift-project.plugins.simulator.fsx"),
|
QStringLiteral("org.swift-project.plugins.simulator.fsx"),
|
||||||
QStringLiteral("org.swift-project.plugins.simulator.xplane")
|
QStringLiteral("org.swift-project.plugins.simulator.xplane")
|
||||||
};
|
};
|
||||||
|
|
||||||
return enabledSimulators;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
Reference in New Issue
Block a user