From 9e5f228b082fa88d6a9916b07c728cac619ede92 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Tue, 16 Dec 2014 21:18:50 +0100 Subject: [PATCH] using namespace in header removed, rectified resulting changes * using namespace in context_runtime.h * in same step also fixed some other using namespace issues --- src/blackcore/context.h | 6 ++--- src/blackcore/context_application_proxy.cpp | 14 +++++++--- src/blackcore/context_network_impl.h | 6 ++--- src/blackcore/context_network_proxy.cpp | 26 ++++++++++++------- src/blackcore/context_ownaircraft_impl.h | 2 +- src/blackcore/context_ownaircraft_proxy.cpp | 9 ++++--- src/blackcore/context_ownaircraft_proxy.h | 2 +- src/blackcore/context_runtime.h | 6 ++--- src/blackcore/context_settings_proxy.h | 2 +- .../components/atcstationcomponent.cpp | 1 + src/blackgui/components/audiosetupcomponent.h | 4 +-- .../components/cockpitcomcomponent.cpp | 1 + src/blackgui/components/enableforruntime.h | 4 +-- src/blackgui/components/logcomponent.cpp | 1 + .../components/mainkeypadareacomponent.cpp | 3 ++- .../components/simulatorcomponent.cpp | 1 + .../simulator/fsx/simulator_fsxfactory.cpp | 2 +- src/swiftcore/main.cpp | 15 ++++++----- src/swiftcore/tool.cpp | 3 ++- 19 files changed, 66 insertions(+), 42 deletions(-) diff --git a/src/blackcore/context.h b/src/blackcore/context.h index 02abbe08c..4d04e54bf 100644 --- a/src/blackcore/context.h +++ b/src/blackcore/context.h @@ -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 diff --git a/src/blackcore/context_application_proxy.cpp b/src/blackcore/context_application_proxy.cpp index 3ca1e8e0e..6b0fed6bf 100644 --- a/src/blackcore/context_application_proxy.cpp +++ b/src/blackcore/context_application_proxy.cpp @@ -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 #include +using namespace BlackMisc; + namespace BlackCore { diff --git a/src/blackcore/context_network_impl.h b/src/blackcore/context_network_impl.h index f9ca58e4e..8e1e94c68 100644 --- a/src/blackcore/context_network_impl.h +++ b/src/blackcore/context_network_impl.h @@ -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(); } diff --git a/src/blackcore/context_network_proxy.cpp b/src/blackcore/context_network_proxy.cpp index bb8e34fea..1d3b2bf1c 100644 --- a/src/blackcore/context_network_proxy.cpp +++ b/src/blackcore/context_network_proxy.cpp @@ -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 #include +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(QLatin1Literal("connectToNetwork"), server, loginMode); } - BlackMisc::CStatusMessage CContextNetworkProxy::disconnectFromNetwork() + CStatusMessage CContextNetworkProxy::disconnectFromNetwork() { return this->m_dBusInterface->callDBusRet(QLatin1Literal("disconnectFromNetwork")); } @@ -167,7 +175,7 @@ namespace BlackCore return this->m_dBusInterface->callDBusRet(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(QLatin1Literal("loadFlightPlanFromNetwork"), callsign); } - BlackMisc::Aviation::CInformationMessage CContextNetworkProxy::getMetar(const BlackMisc::Aviation::CAirportIcao &airportIcaoCode) + CInformationMessage CContextNetworkProxy::getMetar(const CAirportIcao &airportIcaoCode) { return this->m_dBusInterface->callDBusRet(QLatin1Literal("getMetar"), airportIcaoCode); } diff --git a/src/blackcore/context_ownaircraft_impl.h b/src/blackcore/context_ownaircraft_impl.h index 58052fcd9..6d7b7c533 100644 --- a/src/blackcore/context_ownaircraft_impl.h +++ b/src/blackcore/context_ownaircraft_impl.h @@ -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; diff --git a/src/blackcore/context_ownaircraft_proxy.cpp b/src/blackcore/context_ownaircraft_proxy.cpp index 3b4ae8a70..4a1c30586 100644 --- a/src/blackcore/context_ownaircraft_proxy.cpp +++ b/src/blackcore/context_ownaircraft_proxy.cpp @@ -8,6 +8,9 @@ #include #include +using namespace BlackMisc; +using namespace BlackMisc::Aviation; + namespace BlackCore { @@ -66,17 +69,17 @@ namespace BlackCore return this->m_dBusInterface->callDBusRet(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(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(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(QLatin1Literal("updateIcaoData"), icaoData, originator); } diff --git a/src/blackcore/context_ownaircraft_proxy.h b/src/blackcore/context_ownaircraft_proxy.h index 2f7ff0779..51d6083c7 100644 --- a/src/blackcore/context_ownaircraft_proxy.h +++ b/src/blackcore/context_ownaircraft_proxy.h @@ -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; diff --git a/src/blackcore/context_runtime.h b/src/blackcore/context_runtime.h index 55361db60..a9a2827b4 100644 --- a/src/blackcore/context_runtime.h +++ b/src/blackcore/context_runtime.h @@ -19,8 +19,6 @@ #include #include -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 ×); }; } // namespace #endif // guard diff --git a/src/blackcore/context_settings_proxy.h b/src/blackcore/context_settings_proxy.h index 04ffffe42..9574ab41a 100644 --- a/src/blackcore/context_settings_proxy.h +++ b/src/blackcore/context_settings_proxy.h @@ -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; diff --git a/src/blackgui/components/atcstationcomponent.cpp b/src/blackgui/components/atcstationcomponent.cpp index d799815c5..bbca42cc7 100644 --- a/src/blackgui/components/atcstationcomponent.cpp +++ b/src/blackgui/components/atcstationcomponent.cpp @@ -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; diff --git a/src/blackgui/components/audiosetupcomponent.h b/src/blackgui/components/audiosetupcomponent.h index b18c543cd..6d5e8f087 100644 --- a/src/blackgui/components/audiosetupcomponent.h +++ b/src/blackgui/components/audiosetupcomponent.h @@ -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 diff --git a/src/blackgui/components/cockpitcomcomponent.cpp b/src/blackgui/components/cockpitcomcomponent.cpp index 9425601da..24fe35a94 100644 --- a/src/blackgui/components/cockpitcomcomponent.cpp +++ b/src/blackgui/components/cockpitcomcomponent.cpp @@ -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; diff --git a/src/blackgui/components/enableforruntime.h b/src/blackgui/components/enableforruntime.h index 0c6ff09d8..5c4f64217 100644 --- a/src/blackgui/components/enableforruntime.h +++ b/src/blackgui/components/enableforruntime.h @@ -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; } diff --git a/src/blackgui/components/logcomponent.cpp b/src/blackgui/components/logcomponent.cpp index 657c34c9a..18433895a 100644 --- a/src/blackgui/components/logcomponent.cpp +++ b/src/blackgui/components/logcomponent.cpp @@ -11,6 +11,7 @@ #include "ui_logcomponent.h" #include "../stylesheetutility.h" +using namespace BlackMisc; using namespace BlackGui; namespace BlackGui diff --git a/src/blackgui/components/mainkeypadareacomponent.cpp b/src/blackgui/components/mainkeypadareacomponent.cpp index 5582022aa..39a1ced16 100644 --- a/src/blackgui/components/mainkeypadareacomponent.cpp +++ b/src/blackgui/components/mainkeypadareacomponent.cpp @@ -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(); diff --git a/src/blackgui/components/simulatorcomponent.cpp b/src/blackgui/components/simulatorcomponent.cpp index 914bb8cad..51f6804af 100644 --- a/src/blackgui/components/simulatorcomponent.cpp +++ b/src/blackgui/components/simulatorcomponent.cpp @@ -15,6 +15,7 @@ #include "blackmisc/iconlist.h" #include "blackmisc/avaircraft.h" +using namespace BlackMisc; using namespace BlackMisc::Aviation; using namespace BlackCore; diff --git a/src/plugins/simulator/fsx/simulator_fsxfactory.cpp b/src/plugins/simulator/fsx/simulator_fsxfactory.cpp index dcef4c98c..44137ba95 100644 --- a/src/plugins/simulator/fsx/simulator_fsxfactory.cpp +++ b/src/plugins/simulator/fsx/simulator_fsxfactory.cpp @@ -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 diff --git a/src/swiftcore/main.cpp b/src/swiftcore/main.cpp index e5e33e3c0..7730d50df 100644 --- a/src/swiftcore/main.cpp +++ b/src/swiftcore/main.cpp @@ -24,6 +24,9 @@ #include #include +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 future diff --git a/src/swiftcore/tool.cpp b/src/swiftcore/tool.cpp index 3c3e69873..7c1ee2600 100644 --- a/src/swiftcore/tool.cpp +++ b/src/swiftcore/tool.cpp @@ -16,6 +16,7 @@ #include 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));