mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-25 18:25:42 +08:00
Link CBuildConfig and CVersion into static library blackconfig
CBuildConfig including private keys etc. should not be part of a public library API. Therefore link it into a static library, which is not available to end users. refs #645
This commit is contained in:
23
src/blackconfig/blackconfig.pro
Normal file
23
src/blackconfig/blackconfig.pro
Normal file
@@ -0,0 +1,23 @@
|
||||
load(common_pre)
|
||||
|
||||
TARGET = blackconfig
|
||||
TEMPLATE = lib
|
||||
CONFIG += staticlib
|
||||
|
||||
buildconfig_gen.input = buildconfig_gen.cpp.in
|
||||
buildconfig_gen.output = $$DestRoot/buildconfig_gen.cpp
|
||||
GENERATED_SOURCES += $$DestRoot/buildconfig_gen.cpp
|
||||
QMAKE_SUBSTITUTES += buildconfig_gen
|
||||
|
||||
INCLUDEPATH += ..
|
||||
precompile_header:!isEmpty(PRECOMPILED_HEADER) {
|
||||
DEFINES += USING_PCH
|
||||
}
|
||||
|
||||
DEFINES += LOG_IN_FILE
|
||||
HEADERS += *.h
|
||||
SOURCES += *.cpp
|
||||
DESTDIR = $$DestRoot/lib
|
||||
OTHER_FILES += buildconfig_gen.cpp.in
|
||||
|
||||
load(common_post)
|
||||
348
src/blackconfig/buildconfig.cpp
Normal file
348
src/blackconfig/buildconfig.cpp
Normal file
@@ -0,0 +1,348 @@
|
||||
/* Copyright (C) 2013
|
||||
* swift Project Community/Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \cond PRIVATE
|
||||
|
||||
#include "blackconfig/buildconfig.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDateTime>
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QStandardPaths>
|
||||
#include <QStringList>
|
||||
#include <QtGlobal>
|
||||
|
||||
namespace BlackConfig
|
||||
{
|
||||
bool CBuildConfig::isCompiledWithP3DSupport()
|
||||
{
|
||||
return CBuildConfig::isCompiledWithFsxSupport();
|
||||
}
|
||||
|
||||
bool CBuildConfig::isCompiledWithMsFlightSimulatorSupport()
|
||||
{
|
||||
return CBuildConfig::isCompiledWithFs9Support() || CBuildConfig::isCompiledWithFsxSupport() || CBuildConfig::isCompiledWithP3DSupport();
|
||||
}
|
||||
|
||||
bool CBuildConfig::isCompiledWithFlightSimulatorSupport()
|
||||
{
|
||||
return CBuildConfig::isCompiledWithFsxSupport() || CBuildConfig::isCompiledWithXPlaneSupport();
|
||||
}
|
||||
|
||||
const QString &CBuildConfig::swiftGuiExecutableName()
|
||||
{
|
||||
static const QString s("swiftguistd");
|
||||
return s;
|
||||
}
|
||||
|
||||
const QString &CBuildConfig::swiftCoreExecutableName()
|
||||
{
|
||||
static const QString s("swiftcore");
|
||||
return s;
|
||||
}
|
||||
|
||||
const QString &CBuildConfig::swiftDataExecutableName()
|
||||
{
|
||||
static const QString s("swiftdata");
|
||||
return s;
|
||||
}
|
||||
|
||||
bool CBuildConfig::isRunningOnWindowsNtPlatform()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
// QSysInfo::WindowsVersion only available on Win platforms
|
||||
return (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CBuildConfig::isRunningOnMacOSXPlatform()
|
||||
{
|
||||
#ifdef Q_OS_OSX
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CBuildConfig::isRunningOnLinuxPlatform()
|
||||
{
|
||||
#ifdef Q_OS_LINUX
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CBuildConfig::isRunningOnUnixPlatform()
|
||||
{
|
||||
return isRunningOnMacOSXPlatform() || isRunningOnLinuxPlatform();
|
||||
}
|
||||
|
||||
bool CBuildConfig::isDebugBuild()
|
||||
{
|
||||
#ifdef QT_DEBUG
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CBuildConfig::isReleaseBuild()
|
||||
{
|
||||
#ifdef QT_NO_DEBUG
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
const QStringList &CBuildConfig::swiftTeamDefaultServers()
|
||||
{
|
||||
static const QStringList s({ "https://vatsim-germany.org:50443/mapping/public/shared",
|
||||
"http://ubuntu12/public/bootstrap/shared"
|
||||
});
|
||||
return s;
|
||||
}
|
||||
|
||||
bool CBuildConfig::isLifetimeExpired()
|
||||
{
|
||||
if (getEol().isValid())
|
||||
{
|
||||
return QDateTime::currentDateTime() > getEol();
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
QString getApplicationDirImpl()
|
||||
{
|
||||
QFileInfo executable(QCoreApplication::applicationFilePath());
|
||||
QDir p(executable.dir());
|
||||
return p.absolutePath();
|
||||
}
|
||||
|
||||
const QString &CBuildConfig::getApplicationDir()
|
||||
{
|
||||
static const QString s(getApplicationDirImpl());
|
||||
return s;
|
||||
}
|
||||
|
||||
bool isAppBundle()
|
||||
{
|
||||
QDir bundleDir(CBuildConfig::getApplicationDir());
|
||||
bundleDir.cd("../..");
|
||||
static const bool isBundled = QFileInfo(bundleDir.absolutePath()).isBundle();
|
||||
return isBundled;
|
||||
}
|
||||
|
||||
QString getSwiftResourceDirImpl()
|
||||
{
|
||||
QDir dir(CBuildConfig::getApplicationDir());
|
||||
bool success = true;
|
||||
|
||||
static const bool appBundle = isAppBundle();
|
||||
if (CBuildConfig::isRunningOnMacOSXPlatform() && appBundle)
|
||||
{
|
||||
success = dir.cd("../../../../data");
|
||||
}
|
||||
else { success = dir.cd("../data"); }
|
||||
|
||||
if (success)
|
||||
{
|
||||
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir");
|
||||
return dir.absolutePath();
|
||||
}
|
||||
Q_ASSERT_X(false, Q_FUNC_INFO, "missing dir");
|
||||
return "";
|
||||
}
|
||||
|
||||
const QString &CBuildConfig::getSwiftResourceDir()
|
||||
{
|
||||
static const QString s(getSwiftResourceDirImpl());
|
||||
return s;
|
||||
}
|
||||
|
||||
const QString getBootstrapResourceFileImpl()
|
||||
{
|
||||
const QString d(CBuildConfig::getSwiftResourceDir());
|
||||
if (d.isEmpty()) { return ""; }
|
||||
const QFile file(QDir::cleanPath(d + QDir::separator() + "shared/boostrap/boostrap.json"));
|
||||
Q_ASSERT_X(file.exists(), Q_FUNC_INFO, "missing dir");
|
||||
return QFileInfo(file).absoluteFilePath();
|
||||
}
|
||||
|
||||
const QString &CBuildConfig::getBootstrapResourceFile()
|
||||
{
|
||||
static const QString s(getBootstrapResourceFileImpl());
|
||||
return s;
|
||||
}
|
||||
|
||||
QString getSwiftStaticDbFilesDirImpl()
|
||||
{
|
||||
const QString d(CBuildConfig::getSwiftResourceDir());
|
||||
if (d.isEmpty()) { return ""; }
|
||||
QDir dir(QDir::cleanPath(d + QDir::separator() + "shared/dbdata"));
|
||||
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir");
|
||||
return dir.absolutePath();
|
||||
}
|
||||
|
||||
const QString &CBuildConfig::getSwiftStaticDbFilesDir()
|
||||
{
|
||||
static QString s(getSwiftStaticDbFilesDirImpl());
|
||||
return s;
|
||||
}
|
||||
|
||||
QString getSoundFilesDirImpl()
|
||||
{
|
||||
const QString d(CBuildConfig::getSwiftResourceDir());
|
||||
if (d.isEmpty()) { return ""; }
|
||||
QDir dir(QDir::cleanPath(d + QDir::separator() + "sounds"));
|
||||
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir");
|
||||
return dir.absolutePath();
|
||||
}
|
||||
|
||||
const QString &CBuildConfig::getSoundFilesDir()
|
||||
{
|
||||
static QString s(getSoundFilesDirImpl());
|
||||
return s;
|
||||
}
|
||||
|
||||
QString getStylesheetsDirImpl()
|
||||
{
|
||||
const QString d(CBuildConfig::getSwiftResourceDir());
|
||||
if (d.isEmpty()) { return ""; }
|
||||
QDir dir(QDir::cleanPath(d + QDir::separator() + "qss"));
|
||||
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir");
|
||||
return dir.absolutePath();
|
||||
}
|
||||
|
||||
const QString &CBuildConfig::getStylesheetsDir()
|
||||
{
|
||||
static QString s(getStylesheetsDirImpl());
|
||||
return s;
|
||||
}
|
||||
|
||||
QString getImagesDirImpl()
|
||||
{
|
||||
const QString d(CBuildConfig::getSwiftResourceDir());
|
||||
QDir dir(QDir::cleanPath(d + QDir::separator() + "images"));
|
||||
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir");
|
||||
return dir.absolutePath();
|
||||
}
|
||||
|
||||
const QString &CBuildConfig::getImagesDir()
|
||||
{
|
||||
static const QString s(getImagesDirImpl());
|
||||
return s;
|
||||
}
|
||||
|
||||
bool CBuildConfig::canRunInDeveloperEnvironment()
|
||||
{
|
||||
if (CBuildConfig::isBetaTest()) { return true; }
|
||||
return !CBuildConfig::isShippedVersion();
|
||||
}
|
||||
|
||||
QString getDocumentationDirectoryImpl()
|
||||
{
|
||||
QStringList pathes(QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation));
|
||||
QString d = pathes.first();
|
||||
d = QDir::cleanPath(d + QDir::separator() + "swift");
|
||||
QDir dir(d);
|
||||
if (dir.exists()) { return dir.absolutePath(); }
|
||||
return pathes.first();
|
||||
}
|
||||
|
||||
const QString &CBuildConfig::getDocumentationDirectory()
|
||||
{
|
||||
static const QString d(getDocumentationDirectoryImpl());
|
||||
return d;
|
||||
}
|
||||
|
||||
QString boolToYesNo(bool v)
|
||||
{
|
||||
return v ? "yes" : "no";
|
||||
}
|
||||
|
||||
const QString &CBuildConfig::compiledWithInfo(bool shortVersion)
|
||||
{
|
||||
if (shortVersion)
|
||||
{
|
||||
static QString infoShort;
|
||||
if (infoShort.isEmpty())
|
||||
{
|
||||
QStringList sl;
|
||||
if (CBuildConfig::isCompiledWithBlackCore()) { sl << "BlackCore"; }
|
||||
if (CBuildConfig::isCompiledWithBlackSound()) { sl << "BlackSound"; }
|
||||
if (CBuildConfig::isCompiledWithBlackInput()) { sl << "BlackInput"; }
|
||||
if (CBuildConfig::isCompiledWithGui()) { sl << "BlackGui"; }
|
||||
if (CBuildConfig::isCompiledWithFs9Support()) { sl << "FS9"; }
|
||||
if (CBuildConfig::isCompiledWithFsxSupport()) { sl << "FSX"; }
|
||||
if (CBuildConfig::isCompiledWithXPlaneSupport()) { sl << "XPlane"; }
|
||||
if (CBuildConfig::isCompiledWithP3DSupport()) { sl << "P3D"; }
|
||||
infoShort = sl.join(", ");
|
||||
if (infoShort.isEmpty()) { infoShort = "<none>"; }
|
||||
}
|
||||
return infoShort;
|
||||
}
|
||||
else
|
||||
{
|
||||
static QString infoLong;
|
||||
if (infoLong.isEmpty())
|
||||
{
|
||||
infoLong = infoLong.append("BlackCore: ").append(boolToYesNo(isCompiledWithBlackCore()));
|
||||
infoLong = infoLong.append(" BlackInput: ").append(boolToYesNo(isCompiledWithBlackInput()));
|
||||
infoLong = infoLong.append(" BlackSound: ").append(boolToYesNo(isCompiledWithBlackSound()));
|
||||
infoLong = infoLong.append(" GUI: ").append(boolToYesNo(isCompiledWithGui()));
|
||||
|
||||
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()));
|
||||
}
|
||||
return infoLong;
|
||||
}
|
||||
}
|
||||
|
||||
bool CVersion::isNewerVersion(const QString &versionString)
|
||||
{
|
||||
if (versionString.isEmpty()) { return false; }
|
||||
if (CVersion::version() == versionString) { return false; }
|
||||
|
||||
QList<int> newer(getVersionParts(versionString));
|
||||
QList<int> current(getVersionParts(version()));
|
||||
for (int i = 0; i < current.length(); i++)
|
||||
{
|
||||
if (newer.length() <= i) { return false; }
|
||||
if (current.at(i) > newer.at(i)) { return false; }
|
||||
if (current.at(i) < newer.at(i)) { return true; }
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
QList<int> CVersion::getVersionParts(const QString &versionString)
|
||||
{
|
||||
QStringList parts = versionString.split('.');
|
||||
QList<int> partsInt;
|
||||
for (const QString &p : parts)
|
||||
{
|
||||
bool ok = false;
|
||||
int pInt = p.toInt(&ok);
|
||||
partsInt.append(ok ? pInt : -1);
|
||||
}
|
||||
return partsInt;
|
||||
}
|
||||
} // ns
|
||||
|
||||
//! \endcond
|
||||
162
src/blackconfig/buildconfig.h
Normal file
162
src/blackconfig/buildconfig.h
Normal file
@@ -0,0 +1,162 @@
|
||||
/* Copyright (C) 2016
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKCONFIG_BUILDCONFIG_H
|
||||
#define BLACKCONFIG_BUILDCONFIG_H
|
||||
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
|
||||
class QDateTime;
|
||||
class QStringList;
|
||||
|
||||
namespace BlackConfig
|
||||
{
|
||||
//! Build configuration
|
||||
class CBuildConfig
|
||||
{
|
||||
public:
|
||||
//! with BlackCore?
|
||||
static bool isCompiledWithBlackCore();
|
||||
|
||||
//! with BlackSound?
|
||||
static bool isCompiledWithBlackSound();
|
||||
|
||||
//! with BlackInput?
|
||||
static bool isCompiledWithBlackInput();
|
||||
|
||||
//! with FS9 support?
|
||||
static bool isCompiledWithFs9Support();
|
||||
|
||||
//! with FSX support?
|
||||
static bool isCompiledWithFsxSupport();
|
||||
|
||||
//! with P3D support
|
||||
static bool isCompiledWithP3DSupport();
|
||||
|
||||
//! Compiled with any MS Flight Simulator support (P3D, FSX, FS9)
|
||||
static bool isCompiledWithMsFlightSimulatorSupport();
|
||||
|
||||
//! with XPlane support?
|
||||
static bool isCompiledWithXPlaneSupport();
|
||||
|
||||
//! with any simulator libraries
|
||||
static bool isCompiledWithFlightSimulatorSupport();
|
||||
|
||||
//! with GUI?
|
||||
static bool isCompiledWithGui();
|
||||
|
||||
//! Debug build?
|
||||
static bool isDebugBuild();
|
||||
|
||||
//! Release build?
|
||||
static bool isReleaseBuild();
|
||||
|
||||
//! Beta test?
|
||||
static bool isBetaTest();
|
||||
|
||||
//! Can run in dev. environment
|
||||
static bool canRunInDeveloperEnvironment();
|
||||
|
||||
//! Shipped version?
|
||||
static bool isShippedVersion();
|
||||
|
||||
//! Running on Windows NT platform?
|
||||
static bool isRunningOnWindowsNtPlatform();
|
||||
|
||||
//! Running on Mac OS X platform?
|
||||
static bool isRunningOnMacOSXPlatform();
|
||||
|
||||
//! Running on Linux platform?
|
||||
static bool isRunningOnLinuxPlatform();
|
||||
|
||||
//! Running on Unix (Linux or Mac OS X) platform
|
||||
static bool isRunningOnUnixPlatform();
|
||||
|
||||
//! Application directory where current application is located
|
||||
//! \todo Move to to CApplication
|
||||
static const QString &getApplicationDir();
|
||||
|
||||
//! Where resource files (static DB files, ...) etc are located
|
||||
static const QString &getSwiftResourceDir();
|
||||
|
||||
//! Bootstrap resource directory
|
||||
static const QString &getBootstrapResourceFile();
|
||||
|
||||
//! Where static DB files are located
|
||||
static const QString &getSwiftStaticDbFilesDir();
|
||||
|
||||
//! Where sound files are located
|
||||
static const QString &getSoundFilesDir();
|
||||
|
||||
//! Where qss files are located
|
||||
static const QString &getStylesheetsDir();
|
||||
|
||||
//! Where images are located
|
||||
static const QString &getImagesDir();
|
||||
|
||||
//! Directory where data can be stored
|
||||
static const QString &getDocumentationDirectory();
|
||||
|
||||
//! Info string about compilation
|
||||
static const QString &compiledWithInfo(bool shortVersion = true);
|
||||
|
||||
//! Executable name for swift GUI, no(!) appendix
|
||||
static const QString &swiftGuiExecutableName();
|
||||
|
||||
//! Executable name for swift core, no(!) appendix
|
||||
static const QString &swiftCoreExecutableName();
|
||||
|
||||
//! Executable name for swift data, no(!) appendix
|
||||
static const QString &swiftDataExecutableName();
|
||||
|
||||
//! swift team default servers for DB, bootstrap etc.
|
||||
static const QStringList &swiftTeamDefaultServers();
|
||||
|
||||
//! End of lifetime
|
||||
static const QDateTime &getEol();
|
||||
|
||||
//! Lifetime ended?
|
||||
static bool isLifetimeExpired();
|
||||
|
||||
//! Vatsim client id
|
||||
static int vatsimClientId();
|
||||
|
||||
//! Vatsim client key
|
||||
static const QString &vatsimPrivateKey();
|
||||
};
|
||||
|
||||
//! Version
|
||||
class CVersion
|
||||
{
|
||||
public:
|
||||
//! Version info
|
||||
static const QString &version();
|
||||
|
||||
//! Version major
|
||||
static int versionMajor();
|
||||
|
||||
//! Version minor
|
||||
static int versionMinor();
|
||||
|
||||
//! Version patch
|
||||
static int versionPatch();
|
||||
|
||||
//! Is the given string representing a newer version?
|
||||
static bool isNewerVersion(const QString &versionString);
|
||||
|
||||
private:
|
||||
//! Parts of version string 1.0.2
|
||||
static QList<int> getVersionParts(const QString &versionString);
|
||||
};
|
||||
}
|
||||
|
||||
#endif // guard
|
||||
136
src/blackconfig/buildconfig_gen.cpp.in
Normal file
136
src/blackconfig/buildconfig_gen.cpp.in
Normal file
@@ -0,0 +1,136 @@
|
||||
/* Copyright (C) 2016
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include \"blackconfig/buildconfig.h\"
|
||||
#include <QString>
|
||||
#include <QDateTime>
|
||||
|
||||
$$DEFINE_WITH_BLACKCORE#define WITH_BLACKCORE
|
||||
$$DEFINE_WITH_BLACKSOUND#define WITH_BLACKSOUND
|
||||
$$DEFINE_WITH_BLACKINPUT#define WITH_BLACKINPUT
|
||||
$$DEFINE_WITH_BLACKGUI#define WITH_BLACKGUI
|
||||
$$DEFINE_WITH_SWIFTDATA#define WITH_SWIFTDATA
|
||||
$$DEFINE_WITH_SWIFTGUI#define WITH_SWIFTGUI
|
||||
$$DEFINE_WITH_SWIFTCORE#define WITH_SWIFTCORE
|
||||
$$DEFINE_WITH_FSX#define WITH_FSX
|
||||
$$DEFINE_WITH_FS9#define WITH_FS9
|
||||
$$DEFINE_WITH_XPLANE#define WITH_XPLANE
|
||||
$$DEFINE_SWIFT_BETA#define SWIFT_BETA
|
||||
$$DEFINE_SWIFT_SHIPPED#define SWIFT_SHIPPED
|
||||
|
||||
bool BlackConfig::CBuildConfig::isCompiledWithBlackCore()
|
||||
{
|
||||
#ifdef WITH_BLACKCORE
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool BlackConfig::CBuildConfig::isCompiledWithBlackSound()
|
||||
{
|
||||
#ifdef WITH_BLACKSOUND
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool BlackConfig::CBuildConfig::isCompiledWithBlackInput()
|
||||
{
|
||||
#ifdef WITH_BLACKINPUT
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool BlackConfig::CBuildConfig::isCompiledWithFs9Support()
|
||||
{
|
||||
#ifdef WITH_FS9
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool BlackConfig::CBuildConfig::isCompiledWithFsxSupport()
|
||||
{
|
||||
#ifdef WITH_FSX
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool BlackConfig::CBuildConfig::isCompiledWithXPlaneSupport()
|
||||
{
|
||||
#ifdef WITH_XPLANE
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool BlackConfig::CBuildConfig::isCompiledWithGui()
|
||||
{
|
||||
#ifdef WITH_BLACKGUI
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool BlackConfig::CBuildConfig::isBetaTest()
|
||||
{
|
||||
#ifdef SWIFT_BETA
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool BlackConfig::CBuildConfig::isShippedVersion()
|
||||
{
|
||||
#ifdef SWIFT_SHIPPED
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
const QDateTime &BlackConfig::CBuildConfig::getEol()
|
||||
{
|
||||
static const QString eol(\"$$BLACK_EOL\");
|
||||
static const QDateTime dt(eol.isEmpty() ? QDateTime() : QDateTime::fromString(eol, \"yyyyMMdd\"));
|
||||
return dt;
|
||||
}
|
||||
|
||||
int BlackConfig::CBuildConfig::vatsimClientId()
|
||||
{
|
||||
static const int id { $$VATSIM_CLIENT_ID };
|
||||
return id;
|
||||
}
|
||||
|
||||
const QString &BlackConfig::CBuildConfig::vatsimPrivateKey()
|
||||
{
|
||||
static const auto pk = QString { \"$$VATSIM_CLIENT_PRIVATE_KEY\" };
|
||||
return pk;
|
||||
}
|
||||
|
||||
const QString &BlackConfig::CVersion::version()
|
||||
{
|
||||
static const QString version(\"$$BLACK_VERSION\");
|
||||
Q_ASSERT(!version.isEmpty());
|
||||
return version;
|
||||
}
|
||||
|
||||
int BlackConfig::CVersion::versionMajor() { return $$BLACK_VER_MAJ; }
|
||||
int BlackConfig::CVersion::versionMinor() { return $$BLACK_VER_MIN; }
|
||||
int BlackConfig::CVersion::versionPatch() { return $$BLACK_VER_PAT; }
|
||||
Reference in New Issue
Block a user