mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
using namespace in header removed, rectified resulting changes
* using namespace in context_runtime.h * in same step also fixed some other using namespace issues
This commit is contained in:
@@ -26,9 +26,9 @@ namespace BlackCore
|
||||
~CContext() {}
|
||||
|
||||
//! Log category
|
||||
static const CLogCategoryList &getLogCategories()
|
||||
static const BlackMisc::CLogCategoryList &getLogCategories()
|
||||
{
|
||||
static const CLogCategoryList cats { CLogCategory::context() };
|
||||
static const BlackMisc::CLogCategoryList cats { BlackMisc::CLogCategory::context() };
|
||||
return cats;
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ namespace BlackCore
|
||||
//! Empty context called
|
||||
void logEmptyContextWarning(const QString &functionName) const
|
||||
{
|
||||
CLogMessage(this, CLogCategory::contextSlot()).warning("Empty context called, details: %1") << functionName;
|
||||
BlackMisc::CLogMessage(this, BlackMisc::CLogCategory::contextSlot()).warning("Empty context called, details: %1") << functionName;
|
||||
}
|
||||
|
||||
//! Standard message when status message is returned in empty context
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
/* Copyright (C) 2013 VATSIM Community / authors
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#include "blackcore/context_application_proxy.h"
|
||||
#include "blackcore/input_manager.h"
|
||||
@@ -11,6 +15,8 @@
|
||||
#include <QMetaEnum>
|
||||
#include <QDBusConnection>
|
||||
|
||||
using namespace BlackMisc;
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
|
||||
|
||||
@@ -56,21 +56,21 @@ namespace BlackCore
|
||||
//! \copydoc IContextNetwork::getAtcStationsOnline()
|
||||
virtual const BlackMisc::Aviation::CAtcStationList getAtcStationsOnline() const override
|
||||
{
|
||||
BlackMisc::CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO;
|
||||
BlackMisc::CLogMessage(this, BlackMisc::CLogCategory::contextSlot()).debug() << Q_FUNC_INFO;
|
||||
return this->m_airspace->getAtcStationsOnline();
|
||||
}
|
||||
|
||||
//! \copydoc IContextNetwork::getAtcStationsBooked()
|
||||
virtual const BlackMisc::Aviation::CAtcStationList getAtcStationsBooked() const override
|
||||
{
|
||||
BlackMisc::CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO;
|
||||
BlackMisc::CLogMessage(this, BlackMisc::CLogCategory::contextSlot()).debug() << Q_FUNC_INFO;
|
||||
return this->m_airspace->getAtcStationsBooked();
|
||||
}
|
||||
|
||||
//! \copydoc IContextNetwork::getAircraftInRange()
|
||||
virtual const BlackMisc::Aviation::CAircraftList getAircraftInRange() const override
|
||||
{
|
||||
BlackMisc::CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO;
|
||||
BlackMisc::CLogMessage(this, BlackMisc::CLogCategory::contextSlot()).debug() << Q_FUNC_INFO;
|
||||
return this->m_airspace->getAircraftInRange();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
/* Copyright (C) 2013 VATSIM Community / authors
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#include "blackcore/context_network_proxy.h"
|
||||
#include "blackmisc/voiceroomlist.h"
|
||||
@@ -9,6 +13,10 @@
|
||||
#include <QMetaEnum>
|
||||
#include <QDBusConnection>
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Network;
|
||||
using namespace BlackMisc::Aviation;
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
|
||||
@@ -147,12 +155,12 @@ namespace BlackCore
|
||||
this->m_dBusInterface->callDBus(QLatin1Literal("testCreateDummyOnlineAtcStations"), number);
|
||||
}
|
||||
|
||||
BlackMisc::CStatusMessage CContextNetworkProxy::connectToNetwork(const Network::CServer &server, uint loginMode)
|
||||
CStatusMessage CContextNetworkProxy::connectToNetwork(const CServer &server, uint loginMode)
|
||||
{
|
||||
return this->m_dBusInterface->callDBusRet<BlackMisc::CStatusMessage>(QLatin1Literal("connectToNetwork"), server, loginMode);
|
||||
}
|
||||
|
||||
BlackMisc::CStatusMessage CContextNetworkProxy::disconnectFromNetwork()
|
||||
CStatusMessage CContextNetworkProxy::disconnectFromNetwork()
|
||||
{
|
||||
return this->m_dBusInterface->callDBusRet<BlackMisc::CStatusMessage>(QLatin1Literal("disconnectFromNetwork"));
|
||||
}
|
||||
@@ -167,7 +175,7 @@ namespace BlackCore
|
||||
return this->m_dBusInterface->callDBusRet<bool>(QLatin1Literal("commandLineEntered"), commandLine);
|
||||
}
|
||||
|
||||
void CContextNetworkProxy::sendTextMessages(const BlackMisc::Network::CTextMessageList &textMessages)
|
||||
void CContextNetworkProxy::sendTextMessages(const CTextMessageList &textMessages)
|
||||
{
|
||||
this->m_dBusInterface->callDBus(QLatin1Literal("sendTextMessages"), textMessages);
|
||||
}
|
||||
@@ -177,12 +185,12 @@ namespace BlackCore
|
||||
this->m_dBusInterface->callDBus(QLatin1Literal("sendFlightPlan"), flightPlan);
|
||||
}
|
||||
|
||||
BlackMisc::Aviation::CFlightPlan CContextNetworkProxy::loadFlightPlanFromNetwork(const BlackMisc::Aviation::CCallsign &callsign) const
|
||||
CFlightPlan CContextNetworkProxy::loadFlightPlanFromNetwork(const CCallsign &callsign) const
|
||||
{
|
||||
return this->m_dBusInterface->callDBusRet<BlackMisc::Aviation::CFlightPlan>(QLatin1Literal("loadFlightPlanFromNetwork"), callsign);
|
||||
}
|
||||
|
||||
BlackMisc::Aviation::CInformationMessage CContextNetworkProxy::getMetar(const BlackMisc::Aviation::CAirportIcao &airportIcaoCode)
|
||||
CInformationMessage CContextNetworkProxy::getMetar(const CAirportIcao &airportIcaoCode)
|
||||
{
|
||||
return this->m_dBusInterface->callDBusRet<BlackMisc::Aviation::CInformationMessage>(QLatin1Literal("getMetar"), airportIcaoCode);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace BlackCore
|
||||
virtual bool updateIcaoData(const BlackMisc::Aviation::CAircraftIcao &icaoData, const QString &originator) override;
|
||||
|
||||
//! \copydoc IContextOwnAircraft::updateSelcal
|
||||
virtual bool updateSelcal(const Aviation::CSelcal &selcal, const QString &originator) override;
|
||||
virtual bool updateSelcal(const BlackMisc::Aviation::CSelcal &selcal, const QString &originator) override;
|
||||
|
||||
//! \copydoc IContextOwnAircraft::setAudioOutputVolumes
|
||||
virtual void setAudioOutputVolumes(int outputVolumeCom1, int outputVolumeCom2) override;
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
#include <QMetaEnum>
|
||||
#include <QDBusConnection>
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Aviation;
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
|
||||
@@ -66,17 +69,17 @@ namespace BlackCore
|
||||
return this->m_dBusInterface->callDBusRet<bool>(QLatin1Literal("updatePilot"), pilot, originator);
|
||||
}
|
||||
|
||||
bool CContextOwnAircraftProxy::updateSelcal(const Aviation::CSelcal &selcal, const QString &originator)
|
||||
bool CContextOwnAircraftProxy::updateSelcal(const CSelcal &selcal, const QString &originator)
|
||||
{
|
||||
return this->m_dBusInterface->callDBusRet<bool>(QLatin1Literal("updateSelcal"), selcal, originator);
|
||||
}
|
||||
|
||||
bool CContextOwnAircraftProxy::updateCallsign(const Aviation::CCallsign &callsign, const QString &originator)
|
||||
bool CContextOwnAircraftProxy::updateCallsign(const CCallsign &callsign, const QString &originator)
|
||||
{
|
||||
return this->m_dBusInterface->callDBusRet<bool>(QLatin1Literal("updateCallsign"), callsign, originator);
|
||||
}
|
||||
|
||||
bool CContextOwnAircraftProxy::updateIcaoData(const Aviation::CAircraftIcao &icaoData, const QString &originator)
|
||||
bool CContextOwnAircraftProxy::updateIcaoData(const CAircraftIcao &icaoData, const QString &originator)
|
||||
{
|
||||
return this->m_dBusInterface->callDBusRet<bool>(QLatin1Literal("updateIcaoData"), icaoData, originator);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace BlackCore
|
||||
virtual bool updatePilot(const BlackMisc::Network::CUser &pilot, const QString &originator) override;
|
||||
|
||||
//! \copydoc IContextOwnAircraft::updateSelcal
|
||||
virtual bool updateSelcal(const Aviation::CSelcal &selcal, const QString &originator) override;
|
||||
virtual bool updateSelcal(const BlackMisc::Aviation::CSelcal &selcal, const QString &originator) override;
|
||||
|
||||
//! \copydoc IContextOwnAircraft::updateCallsign
|
||||
virtual bool updateCallsign(const BlackMisc::Aviation::CCallsign &callsign, const QString &originator) override;
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
#include <QMultiMap>
|
||||
#include <QReadWriteLock>
|
||||
|
||||
using namespace BlackMisc;
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
// forward declaration, see review
|
||||
@@ -177,8 +175,8 @@ namespace BlackCore
|
||||
//! initialization of DBus connection (where applicable)
|
||||
void initDBusServer(const QString &dBusAddress);
|
||||
|
||||
//! post init tasks, mainly connecting context signal slots
|
||||
void initPostSetup();
|
||||
//! post init tasks, load simulator and connecting context signal slots
|
||||
void initPostSetup(QMap<QString, int> ×);
|
||||
};
|
||||
} // namespace
|
||||
#endif // guard
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace BlackCore
|
||||
virtual BlackSim::Settings::CSettingsSimulator getSimulatorSettings() const override;
|
||||
|
||||
//! \copydoc IContextSettings::getHotkeys()
|
||||
virtual Settings::CSettingKeyboardHotkeyList getHotkeys() const override;
|
||||
virtual BlackMisc::Settings::CSettingKeyboardHotkeyList getHotkeys() const override;
|
||||
|
||||
//! \copydoc IContextSettings::value
|
||||
virtual BlackMisc::CStatusMessageList value(const QString &path, const QString &command, const BlackMisc::CVariant &value) override;
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
using namespace BlackGui;
|
||||
using namespace BlackGui::Models;
|
||||
using namespace BlackGui::Views;
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackCore;
|
||||
|
||||
|
||||
@@ -66,10 +66,10 @@ namespace BlackGui
|
||||
void ps_audioDeviceSelected(int index);
|
||||
|
||||
//! Current audio devices changed
|
||||
void ps_onCurrentAudioDevicesChanged(const Audio::CAudioDeviceInfoList &devices);
|
||||
void ps_onCurrentAudioDevicesChanged(const BlackMisc::Audio::CAudioDeviceInfoList &devices);
|
||||
|
||||
//! Audio devices changed
|
||||
void ps_onAudioDevicesChanged(const Audio::CAudioDeviceInfoList &devices);
|
||||
void ps_onAudioDevicesChanged(const BlackMisc::Audio::CAudioDeviceInfoList &devices);
|
||||
|
||||
private:
|
||||
//! Audio test modes
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
using namespace BlackGui;
|
||||
using namespace BlackCore;
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Audio;
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
|
||||
@@ -49,9 +49,9 @@ namespace BlackGui
|
||||
static void setRuntimeForComponents(BlackCore::CRuntime *runtime, QWidget *parent);
|
||||
|
||||
//! Log message category
|
||||
static const CLogCategoryList &getLogCategories()
|
||||
static const BlackMisc::CLogCategoryList &getLogCategories()
|
||||
{
|
||||
static const CLogCategoryList cats { CLogCategory::guiComponent() };
|
||||
static const BlackMisc::CLogCategoryList cats { BlackMisc::CLogCategory::guiComponent() };
|
||||
return cats;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "ui_logcomponent.h"
|
||||
#include "../stylesheetutility.h"
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackGui;
|
||||
|
||||
namespace BlackGui
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "ui_mainkeypadareacomponent.h"
|
||||
#include "blackcore/context_audio.h"
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackCore;
|
||||
|
||||
@@ -214,7 +215,7 @@ namespace BlackGui
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Aviation::CAircraft CMainKeypadAreaComponent::getOwnAircraft() const
|
||||
CAircraft CMainKeypadAreaComponent::getOwnAircraft() const
|
||||
{
|
||||
if (!this->getIContextOwnAircraft()) { return CAircraft(); }
|
||||
return this->getIContextOwnAircraft()->getOwnAircraft();
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "blackmisc/iconlist.h"
|
||||
#include "blackmisc/avaircraft.h"
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackCore;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace BlackSimPlugin
|
||||
{
|
||||
BlackCore::ISimulator *CSimulatorFsxFactory::create(QObject *parent)
|
||||
{
|
||||
return new Fsx::CSimulatorFsx(parent);
|
||||
return new CSimulatorFsx(parent);
|
||||
}
|
||||
|
||||
CSimulatorInfo CSimulatorFsxFactory::getSimulatorInfo() const
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
#include <QIcon>
|
||||
#include <QTextStream>
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackCore;
|
||||
|
||||
/*!
|
||||
* DBus tests, tests marshalling / unmarshalling of many value classes.
|
||||
* Forks two processes and sends data via DBus among them.
|
||||
@@ -51,17 +54,17 @@ int main(int argc, char *argv[])
|
||||
QString input = cin.readLine().toLower().trimmed();
|
||||
|
||||
// configure DBus server
|
||||
QString dBusAddress = BlackCore::CDBusServer::sessionDBusServer();
|
||||
QString dBusAddress = CDBusServer::sessionDBusServer();
|
||||
if (input.startsWith("2"))
|
||||
{
|
||||
dBusAddress = BlackCore::CDBusServer::systemDBusServer();
|
||||
dBusAddress = CDBusServer::systemDBusServer();
|
||||
}
|
||||
else if (input.startsWith("3"))
|
||||
{
|
||||
cout << "found: " << BlackMisc::CNetworkUtils::getKnownIpAddresses().join(' ') << endl;
|
||||
cout << "enter ip/port, e.g. 127.0.0.1:45000 (default)" << endl;
|
||||
dBusAddress = cin.readLine().toLower();
|
||||
dBusAddress = BlackCore::CDBusServer::p2pAddress(dBusAddress);
|
||||
dBusAddress = CDBusServer::p2pAddress(dBusAddress);
|
||||
}
|
||||
else if (input.startsWith("x"))
|
||||
{
|
||||
@@ -70,9 +73,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
// with remote audio
|
||||
bool remoteAudio = input.contains("ra");
|
||||
BlackCore::CRuntime *core = remoteAudio ?
|
||||
new BlackCore::CRuntime(BlackCore::CRuntimeConfig::forCoreAllLocalInDBusNoAudio(dBusAddress), &a) :
|
||||
new BlackCore::CRuntime(BlackCore::CRuntimeConfig::forCoreAllLocalInDBus(dBusAddress), &a);
|
||||
CRuntime *core = remoteAudio ?
|
||||
new CRuntime(CRuntimeConfig::forCoreAllLocalInDBusNoAudio(dBusAddress), &a) :
|
||||
new CRuntime(CRuntimeConfig::forCoreAllLocalInDBus(dBusAddress), &a);
|
||||
|
||||
// tool to allow input indepent from event loop
|
||||
QtConcurrent::run(BlackMiscTest::Tool::serverLoop, core); // QFuture<void> future
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <QtConcurrent/QtConcurrent>
|
||||
|
||||
using namespace BlackCore;
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::Audio;
|
||||
@@ -36,7 +37,7 @@ namespace BlackMiscTest
|
||||
/*
|
||||
* Send data to testservice, this sends data to the slots on the server
|
||||
*/
|
||||
void Tool::serverLoop(BlackCore::CRuntime *runtime)
|
||||
void Tool::serverLoop(CRuntime *runtime)
|
||||
{
|
||||
QMetaObject::invokeMethod(CLogHandler::instance(), "enableConsoleOutput", Q_ARG(bool, false));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user