13 using namespace swift::config;
17 namespace swift::core::context
24 case CCoreFacadeConfig::Local:
return new CContextNetwork(mode, runtime);
25 case CCoreFacadeConfig::LocalInDBusServer:
28 context->registerWithDBus(ObjectPath(), server);
31 case CCoreFacadeConfig::Remote:
32 return new CContextNetworkProxy(CDBusServer::coreServiceName(connection), connection, mode, runtime);
33 case CCoreFacadeConfig::NotUsed:
38 const QList<QCommandLineOption> &IContextNetwork::getCmdLineOptions()
40 static const QList<QCommandLineOption> e;
41 static const QList<QCommandLineOption> opts {
42 #ifdef SWIFT_VATSIM_SUPPORT
43 QCommandLineOption({
"idAndKey",
"clientIdAndKey" },
44 QCoreApplication::translate(
"CContextNetwork",
45 "Client id and key pair separated by ':', e.g. <id>:<key>."),
54 #ifdef SWIFT_VATSIM_SUPPORT
55 bool IContextNetwork::getCmdLineClientIdAndKey(
int &
id, QString &key)
62 if (IContextNetwork::getCmdLineOptions().isEmpty()) {
return false; }
63 if (!
sApp) {
return false; }
65 if (clientIdAndKey.isEmpty() || !clientIdAndKey.contains(
':')) {
return false; }
66 const QStringList stringList = clientIdAndKey.split(
':');
67 const QString clientIdAsString = stringList[0];
69 id = clientIdAsString.toInt(&ok, 0);
70 if (!ok ||
id == 0) {
return false; }
SWIFT_CORE_EXPORT swift::core::CApplication * sApp
Single instance of application object.
static bool isLocalDeveloperDebugBuild()
Local build for developers.
QString getParserValue(const QString &option) const
Delegates to QCommandLineParser::value.
ContextMode
How to handle a given context.
The class providing facades (the contexts) for all DBus relevant operations.
Empty context, used during shutdown/initialization.
Network context implementation.
Backend services of the swift project, like dealing with the network or the simulators.
Free functions in swift::misc.