mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
refactor: Use single function for compiledWith info
This should avoid duplication
This commit is contained in:
@@ -67,9 +67,7 @@ namespace swift::config
|
|||||||
return devBuild;
|
return devBuild;
|
||||||
}
|
}
|
||||||
|
|
||||||
static QString boolToYesNo(bool v) { return v ? QStringLiteral("yes") : QStringLiteral("no"); }
|
const QString &CBuildConfig::compiledWithInfo()
|
||||||
|
|
||||||
const QString &CBuildConfig::compiledWithInfoShort()
|
|
||||||
{
|
{
|
||||||
static QString infoShort;
|
static QString infoShort;
|
||||||
QStringList sl;
|
QStringList sl;
|
||||||
@@ -83,17 +81,6 @@ namespace swift::config
|
|||||||
return infoShort;
|
return infoShort;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString &CBuildConfig::compiledWithInfoLong()
|
|
||||||
{
|
|
||||||
static QString infoLong;
|
|
||||||
infoLong = infoLong.append(" FS9: ").append(boolToYesNo(isCompiledWithFs9Support()));
|
|
||||||
infoLong = infoLong.append(" FSX: ").append(boolToYesNo(isCompiledWithFsxSupport()));
|
|
||||||
infoLong = infoLong.append(" P3D: ").append(boolToYesNo(isCompiledWithP3DSupport()));
|
|
||||||
infoLong = infoLong.append(" XPlane: ").append(boolToYesNo(isCompiledWithXPlaneSupport()));
|
|
||||||
infoLong = infoLong.append(" FG: ").append(boolToYesNo(isCompiledWithFGSupport()));
|
|
||||||
return infoLong;
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString &CBuildConfig::gitHubRepoUrl()
|
const QString &CBuildConfig::gitHubRepoUrl()
|
||||||
{
|
{
|
||||||
static const QString url = "https://github.com/swift-project/pilotclient/";
|
static const QString url = "https://github.com/swift-project/pilotclient/";
|
||||||
|
|||||||
@@ -63,14 +63,11 @@ namespace swift::config
|
|||||||
//! Running on Unix (Linux or Mac OS X) platform
|
//! Running on Unix (Linux or Mac OS X) platform
|
||||||
static constexpr bool isRunningOnUnixPlatform();
|
static constexpr bool isRunningOnUnixPlatform();
|
||||||
|
|
||||||
//! Info such as Win32, Win64, MacOs, Linux
|
//! Info such as Win32, Win64, macOS, Linux
|
||||||
static const QString &getPlatformString();
|
static const QString &getPlatformString();
|
||||||
|
|
||||||
//! Info string about compilation (short version)
|
//! Info string about compilation
|
||||||
static const QString &compiledWithInfoShort();
|
static const QString &compiledWithInfo();
|
||||||
|
|
||||||
//! Info string about compilation (long version)
|
|
||||||
static const QString &compiledWithInfoLong();
|
|
||||||
|
|
||||||
//! Executable name for swift GUI, no(!) appendix
|
//! Executable name for swift GUI, no(!) appendix
|
||||||
static const QString &swiftGuiExecutableName();
|
static const QString &swiftGuiExecutableName();
|
||||||
|
|||||||
@@ -466,7 +466,7 @@ namespace swift::core
|
|||||||
boolToYesNo(CBuildConfig::isRunningOnUnixPlatform()) % separator % u"MacOS: " %
|
boolToYesNo(CBuildConfig::isRunningOnUnixPlatform()) % separator % u"MacOS: " %
|
||||||
boolToYesNo(CBuildConfig::isRunningOnMacOSPlatform()) % separator % "Build Abi: " %
|
boolToYesNo(CBuildConfig::isRunningOnMacOSPlatform()) % separator % "Build Abi: " %
|
||||||
QSysInfo::buildAbi() % separator % u"Build CPU: " % QSysInfo::buildCpuArchitecture() % separator %
|
QSysInfo::buildAbi() % separator % u"Build CPU: " % QSysInfo::buildCpuArchitecture() % separator %
|
||||||
CBuildConfig::compiledWithInfoLong();
|
CBuildConfig::compiledWithInfo();
|
||||||
|
|
||||||
if (this->supportsContexts()) { str += (separator % u"Supporting contexts"); }
|
if (this->supportsContexts()) { str += (separator % u"Supporting contexts"); }
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace swift::misc
|
|||||||
{
|
{
|
||||||
CApplicationInfo::CApplicationInfo(Application app)
|
CApplicationInfo::CApplicationInfo(Application app)
|
||||||
: m_app(app), m_wordSize(CBuildConfig::buildWordSize()), m_exePath(QCoreApplication::applicationDirPath()),
|
: m_app(app), m_wordSize(CBuildConfig::buildWordSize()), m_exePath(QCoreApplication::applicationDirPath()),
|
||||||
m_version(CBuildConfig::getVersionString()), m_compileInfo(CBuildConfig::compiledWithInfoShort()),
|
m_version(CBuildConfig::getVersionString()), m_compileInfo(CBuildConfig::compiledWithInfo()),
|
||||||
m_platform(CBuildConfig::getPlatformString()), m_process(CProcessInfo::currentProcess())
|
m_platform(CBuildConfig::getPlatformString()), m_process(CProcessInfo::currentProcess())
|
||||||
{
|
{
|
||||||
if (app == CApplicationInfo::Unknown) { m_app = guessApplication(); }
|
if (app == CApplicationInfo::Unknown) { m_app = guessApplication(); }
|
||||||
|
|||||||
Reference in New Issue
Block a user