7 #include <QStringBuilder>
10 #include <QVersionNumber>
22 using namespace swift::config;
24 using namespace swift::misc::json;
25 using namespace swift::misc::network;
48 CUrl url = m_onlineHelpUrl;
49 if (url.
isEmpty()) {
return url; }
53 if (QCoreApplication::instance()) { c = QCoreApplication::instance()->applicationName(); }
54 if (!context.isEmpty()) { c +=
"." + context; }
79 static const CServerList hardcoded({ CServer::fscFsdServer(), CServer::esTowerView() });
81 testServers.addIfAddressNotExists(hardcoded);
87 if (m_mappingMinimumVersion.isEmpty()) {
return false; }
89 return CBuildConfig::getVersion() >= min;
96 QString s = u
"Global setup loaded: " % separator % u
"Mapping min.version: " %
99 % u
"Help URL: " % m_onlineHelpUrl.
toQString(i18n) % separator;
126 case IndexDbRootDirectory:
return QVariant::fromValue(m_dbRootDirectoryUrl);
127 case IndexDbHttpsPort:
return QVariant::fromValue(m_dbHttpsPort);
129 case IndexVatsimStatus:
return QVariant::fromValue(m_vatsimStatusFileUrl);
130 case IndexVatsimData:
return QVariant::fromValue(m_vatsimDataFileUrl);
131 case IndexVatsimServer:
return QVariant::fromValue(m_vatsimServerFileUrl);
132 case IndexVatsimHttpFsd:
return QVariant::fromValue(m_vatsimFsdHttpUrl);
133 case IndexVatsimMetars:
return QVariant::fromValue(m_vatsimMetarsUrl);
134 case IndexSharedUrl:
return QVariant::fromValue(m_sharedUrl);
135 case IndexOnlineHelpUrl:
return QVariant::fromValue(m_onlineHelpUrl);
136 case IndexMappingMinimumVersion:
return QVariant::fromValue(m_mappingMinimumVersion);
137 case IndexPredefinedServers:
return QVariant::fromValue(m_predefinedServers);
138 case IndexAfvApiServerUrl:
return QVariant::fromValue(m_afvApiServerUrl);
139 case IndexAfvMapUrl:
return QVariant::fromValue(m_afvMapUrl);
156 case IndexDbHttpsPort: m_dbHttpsPort = variant.toInt();
break;
157 case IndexDbLoginService:
break;
158 case IndexVatsimData: m_vatsimDataFileUrl = variant.value<
CUrl>();
break;
159 case IndexVatsimServer: m_vatsimServerFileUrl = variant.value<
CUrl>();
break;
160 case IndexVatsimHttpFsd: m_vatsimFsdHttpUrl = variant.value<
CUrl>();
break;
161 case IndexVatsimMetars: m_vatsimMetarsUrl = variant.value<
CUrl>();
break;
162 case IndexSharedUrl: m_sharedUrl = variant.value<
CUrl>();
break;
163 case IndexOnlineHelpUrl: m_onlineHelpUrl = variant.value<
CUrl>();
break;
164 case IndexMappingMinimumVersion: m_mappingMinimumVersion = variant.toString();
break;
165 case IndexPredefinedServers: m_predefinedServers = variant.value<
CServerList>();
break;
166 case IndexAfvApiServerUrl: m_afvApiServerUrl = variant.value<
CUrl>();
break;
167 case IndexAfvMapUrl: m_afvMapUrl = variant.value<
CUrl>();
break;
175 static const QString v(
"0.7.0");
Global settings for readers, debug flags, etc.
void setPropertyByIndex(swift::misc::CPropertyIndexRef index, const QVariant &variant)
Set property by index.
const swift::misc::network::CUrl & getSwiftSharedUrl() const
Shared URL.
swift::misc::network::CUrl getVatsimServerFileUrl() const
VATSIM server file URL.
bool dbDebugFlag() const
Debug flag.
bool isSwiftVersionMinimumMappingVersion() const
Meets the minimum mapping version.
const QString & getMappingMinimumVersionString() const
Creating mappings requires at least this version or higher.
swift::misc::network::CUrl getHelpPageUrl(const QString &context={}) const
Help page URL.
swift::misc::network::CUrl getDbIcaoReaderUrl() const
ICAO reader URL.
swift::misc::network::CUrl getDbAirportReaderUrl() const
Airport reader URL.
swift::misc::network::CUrl getDbHomePageUrl() const
Home page url.
swift::misc::network::CUrl getDbInfoReaderUrl() const
Info data reader URL.
ColumnIndex
Properties by index.
swift::misc::network::CUrl getDbLoginServiceUrl() const
Login service.
swift::misc::network::CUrl getLegalDirectoryUrl() const
Legal directory URL.
const swift::misc::network::CUrl & getDbRootDirectoryUrl() const
Root directory of DB.
void setServerDebugFlag(bool debug)
Set debug flag.
const swift::misc::network::CUrl & getVatsimDataFileUrl() const
VATSIM data file URL.
static const QString & schemaVersionString()
Schema version (shared files, bootstrap file)
swift::misc::network::CServerList getPredefinedServersPlusHardcodedServers() const
Predefined plus hardcoded.
QString convertToQString(bool i18n=false) const
Cast as QString.
const swift::misc::network::CUrl & getVatsimMetarsUrl() const
VATSIM METAR URL.
swift::misc::network::CUrl getDbModelReaderUrl() const
Model reader URL.
swift::misc::network::CUrl getAfvMapUrl() const
AFV map URL.
const swift::misc::network::CServerList & getPredefinedServers() const
Predefined servers.
QVariant propertyByIndex(swift::misc::CPropertyIndexRef index) const
Property by index.
swift::misc::network::CUrl getSharedDbDataDirectoryUrl()
Get shared DB data directory URL.
swift::misc::network::CUrl getAfvApiServerUrl() const
AFV voice server URL.
Base class with a member CIdentifier to be inherited by a class which has an identity in the environm...
Non-owning reference to a CPropertyIndex with a subset of its features.
Q_REQUIRED_RESULT CPropertyIndexRef copyFrontRemoved() const
Copy with first element removed.
CastType frontCasted() const
First element casted to given type, usually the PropertIndex enum.
bool isMyself() const
Myself index, used with nesting.
static CVariant fromValue(T &&value)
Construct a variant from a value.
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
QString toQString(bool i18n=false) const
Cast as QString.
Value object encapsulating a list of servers.
Value object encapsulating information of a location, kind of simplified CValueObject compliant versi...
void setPropertyByIndex(swift::misc::CPropertyIndexRef index, const QVariant &variant)
Set property by index.
CUrl withSwitchedScheme(const QString &protocol, int port) const
Switch protocol.
bool isEmpty() const
Empty.
CUrl withAppendedPath(const QString &path) const
Append path.
void appendQuery(const QString &queryToAppend)
Append query.
Core data traits (aka cached values) and classes.
Free functions in swift::misc.
#define SWIFT_DEFINE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template definition of mixins for a CValueObject subclass.