mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-12 23:35:33 +08:00
@@ -14,7 +14,6 @@
|
||||
#include "blackcore/vatsimbookingreader.h"
|
||||
#include "blackcore/vatsimdatafilereader.h"
|
||||
#include "blackmisc/simulation/aircraftmodellist.h"
|
||||
#include "blackmisc/project.h"
|
||||
#include "blackmisc/testing.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/propertyindexallclasses.h"
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "application.h"
|
||||
#include "blackmisc/buildconfig.h"
|
||||
#include "blackcore/corefacade.h"
|
||||
#include "blackcore/setupreader.h"
|
||||
#include "blackcore/networkvatlib.h"
|
||||
@@ -16,7 +17,6 @@
|
||||
#include "blackcore/registermetadata.h"
|
||||
#include "blackcore/cookiemanager.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/project.h"
|
||||
#include "blackmisc/dbusserver.h"
|
||||
#include "blackmisc/registermetadata.h"
|
||||
#include "blackmisc/threadutils.h"
|
||||
@@ -52,7 +52,7 @@ namespace BlackCore
|
||||
{
|
||||
CApplication::initEnvironment();
|
||||
QCoreApplication::setApplicationName(applicationName);
|
||||
QCoreApplication::setApplicationVersion(CProject::version());
|
||||
QCoreApplication::setApplicationVersion(CVersion::version());
|
||||
this->setObjectName(applicationName);
|
||||
this->initParser();
|
||||
this->initLogging();
|
||||
@@ -103,7 +103,7 @@ namespace BlackCore
|
||||
|
||||
const QString &CApplication::getApplicationNameAndVersion() const
|
||||
{
|
||||
static const QString s(QCoreApplication::instance()->applicationName() + " " + CProject::version());
|
||||
static const QString s(QCoreApplication::instance()->applicationName() + " " + CVersion::version());
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -210,22 +210,22 @@ namespace BlackCore
|
||||
|
||||
const QString &CApplication::versionStringDevBetaInfo() const
|
||||
{
|
||||
if (isRunningInDeveloperEnvironment() && CProject::isBetaTest())
|
||||
if (isRunningInDeveloperEnvironment() && CBuildConfig::isBetaTest())
|
||||
{
|
||||
static const QString s(CProject::version() + " [DEV, BETA]");
|
||||
static const QString s(CVersion::version() + " [DEV, BETA]");
|
||||
return s;
|
||||
}
|
||||
if (isRunningInDeveloperEnvironment())
|
||||
{
|
||||
static const QString s(CProject::version() + " [DEV]");
|
||||
static const QString s(CVersion::version() + " [DEV]");
|
||||
return s;
|
||||
}
|
||||
if (CProject::isBetaTest())
|
||||
if (CBuildConfig::isBetaTest())
|
||||
{
|
||||
static const QString s(CProject::version() + " [BETA]");
|
||||
static const QString s(CVersion::version() + " [BETA]");
|
||||
return s;
|
||||
}
|
||||
return CProject::version();
|
||||
return CVersion::version();
|
||||
}
|
||||
|
||||
const QString &CApplication::swiftVersionString() const
|
||||
@@ -242,7 +242,7 @@ namespace BlackCore
|
||||
|
||||
bool CApplication::isRunningInDeveloperEnvironment() const
|
||||
{
|
||||
if (!CProject::canRunInDeveloperEnvironment()) { return false; }
|
||||
if (!CBuildConfig::canRunInDeveloperEnvironment()) { return false; }
|
||||
if (!this->m_parser.value(this->m_cmdDevelopment).isEmpty())
|
||||
{
|
||||
// explicit value
|
||||
@@ -265,21 +265,21 @@ namespace BlackCore
|
||||
QString CApplication::getEnvironmentInfoString(const QString &separator) const
|
||||
{
|
||||
QString env("Beta: ");
|
||||
env.append(boolToYesNo(CProject::isBetaTest()));
|
||||
env.append(boolToYesNo(CBuildConfig::isBetaTest()));
|
||||
env = env.append(" dev.env,: ").append(boolToYesNo(isRunningInDeveloperEnvironment()));
|
||||
env = env.append(separator);
|
||||
env.append("Windows: ").append(boolToYesNo(CProject::isRunningOnWindowsNtPlatform()));
|
||||
env.append("Windows: ").append(boolToYesNo(CBuildConfig::isRunningOnWindowsNtPlatform()));
|
||||
return env;
|
||||
}
|
||||
|
||||
QString CApplication::getInfoString(const QString &separator) const
|
||||
{
|
||||
QString str(CProject::version());
|
||||
str = str.append(" ").append(CProject::isReleaseBuild() ? "Release build" : "Debug build");
|
||||
QString str(CVersion::version());
|
||||
str = str.append(" ").append(CBuildConfig::isReleaseBuild() ? "Release build" : "Debug build");
|
||||
str = str.append(separator);
|
||||
str = str.append(getEnvironmentInfoString(separator));
|
||||
str = str.append(separator);
|
||||
str.append(CProject::compiledWithInfo(false));
|
||||
str.append(CBuildConfig::compiledWithInfo(false));
|
||||
return str;
|
||||
}
|
||||
|
||||
@@ -661,9 +661,9 @@ namespace BlackCore
|
||||
bool CApplication::parse()
|
||||
{
|
||||
if (this->m_parsed) { return m_parsed; }
|
||||
if (CProject::isLifetimeExpired())
|
||||
if (CBuildConfig::isLifetimeExpired())
|
||||
{
|
||||
this->cmdLineErrorMessage("Program exired " + CProject::getEol().toString());
|
||||
this->cmdLineErrorMessage("Program exired " + CBuildConfig::getEol().toString());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "blackmisc/simulation/simulatorplugininfolist.h"
|
||||
#include "blackmisc/simulation/simulatedaircraftlist.h"
|
||||
#include "blackmisc/aviation/airportlist.h"
|
||||
#include "blackmisc/project.h"
|
||||
#include "blackmisc/buildconfig.h"
|
||||
#include "blackmisc/pixmap.h"
|
||||
#include "blackmisc/pq/time.h"
|
||||
#include <QObject>
|
||||
@@ -165,7 +165,7 @@ namespace BlackCore
|
||||
virtual BlackMisc::PhysicalQuantities::CTime getTimeSynchronizationOffset() const = 0;
|
||||
|
||||
//! Simulator avialable (driver available)?
|
||||
bool isSimulatorAvailable() const { return BlackMisc::CProject::isCompiledWithFlightSimulatorSupport() && !getSimulatorPluginInfo().isUnspecified(); }
|
||||
bool isSimulatorAvailable() const { return BlackMisc::CBuildConfig::isCompiledWithFlightSimulatorSupport() && !getSimulatorPluginInfo().isUnspecified(); }
|
||||
|
||||
//! Icon representing the model
|
||||
virtual BlackMisc::CPixmap iconForModel(const QString &modelString) const = 0;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "globalsetup.h"
|
||||
#include "blackmisc/project.h"
|
||||
#include "blackmisc/buildconfig.h"
|
||||
#include "blackmisc/math/mathutils.h"
|
||||
#include "blackmisc/stringutils.h"
|
||||
#include <QStringList>
|
||||
@@ -29,7 +29,7 @@ namespace BlackCore
|
||||
m_vatsimMetarsUrls( {"http://metar.vatsim.net/metar.php"}),
|
||||
m_vatsimStatusFileUrls({ "https://status.vatsim.net" }),
|
||||
m_vatsimDataFileUrls({ "http://info.vroute.net/vatsim-data.txt" }),
|
||||
m_sharedUrls(CProject::swiftTeamDefaultServers()),
|
||||
m_sharedUrls(CBuildConfig::swiftTeamDefaultServers()),
|
||||
m_newsUrls(QStringList({ "http://swift-project.org/" }))
|
||||
{ }
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "updateinfo.h"
|
||||
#include "blackmisc/project.h"
|
||||
#include "blackmisc/buildconfig.h"
|
||||
#include <QStringList>
|
||||
|
||||
using namespace BlackMisc;
|
||||
@@ -22,20 +22,20 @@ namespace BlackCore
|
||||
ITimestampBased(0),
|
||||
m_downloadsStableUrls(QStringList {"http://swift-project.org/"}),
|
||||
m_downloadsBetaUrls(QStringList {"http://swift-project.org/"}),
|
||||
m_latestVersionStable(CProject::version()),
|
||||
m_latestVersionStable(CVersion::version()),
|
||||
m_lastSupportedVersionStable("0.6"),
|
||||
m_latestVersionBeta(CProject::version()),
|
||||
m_latestVersionBeta(CVersion::version()),
|
||||
m_lastSupportedVersionBeta("0.6")
|
||||
{ }
|
||||
|
||||
CUrlList CUpdateInfo::getDownloadUrls() const
|
||||
{
|
||||
return CProject::isBetaTest() ? getDownloadUrlsBeta() : getDownloadUrlsStable();
|
||||
return CBuildConfig::isBetaTest() ? getDownloadUrlsBeta() : getDownloadUrlsStable();
|
||||
}
|
||||
|
||||
QString CUpdateInfo::getLatestVersion() const
|
||||
{
|
||||
return CProject::isBetaTest() ? getLatestVersionBeta() : getLatestVersionStable();
|
||||
return CBuildConfig::isBetaTest() ? getLatestVersionBeta() : getLatestVersionStable();
|
||||
}
|
||||
|
||||
bool CUpdateInfo::hasSameType(const CUpdateInfo &otherDownload) const
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/datastoreutility.h"
|
||||
#include "blackmisc/network/networkutils.h"
|
||||
#include "blackmisc/project.h"
|
||||
#include <QUrlQuery>
|
||||
#include <QJsonDocument>
|
||||
#include <QHttpPart>
|
||||
|
||||
@@ -11,8 +11,9 @@
|
||||
|
||||
#include "networkvatlib.h"
|
||||
#include "application.h"
|
||||
#include "blackmisc/project.h"
|
||||
#include "blackmisc/buildconfig.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/buildconfig.h"
|
||||
#include <QJsonDocument>
|
||||
#include <vector>
|
||||
#include <type_traits>
|
||||
@@ -20,14 +21,6 @@
|
||||
static_assert(! std::is_abstract<BlackCore::CNetworkVatlib>::value, "Must implement all pure virtuals");
|
||||
static_assert(VAT_LIBVATLIB_VERSION == 905, "Wrong vatlib header installed");
|
||||
|
||||
#if !defined(BLACK_CLIENT_PUBLIC_ID)
|
||||
#error Missing definition of id
|
||||
#endif
|
||||
|
||||
#if !defined(BLACK_CLIENT_PRIVATE_KEY)
|
||||
#error Missing definition of pk
|
||||
#endif
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::Geo;
|
||||
@@ -71,11 +64,10 @@ namespace BlackCore
|
||||
clientCapabilities |= vatCapsStealth;
|
||||
}
|
||||
|
||||
static const QString pkDef(BLACK_STRINGIFY(BLACK_CLIENT_PRIVATE_KEY));
|
||||
static const QByteArray pk(this->getCmdLineFsdKey().isEmpty() ? pkDef.toLocal8Bit() : this->getCmdLineFsdKey().toLocal8Bit());
|
||||
static const QByteArray pk(this->getCmdLineFsdKey().isEmpty() ? CBuildConfig::vatsimPrivateKey().toLocal8Bit() : this->getCmdLineFsdKey().toLocal8Bit());
|
||||
m_net.reset(Vat_CreateNetworkSession(vatServerLegacyFsd, sApp->swiftVersionChar(),
|
||||
CProject::versionMajor(), CProject::versionMinor(),
|
||||
"None", BLACK_CLIENT_PUBLIC_ID, pk.constData(),
|
||||
CVersion::versionMajor(), CVersion::versionMinor(),
|
||||
"None", CBuildConfig::vatsimClientId(), pk.constData(),
|
||||
clientCapabilities));
|
||||
|
||||
Vat_SetStateChangeHandler(m_net.data(), onConnectionStatusChanged, this);
|
||||
@@ -599,7 +591,7 @@ namespace BlackCore
|
||||
};
|
||||
|
||||
// only in not officially shipped versions
|
||||
return (CProject::isShippedVersion() && !CProject::isBetaTest()) ? e : opts;
|
||||
return (CBuildConfig::isShippedVersion() && !CBuildConfig::isBetaTest()) ? e : opts;
|
||||
}
|
||||
|
||||
QString CNetworkVatlib::getCmdLineFsdKey() const
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/logcategory.h"
|
||||
#include "blackmisc/json.h"
|
||||
#include "blackmisc/project.h"
|
||||
#include "blackmisc/buildconfig.h"
|
||||
#include "blackmisc/fileutils.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "setupreader.h"
|
||||
@@ -87,7 +87,7 @@ namespace BlackCore
|
||||
if (this->m_bootstrapUrls.isEmpty())
|
||||
{
|
||||
CGlobalSetup resourceSetup(CGlobalSetup::fromJsonFile(
|
||||
CProject::getBootstrapResourceFile()
|
||||
CBuildConfig::getBootstrapResourceFile()
|
||||
));
|
||||
this->m_bootstrapUrls.push_back(resourceSetup.getBootstrapFileUrls());
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include "blackmisc/weather/metarset.h"
|
||||
#include "blackmisc/logcategorylist.h"
|
||||
#include "blackmisc/countrylist.h"
|
||||
#include "blackmisc/project.h"
|
||||
#include "blackmisc/restricted.h"
|
||||
#include <QObject>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user