diff --git a/src/blackcore/airspace_monitor.cpp b/src/blackcore/airspace_monitor.cpp index eaadff5fc..487d11fbd 100644 --- a/src/blackcore/airspace_monitor.cpp +++ b/src/blackcore/airspace_monitor.cpp @@ -90,7 +90,7 @@ namespace BlackCore CUser user = station.getController(); users.push_back(user); } - foreach(CAircraft aircraft, this->m_aircraftsInRange) + foreach(CAircraft aircraft, this->m_aircraftInRange) { CUser user = aircraft.getPilot(); users.push_back(user); @@ -112,8 +112,8 @@ namespace BlackCore users.push_back(ownAircraft.getPilot()); } - // do aircrafts first, this will handle most callsigns - foreach(CAircraft aircraft, this->m_aircraftsInRange) + // do aircraft first, this will handle most callsigns + foreach(CAircraft aircraft, this->m_aircraftInRange) { if (searchList.isEmpty()) break; CCallsign callsign = aircraft.getCallsign(); @@ -210,7 +210,7 @@ namespace BlackCore { if (!this->m_network->isConnected()) return; - foreach(CAircraft aircraft, this->m_aircraftsInRange) + foreach(CAircraft aircraft, this->m_aircraftInRange) { this->m_network->sendFrequencyQuery(aircraft.getCallsign()); this->m_network->sendIcaoCodesQuery(aircraft.getCallsign()); @@ -244,7 +244,7 @@ namespace BlackCore this->m_atcStationsBooked.applyIf(&CAtcStation::getCallsign, callsign, vm); vm = CPropertyIndexVariantMap({CAircraft::IndexPilot, CUser::IndexRealName}, realname); - this->m_aircraftsInRange.applyIf(&CAircraft::getCallsign, callsign, vm); + this->m_aircraftInRange.applyIf(&CAircraft::getCallsign, callsign, vm); // Client vm = CPropertyIndexVariantMap({CClient::IndexUser, CUser::IndexRealName}, realname); @@ -347,13 +347,14 @@ namespace BlackCore m_atcStationsOnline.clear(); } - void CAirspaceMonitor::removeAllAircrafts() + void CAirspaceMonitor::removeAllAircraft() { m_aircraftWatchdog.removeAll(); - for(CAircraft aircraft : m_aircraftsInRange) + for (CAircraft aircraft : m_aircraftInRange) + { emit removedAircraft(aircraft.getCallsign()); - - m_aircraftsInRange.clear(); + } + m_aircraftInRange.clear(); } void CAirspaceMonitor::removeAllOtherClients() @@ -521,20 +522,20 @@ namespace BlackCore if (!icaoData.hasAircraftDesignator()) { // empty so far, try to fetch from data file - qDebug() << "Empty ICAO info for " << callsign << icaoData; + CLogMessage(this).debug() << "Empty ICAO info for %1 %2" << callsign << icaoData; CAircraftIcao icaoDataDataFile = this->m_vatsimDataFileReader->getIcaoInfo(callsign); if (!icaoDataDataFile.hasAircraftDesignator()) return; // give up! vm = CPropertyIndexVariantMap(CAircraft::IndexIcao, icaoData.toCVariant()); } - int changed = this->m_aircraftsInRange.applyIf(&CAircraft::getCallsign, callsign, vm, true); - if (changed > 0) {emit this->changedAircraftsInRange();} + int changed = this->m_aircraftInRange.applyIf(&CAircraft::getCallsign, callsign, vm, true); + if (changed > 0) { emit this->changedAircraftInRange(); } } void CAirspaceMonitor::ps_aircraftUpdateReceived(const CCallsign &callsign, const CAircraftSituation &situation, const CTransponder &transponder) { Q_ASSERT(BlackCore::isCurrentThreadCreatingThread(this)); - CAircraftList list = this->m_aircraftsInRange.findByCallsign(callsign); + CAircraftList list = this->m_aircraftInRange.findByCallsign(callsign); if (list.isEmpty()) { // new aircraft @@ -544,7 +545,7 @@ namespace BlackCore aircraft.setTransponder(transponder); aircraft.setCalculcatedDistanceToPosition(this->m_ownAircraft.getPosition()); // distance from myself this->m_vatsimDataFileReader->updateWithVatsimDataFileData(aircraft); - this->m_aircraftsInRange.push_back(aircraft); + this->m_aircraftInRange.push_back(aircraft); // and new client, there is a chance it has been created by // custom packet first @@ -579,22 +580,22 @@ namespace BlackCore vm.addValue(CAircraft::IndexDistance, distance); // here I expect always a changed value - this->m_aircraftsInRange.applyIf(&CAircraft::getCallsign, callsign, vm, false); + this->m_aircraftInRange.applyIf(&CAircraft::getCallsign, callsign, vm, false); this->m_aircraftWatchdog.resetCallsign(callsign); emit this->changedAircraftSituation(callsign, situation); } - emit this->changedAircraftsInRange(); + emit this->changedAircraftInRange(); } void CAirspaceMonitor::ps_pilotDisconnected(const CCallsign &callsign) { Q_ASSERT(BlackCore::isCurrentThreadCreatingThread(this)); - bool contains = this->m_aircraftsInRange.contains(&CAircraft::getCallsign, callsign); + bool contains = this->m_aircraftInRange.contains(&CAircraft::getCallsign, callsign); this->m_aircraftWatchdog.removeCallsign(callsign); if (contains) { - this->m_aircraftsInRange.removeIf(&CAircraft::getCallsign, callsign); + this->m_aircraftInRange.removeIf(&CAircraft::getCallsign, callsign); this->m_otherClients.removeIf(&CClient::getCallsign, callsign); emit this->removedAircraft(callsign); } @@ -606,8 +607,8 @@ namespace BlackCore // update CPropertyIndexVariantMap vm({CAircraft::IndexCom1System, CComSystem::IndexActiveFrequency}, frequency.toCVariant()); - int changed = this->m_aircraftsInRange.applyIf(&CAircraft::getCallsign, callsign, vm, true); - if (changed > 0) { emit this->changedAircraftsInRange(); } + int changed = this->m_aircraftInRange.applyIf(&CAircraft::getCallsign, callsign, vm, true); + if (changed > 0) { emit this->changedAircraftInRange(); } } } // namespace diff --git a/src/blackcore/airspace_monitor.h b/src/blackcore/airspace_monitor.h index 71723d0cc..b8615342a 100644 --- a/src/blackcore/airspace_monitor.h +++ b/src/blackcore/airspace_monitor.h @@ -62,7 +62,7 @@ namespace BlackCore BlackMisc::Aviation::CAtcStationList getAtcStationsBooked() const { return m_atcStationsBooked; } //! Returns the current aircraft in range - BlackMisc::Aviation::CAircraftList getAircraftInRange() const { return m_aircraftsInRange; } + BlackMisc::Aviation::CAircraftList getAircraftInRange() const { return m_aircraftInRange; } //! Returns the closest ATC station operating on the given frequency, if any BlackMisc::Aviation::CAtcStation getAtcStationForComUnit(const BlackMisc::Aviation::CComSystem &comSystem); @@ -86,8 +86,8 @@ namespace BlackCore //! Connection status of an ATC station was changed void changedAtcStationOnlineConnectionStatus(const BlackMisc::Aviation::CAtcStation &station, bool isConnected); - //! Aircrafts were changed - void changedAircraftsInRange(); + //! Aircraft were changed + void changedAircraftInRange(); //! A new aircraft appeared void addedAircraft(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CAircraftSituation &initialSituation); @@ -98,8 +98,6 @@ namespace BlackCore //! An aircraft disappeared void removedAircraft(const BlackMisc::Aviation::CCallsign &callsign); - //! Sent a status message - void statusMessage(const BlackMisc::CStatusMessage &msg); public slots: //! Own aircraft updated @@ -113,7 +111,7 @@ namespace BlackCore void clear() { removeAllAtcStations(); - removeAllAircrafts(); + removeAllAircraft(); removeAllOtherClients(); m_metarCache.clear(); m_flightPlanCache.clear(); @@ -122,7 +120,7 @@ namespace BlackCore private: BlackMisc::Aviation::CAtcStationList m_atcStationsOnline; BlackMisc::Aviation::CAtcStationList m_atcStationsBooked; - BlackMisc::Aviation::CAircraftList m_aircraftsInRange; + BlackMisc::Aviation::CAircraftList m_aircraftInRange; BlackMisc::Network::CClientList m_otherClients; QMap m_metarCache; QMap m_flightPlanCache; @@ -145,7 +143,7 @@ namespace BlackCore void addVoiceCapabilitiesFromDataFile(BlackMisc::CPropertyIndexVariantMap &vm, const BlackMisc::Aviation::CCallsign &callsign); void removeAllAtcStations(); - void removeAllAircrafts(); + void removeAllAircraft(); void removeAllOtherClients(); private slots: diff --git a/src/blackcore/context_application.h b/src/blackcore/context_application.h index df595c35e..93a413ab3 100644 --- a/src/blackcore/context_application.h +++ b/src/blackcore/context_application.h @@ -116,8 +116,6 @@ namespace BlackCore //! Change settings void changeSettings(uint typeValue); - private: - mutable QReadWriteLock m_lock; //!< thread safety }; } diff --git a/src/blackcore/context_network.h b/src/blackcore/context_network.h index b49f41d31..0fe3c8d5c 100644 --- a/src/blackcore/context_network.h +++ b/src/blackcore/context_network.h @@ -81,10 +81,10 @@ namespace BlackCore void changedAtcStationsBookedDigest(); //! Aircraft list has been changed - void changedAircraftsInRange(); + void changedAircraftInRange(); - //! Digest signal changedAircraftsInRange() - void changedAircraftsInRangeDigest(); + //! Digest signal changedAircraftInRange() + void changedAircraftInRangeDigest(); //! Aircraft situation update void changedAircraftSituation(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CAircraftSituation &situation); @@ -128,7 +128,7 @@ namespace BlackCore virtual const BlackMisc::Aviation::CAtcStationList getAtcStationsBooked() const = 0 ; //! Aircraft list - virtual const BlackMisc::Aviation::CAircraftList getAircraftsInRange() const = 0; + virtual const BlackMisc::Aviation::CAircraftList getAircraftInRange() const = 0; //! Get all users virtual BlackMisc::Network::CUserList getUsers() const = 0; diff --git a/src/blackcore/context_network_empty.h b/src/blackcore/context_network_empty.h index 8e2e400df..668e4a8dc 100644 --- a/src/blackcore/context_network_empty.h +++ b/src/blackcore/context_network_empty.h @@ -53,8 +53,8 @@ namespace BlackCore return BlackMisc::Aviation::CAtcStationList(); } - //! \copydoc IContextNetwork::getAircraftsInRange() - virtual const BlackMisc::Aviation::CAircraftList getAircraftsInRange() const override + //! \copydoc IContextNetwork::getAircraftInRange() + virtual const BlackMisc::Aviation::CAircraftList getAircraftInRange() const override { logEmptyContextWarning(Q_FUNC_INFO); return BlackMisc::Aviation::CAircraftList(); diff --git a/src/blackcore/context_network_impl.cpp b/src/blackcore/context_network_impl.cpp index d6985b320..ca30ee62c 100644 --- a/src/blackcore/context_network_impl.cpp +++ b/src/blackcore/context_network_impl.cpp @@ -74,7 +74,7 @@ namespace BlackCore connect(this->m_airspace, &CAirspaceMonitor::changedAtcStationsOnline, this, &CContextNetwork::changedAtcStationsOnline); connect(this->m_airspace, &CAirspaceMonitor::changedAtcStationsBooked, this, &CContextNetwork::changedAtcStationsBooked); connect(this->m_airspace, &CAirspaceMonitor::changedAtcStationOnlineConnectionStatus, this, &CContextNetwork::changedAtcStationOnlineConnectionStatus); - connect(this->m_airspace, &CAirspaceMonitor::changedAircraftsInRange, this, &CContextNetwork::changedAircraftsInRange); + connect(this->m_airspace, &CAirspaceMonitor::changedAircraftInRange, this, &CContextNetwork::changedAircraftInRange); connect(this->m_airspace, &CAirspaceMonitor::changedAircraftSituation, this, &CContextNetwork::changedAircraftSituation); connect(this->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraft, this->m_airspace, &CAirspaceMonitor::setOwnAircraft); connect(this->getIContextSimulator(), &IContextSimulator::ownAircraftModelChanged, this->m_airspace, &CAirspaceMonitor::setOwnAircraftModel); diff --git a/src/blackcore/context_network_impl.h b/src/blackcore/context_network_impl.h index 1c07db864..f9ca58e4e 100644 --- a/src/blackcore/context_network_impl.h +++ b/src/blackcore/context_network_impl.h @@ -67,8 +67,8 @@ namespace BlackCore return this->m_airspace->getAtcStationsBooked(); } - //! \copydoc IContextNetwork::getAircraftsInRange() - virtual const BlackMisc::Aviation::CAircraftList getAircraftsInRange() const override + //! \copydoc IContextNetwork::getAircraftInRange() + virtual const BlackMisc::Aviation::CAircraftList getAircraftInRange() const override { BlackMisc::CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; return this->m_airspace->getAircraftInRange(); @@ -163,7 +163,7 @@ namespace BlackCore BlackMisc::CDigestSignal m_dsAtcStationsBookedChanged { this, &IContextNetwork::changedAtcStationsBooked, &IContextNetwork::changedAtcStationsBookedDigest, 750, 2 }; BlackMisc::CDigestSignal m_dsAtcStationsOnlineChanged { this, &IContextNetwork::changedAtcStationsOnline, &IContextNetwork::changedAtcStationsOnlineDigest, 750, 4 }; - BlackMisc::CDigestSignal m_dsAircraftsInRangeChanged { this, &IContextNetwork::changedAircraftsInRange, &IContextNetwork::changedAircraftsInRangeDigest, 750, 4 }; + BlackMisc::CDigestSignal m_dsAircraftsInRangeChanged { this, &IContextNetwork::changedAircraftInRange, &IContextNetwork::changedAircraftInRangeDigest, 750, 4 }; // for reading XML and VATSIM data files CVatsimBookingReader *m_vatsimBookingReader = nullptr; diff --git a/src/blackcore/context_network_proxy.cpp b/src/blackcore/context_network_proxy.cpp index 2acb7b85d..bb8e34fea 100644 --- a/src/blackcore/context_network_proxy.cpp +++ b/src/blackcore/context_network_proxy.cpp @@ -44,13 +44,13 @@ namespace BlackCore "changedAtcStationsOnlineDigest", this, SIGNAL(changedAtcStationsOnlineDigest())); Q_ASSERT(s); s = connection.connect(serviceName, IContextNetwork::ObjectPath(), IContextNetwork::InterfaceName(), - "changedAircraftsInRange", this, SIGNAL(changedAircraftsInRange())); + "changedAircraftInRange", this, SIGNAL(changedAircraftInRange())); Q_ASSERT(s); s = connection.connect(serviceName, IContextNetwork::ObjectPath(), IContextNetwork::InterfaceName(), "changedAtcStationOnlineConnectionStatus", this, SIGNAL(changedAtcStationOnlineConnectionStatus(BlackMisc::Aviation::CAtcStation, bool))); Q_ASSERT(s); s = connection.connect(serviceName, IContextNetwork::ObjectPath(), IContextNetwork::InterfaceName(), - "changedAircraftsInRangeDigest", this, SIGNAL(changedAircraftsInRangeDigest())); + "changedAircraftInRangeDigest", this, SIGNAL(changedAircraftInRangeDigest())); Q_ASSERT(s); s = connection.connect(serviceName, IContextNetwork::ObjectPath(), IContextNetwork::InterfaceName(), "connectionTerminated", this, SIGNAL(connectionTerminated())); @@ -82,9 +82,9 @@ namespace BlackCore return this->m_dBusInterface->callDBusRet(QLatin1Literal("getAtcStationsBooked")); } - const BlackMisc::Aviation::CAircraftList CContextNetworkProxy::getAircraftsInRange() const + const BlackMisc::Aviation::CAircraftList CContextNetworkProxy::getAircraftInRange() const { - return this->m_dBusInterface->callDBusRet(QLatin1Literal("getAircraftsInRange")); + return this->m_dBusInterface->callDBusRet(QLatin1Literal("getAircraftInRange")); } BlackMisc::Network::CUserList CContextNetworkProxy::getUsers() const diff --git a/src/blackcore/context_network_proxy.h b/src/blackcore/context_network_proxy.h index e44104152..2c74fe521 100644 --- a/src/blackcore/context_network_proxy.h +++ b/src/blackcore/context_network_proxy.h @@ -62,8 +62,8 @@ namespace BlackCore //! \copydoc IContextNetwork::getAtcStationsBooked() virtual const BlackMisc::Aviation::CAtcStationList getAtcStationsBooked() const override; - //! \copydoc IContextNetwork::getAircraftsInRange() - virtual const BlackMisc::Aviation::CAircraftList getAircraftsInRange() const override; + //! \copydoc IContextNetwork::getAircraftInRange() + virtual const BlackMisc::Aviation::CAircraftList getAircraftInRange() const override; //! \copydoc IContextNetwork::connectToNetwork virtual BlackMisc::CStatusMessage connectToNetwork(const BlackMisc::Network::CServer &server, uint mode) override; diff --git a/src/blackcore/interpolator.h b/src/blackcore/interpolator.h index dd9c1d8e5..48c27e97d 100644 --- a/src/blackcore/interpolator.h +++ b/src/blackcore/interpolator.h @@ -11,41 +11,29 @@ namespace BlackCore { - //! \brief Interpolator, calculation inbetween positions + //! Interpolator, calculation inbetween positions class IInterpolator { public: - //! \brief Default constructor + //! Default constructor IInterpolator() {} - //! \brief Virtual destructor + //! Virtual destructor virtual ~IInterpolator() {} - //! \brief Init object + //! Init object virtual void initialize() = 0; - /*! - * \brief Add new aircraft situation - * \param situation - */ + //! Add new aircraft situation virtual void addAircraftSituation(const BlackMisc::Aviation::CAircraftSituation &situation) = 0; - /*! - * \brief Do we have enough situations to start calculating? - * \return - */ + //! Do we have enough situations to start calculating? virtual bool hasEnoughAircraftSituations() const = 0; - /*! - * \brief Get current aircraft situation - * \return - */ + //! Get current aircraft situation virtual BlackMisc::Aviation::CAircraftSituation getCurrentSituation() = 0; - /*! - * \brief Get timestamp of the last received aircraft situation - * \return - */ + //! Get timestamp of the last received aircraft situation virtual const QDateTime &getTimeOfLastReceivedSituation() const = 0; }; diff --git a/src/blackcore/network.h b/src/blackcore/network.h index 6872d29de..db9294a8b 100644 --- a/src/blackcore/network.h +++ b/src/blackcore/network.h @@ -1,11 +1,13 @@ -/* 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. + */ -/*! - \file -*/ +//! \file #ifndef BLACKCORE_NETWORK_H #define BLACKCORE_NETWORK_H diff --git a/src/blackcore/simulator.h b/src/blackcore/simulator.h index e181ab2b5..d4093ecfc 100644 --- a/src/blackcore/simulator.h +++ b/src/blackcore/simulator.h @@ -49,7 +49,6 @@ namespace BlackCore virtual bool isConnected() const = 0; //! Can we connect? - //! \todo currently some code in XPlane implementation prevents to make the function const, can we fix this virtual bool canConnect() const = 0; //! Is time synchronization on? diff --git a/src/blackcore/vatsimdatafilereader.cpp b/src/blackcore/vatsimdatafilereader.cpp index 2a6125a8f..9fc983795 100644 --- a/src/blackcore/vatsimdatafilereader.cpp +++ b/src/blackcore/vatsimdatafilereader.cpp @@ -52,10 +52,10 @@ namespace BlackCore this->setPendingNetworkReply(r); } - CAircraftList CVatsimDataFileReader::getAircrafts() const + CAircraftList CVatsimDataFileReader::getAircraft() const { QReadLocker rl(&this->m_lock); - return this->m_aircrafts; + return this->m_aircraft; } CAtcStationList CVatsimDataFileReader::getAtcStations() const @@ -78,7 +78,7 @@ namespace BlackCore CUserList CVatsimDataFileReader::getPilotsForCallsigns(const CCallsignList &callsigns) { - return this->getAircrafts().findByCallsigns(callsigns).transform(Predicates::MemberTransform(&CAircraft::getPilot)); + return this->getAircraft().findByCallsigns(callsigns).transform(Predicates::MemberTransform(&CAircraft::getPilot)); } CUserList CVatsimDataFileReader::getPilotsForCallsign(const CCallsign &callsign) @@ -90,7 +90,7 @@ namespace BlackCore CAircraftIcao CVatsimDataFileReader::getIcaoInfo(const CCallsign &callsign) { - CAircraft aircraft = this->getAircrafts().findFirstByCallsign(callsign); + CAircraft aircraft = this->getAircraft().findFirstByCallsign(callsign); return aircraft.getIcaoInfo(); } @@ -109,7 +109,7 @@ namespace BlackCore void CVatsimDataFileReader::updateWithVatsimDataFileData(CAircraft &aircraftToBeUdpated) const { - this->getAircrafts().updateWithVatsimDataFileData(aircraftToBeUdpated); + this->getAircraft().updateWithVatsimDataFileData(aircraftToBeUdpated); } CUserList CVatsimDataFileReader::getControllersForCallsign(const CCallsign &callsign) @@ -188,7 +188,7 @@ namespace BlackCore CServerList voiceServers; CServerList fsdServers; CAtcStationList atcStations; - CAircraftList aircrafts; + CAircraftList aircraft; QMap voiceCapabilities; QDateTime updateTimestampFromFile; @@ -259,7 +259,7 @@ namespace BlackCore double groundspeed = clientPartsMap["groundspeed"].toDouble(); CAircraftSituation situation(position, altitude); situation.setGroundspeed(CSpeed(groundspeed, CSpeedUnit::kts())); - CAircraft aircraft(user.getCallsign().getStringAsSet(), user, situation); + CAircraft currentAircraft(user.getCallsign().getStringAsSet(), user, situation); QString icaoCode = clientPartsMap["planned_aircraft"]; if (!icaoCode.isEmpty()) @@ -270,7 +270,7 @@ namespace BlackCore icaoCode = icaoCode.replace(reg, "").trimmed().toUpper(); if (CAircraftIcao::isValidDesignator(icaoCode)) { - aircraft.setIcaoInfo(CAircraftIcao(icaoCode)); + currentAircraft.setIcaoInfo(CAircraftIcao(icaoCode)); } else { @@ -278,7 +278,7 @@ namespace BlackCore } } - aircrafts.push_back(aircraft); + aircraft.push_back(currentAircraft); } else if (clientType.startsWith('a')) { @@ -340,7 +340,7 @@ namespace BlackCore { QWriteLocker wl(&this->m_lock); this->setUpdateTimestamp(updateTimestampFromFile); - this->m_aircrafts = aircrafts; + this->m_aircraft = aircraft; this->m_atcStations = atcStations; this->m_voiceServers = voiceServers; this->m_fsdServers = fsdServers; diff --git a/src/blackcore/vatsimdatafilereader.h b/src/blackcore/vatsimdatafilereader.h index e9c347bd2..369147746 100644 --- a/src/blackcore/vatsimdatafilereader.h +++ b/src/blackcore/vatsimdatafilereader.h @@ -43,7 +43,7 @@ namespace BlackCore //! Get aircrafts //! \threadsafe - BlackMisc::Aviation::CAircraftList getAircrafts() const; + BlackMisc::Aviation::CAircraftList getAircraft() const; //! Get aircrafts //! \threadsafe @@ -104,7 +104,7 @@ namespace BlackCore BlackMisc::Network::CServerList m_voiceServers; BlackMisc::Network::CServerList m_fsdServers; BlackMisc::Aviation::CAtcStationList m_atcStations; - BlackMisc::Aviation::CAircraftList m_aircrafts; + BlackMisc::Aviation::CAircraftList m_aircraft; QMap m_voiceCapabilities; //! Split line and assign values to their corresponding attribute names diff --git a/src/blackgui/components/aircraftcomponent.cpp b/src/blackgui/components/aircraftcomponent.cpp index e6e541b18..d67932053 100644 --- a/src/blackgui/components/aircraftcomponent.cpp +++ b/src/blackgui/components/aircraftcomponent.cpp @@ -61,12 +61,7 @@ namespace BlackGui bool visible = (this->isVisibleWidget() && this->currentWidget() == this->ui->tb_AircraftsInRange); if (this->countAircrafts() < 1 || visible) { - this->ui->tvp_AircraftsInRange->updateContainer(this->getIContextNetwork()->getAircraftsInRange()); - } - else - { - // KWB remove: qDebug() will be removed soon - qDebug() << this->objectName() << "Skipping update (aircrafts)"; + this->ui->tvp_AircraftsInRange->updateContainer(this->getIContextNetwork()->getAircraftInRange()); } } if (this->getIContextSimulator()->isConnected()) @@ -76,10 +71,6 @@ namespace BlackGui { this->ui->tvp_AirportsInRange->updateContainer(this->getIContextSimulator()->getAirportsInRange()); } - else - { - qDebug() << this->objectName() << "Skipping update (airports)"; - } } } diff --git a/src/blackgui/components/atcstationcomponent.cpp b/src/blackgui/components/atcstationcomponent.cpp index 6aa89a72e..0441c6f6d 100644 --- a/src/blackgui/components/atcstationcomponent.cpp +++ b/src/blackgui/components/atcstationcomponent.cpp @@ -27,7 +27,7 @@ namespace BlackGui { CAtcStationComponent::CAtcStationComponent(QWidget *parent) : QTabWidget(parent), - ui(new Ui::CAtcStationComponent), m_updateTimer(nullptr) + ui(new Ui::CAtcStationComponent) { ui->setupUi(this); this->tabBar()->setExpanding(false); diff --git a/src/blackgui/components/atcstationcomponent.h b/src/blackgui/components/atcstationcomponent.h index 943cf3756..f9b0d62f2 100644 --- a/src/blackgui/components/atcstationcomponent.h +++ b/src/blackgui/components/atcstationcomponent.h @@ -113,7 +113,7 @@ namespace BlackGui private: QScopedPointer ui; - CUpdateTimer *m_updateTimer; + CUpdateTimer *m_updateTimer = nullptr; QDateTime m_timestampLastReadOnlineStations = CUpdateTimer::epoch(); //!< stations read QDateTime m_timestampOnlineStationsChanged = CUpdateTimer::epoch(); //!< stations marked as changed QDateTime m_timestampLastReadBookedStations = CUpdateTimer::epoch(); //!< stations read diff --git a/src/blackgui/components/settingscomponent.cpp b/src/blackgui/components/settingscomponent.cpp index f9c96e2ee..858c05d99 100644 --- a/src/blackgui/components/settingscomponent.cpp +++ b/src/blackgui/components/settingscomponent.cpp @@ -105,7 +105,7 @@ namespace BlackGui // Opacity, intervals this->connect(this->ui->hs_SettingsGuiOpacity, &QSlider::valueChanged, this, &CSettingsComponent::changedWindowsOpacity); - this->connect(this->ui->hs_SettingsGuiAircraftRefreshTime, &QSlider::valueChanged, this, &CSettingsComponent::changedAircraftsUpdateInterval); + this->connect(this->ui->hs_SettingsGuiAircraftRefreshTime, &QSlider::valueChanged, this, &CSettingsComponent::changedAircraftUpdateInterval); this->connect(this->ui->hs_SettingsGuiAtcRefreshTime, &QSlider::valueChanged, this, &CSettingsComponent::changedAtcStationsUpdateInterval); this->connect(this->ui->hs_SettingsGuiUserRefreshTime, &QSlider::valueChanged, this, &CSettingsComponent::changedUsersUpdateInterval); diff --git a/src/blackgui/components/settingscomponent.h b/src/blackgui/components/settingscomponent.h index bfdd0e07f..bdf86aa30 100644 --- a/src/blackgui/components/settingscomponent.h +++ b/src/blackgui/components/settingscomponent.h @@ -76,7 +76,7 @@ namespace BlackGui void changedAtcStationsUpdateInterval(int seconds); //! Update interval changed (aircrafts) - void changedAircraftsUpdateInterval(int seconds); + void changedAircraftUpdateInterval(int seconds); //! Update interval changed (users) void changedUsersUpdateInterval(int seconds); diff --git a/src/blackgui/components/textmessagecomponent.ui b/src/blackgui/components/textmessagecomponent.ui index fc2d13e1f..6b0e60ec7 100644 --- a/src/blackgui/components/textmessagecomponent.ui +++ b/src/blackgui/components/textmessagecomponent.ui @@ -103,6 +103,9 @@ UNICOM + + QTextEdit::NoWrap + true diff --git a/src/blackgui/models/aircraftlistmodel.h b/src/blackgui/models/aircraftlistmodel.h index f1f8f2251..ce4766d6b 100644 --- a/src/blackgui/models/aircraftlistmodel.h +++ b/src/blackgui/models/aircraftlistmodel.h @@ -22,9 +22,7 @@ namespace BlackGui namespace Models { - /*! - * Aircraft list model - */ + //! Aircraft list model class CAircraftListModel : public CListModelBase { diff --git a/src/blackgui/views/clientview.cpp b/src/blackgui/views/clientview.cpp index 98576b2f8..094ff0f08 100644 --- a/src/blackgui/views/clientview.cpp +++ b/src/blackgui/views/clientview.cpp @@ -22,5 +22,5 @@ namespace BlackGui { this->standardInit(new CClientListModel(this)); } - } -} + } // namespace +} // namespace diff --git a/src/blackmisc/avaircrafticao.cpp b/src/blackmisc/avaircrafticao.cpp index 7cd5f083c..b70000f4b 100644 --- a/src/blackmisc/avaircrafticao.cpp +++ b/src/blackmisc/avaircrafticao.cpp @@ -64,11 +64,11 @@ namespace BlackMisc bool CAircraftIcao::matchesWildcardIcao(const CAircraftIcao &otherIcao) const { if ((*this) == otherIcao) return true; - if (otherIcao.hasAircraftDesignator() && otherIcao.getAircraftDesignator() != this->getAircraftDesignator()) return false; - if (otherIcao.hasAirlineDesignator() && otherIcao.getAirlineDesignator() != this->getAirlineDesignator()) return false; - if (otherIcao.hasAircraftCombinedType() && otherIcao.getAircraftCombinedType() != this->getAircraftCombinedType()) return false; - if (otherIcao.hasLivery() && otherIcao.getLivery() != this->getLivery()) return false; - if (otherIcao.hasAircraftColor() && otherIcao.getAircraftColor() != this->getAircraftColor()) return false; + if (otherIcao.hasAircraftDesignator() && otherIcao.getAircraftDesignator() != this->getAircraftDesignator()) { return false; } + if (otherIcao.hasAirlineDesignator() && otherIcao.getAirlineDesignator() != this->getAirlineDesignator()) { return false; } + if (otherIcao.hasAircraftCombinedType() && otherIcao.getAircraftCombinedType() != this->getAircraftCombinedType()) { return false; } + if (otherIcao.hasLivery() && otherIcao.getLivery() != this->getLivery()) { return false; } + if (otherIcao.hasAircraftColor() && otherIcao.getAircraftColor() != this->getAircraftColor()) { return false; } return true; } diff --git a/src/blackmisc/avaircraftlist.h b/src/blackmisc/avaircraftlist.h index 3afa11522..5342ce663 100644 --- a/src/blackmisc/avaircraftlist.h +++ b/src/blackmisc/avaircraftlist.h @@ -25,9 +25,7 @@ namespace BlackMisc { namespace Aviation { - /*! - * Value object encapsulating a list of aircrafts. - */ + //! Value object encapsulating a list of aircrafts. class CAircraftList : public CSequence { public: diff --git a/src/blackmisc/avairport.cpp b/src/blackmisc/avairport.cpp index e98bed456..296d82d5b 100644 --- a/src/blackmisc/avairport.cpp +++ b/src/blackmisc/avairport.cpp @@ -103,10 +103,6 @@ namespace BlackMisc ICoordinateGeodetic::propertyByIndex(index) : CValueObject::propertyByIndex(index); } - - Q_ASSERT_X(false, "CAirport", "index unknown"); - QString m = QString("no property, index ").append(index.toQString()); - return CVariant::fromValue(m); } /* diff --git a/src/blackmisc/blackmiscfreefunctions.h b/src/blackmisc/blackmiscfreefunctions.h index 14406cecb..5b698662a 100644 --- a/src/blackmisc/blackmiscfreefunctions.h +++ b/src/blackmisc/blackmiscfreefunctions.h @@ -30,9 +30,7 @@ inline void initBlackMiscResources() Q_INIT_RESOURCE(blackmisc); } -/*! - * Free functions in BlackMisc - */ +//! Free functions in BlackMisc namespace BlackMisc { namespace PhysicalQuantities @@ -103,9 +101,7 @@ namespace BlackMisc //! Init resources void initResources(); - /*! - * Checked version from QVariant - */ + //! Checked version from QVariant template void setFromQVariant(T *value, const QVariant &variant) { Q_ASSERT(variant.canConvert()); @@ -135,10 +131,8 @@ namespace BlackMisc */ QVariant complexQtTypeFromDbusArgument(const QDBusArgument &argument, int type); - /*! - * \brief Display all user metatypes - * \remarks Used in order to debug code, do not remove - */ + //! brief Display all user metatypes + //! \remarks Used in order to debug code, do not remove void displayAllUserMetatypesTypes(); /*! diff --git a/src/blackmisc/propertyindex.cpp b/src/blackmisc/propertyindex.cpp index 8b89ebb6d..9268d3e13 100644 --- a/src/blackmisc/propertyindex.cpp +++ b/src/blackmisc/propertyindex.cpp @@ -13,11 +13,6 @@ namespace BlackMisc { - /* - * Constructor - */ - CPropertyIndex::CPropertyIndex() = default; - /* * Non nested index */ diff --git a/src/blackmisc/propertyindex.h b/src/blackmisc/propertyindex.h index dc11b1781..f019600bc 100644 --- a/src/blackmisc/propertyindex.h +++ b/src/blackmisc/propertyindex.h @@ -59,7 +59,7 @@ namespace BlackMisc }; //! Default constructor. - CPropertyIndex(); + CPropertyIndex() = default; //! Non nested index CPropertyIndex(int singleProperty); diff --git a/src/blacksim/blacksimfreefunctions.h b/src/blacksim/blacksimfreefunctions.h index 88f6c69b7..7eaab2ee0 100644 --- a/src/blacksim/blacksimfreefunctions.h +++ b/src/blacksim/blacksimfreefunctions.h @@ -1,21 +1,23 @@ -/* Copyright (C) 2013 VATSIM Community / contributors - * 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. + */ + +//! \file #ifndef BLACKSIM_FREEFUNCTIONS_H #define BLACKSIM_FREEFUNCTIONS_H -/*! - * Free functions in BlackSim - */ +//! Free functions in BlackSim namespace BlackSim { - /*! - * \brief Register all relevant metadata in BlackMisc - */ + //! Register all relevant metadata in BlackMisc void registerMetadata(); -} // BlackSim +} // namespace #endif // guard diff --git a/src/blacksim/fscommon/bcdconversions.cpp b/src/blacksim/fscommon/bcdconversions.cpp index 79ca2bd89..adfbe1aae 100644 --- a/src/blacksim/fscommon/bcdconversions.cpp +++ b/src/blacksim/fscommon/bcdconversions.cpp @@ -1,3 +1,12 @@ +/* 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 "bcdconversions.h" using namespace BlackMisc::PhysicalQuantities; diff --git a/src/blacksim/fscommon/bcdconversions.h b/src/blacksim/fscommon/bcdconversions.h index 098f20f35..d15cde8b2 100644 --- a/src/blacksim/fscommon/bcdconversions.h +++ b/src/blacksim/fscommon/bcdconversions.h @@ -1,3 +1,14 @@ +/* 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. + */ + +//! \file + #ifndef BLACKSIM_FSCOMMON_BCDCONVERSIONS_H #define BLACKSIM_FSCOMMON_BCDCONVERSIONS_H @@ -10,9 +21,7 @@ namespace BlackSim namespace FsCommon { - /*! - * \brief BCD conversions for FS - */ + //! BCD conversions for FS class CBcdConversions { public: diff --git a/src/blacksim/fsx/fsxsimulatorsetup.cpp b/src/blacksim/fsx/fsxsimulatorsetup.cpp index 298857d5d..c256bbcc8 100644 --- a/src/blacksim/fsx/fsxsimulatorsetup.cpp +++ b/src/blacksim/fsx/fsxsimulatorsetup.cpp @@ -1,3 +1,12 @@ +/* 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 "fsxsimulatorsetup.h" #include "../../blackmisc/project.h" diff --git a/src/blacksim/fsx/simconnectutilities.cpp b/src/blacksim/fsx/simconnectutilities.cpp index 44a82228b..f38c048a2 100644 --- a/src/blacksim/fsx/simconnectutilities.cpp +++ b/src/blacksim/fsx/simconnectutilities.cpp @@ -1,3 +1,12 @@ +/* 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 "simconnectutilities.h" #include #include diff --git a/src/blacksim/simulatorinfo.cpp b/src/blacksim/simulatorinfo.cpp index 32c3b0540..9a4fa1179 100644 --- a/src/blacksim/simulatorinfo.cpp +++ b/src/blacksim/simulatorinfo.cpp @@ -7,8 +7,6 @@ * contained in the LICENSE file. */ -//! \file - #include "simulatorinfo.h" #include "blackmisc/blackmiscfreefunctions.h" diff --git a/src/blacksim/simulatorinfo.h b/src/blacksim/simulatorinfo.h index 3c0d5314f..ba91608fb 100644 --- a/src/blacksim/simulatorinfo.h +++ b/src/blacksim/simulatorinfo.h @@ -7,6 +7,8 @@ * contained in the LICENSE file. */ +//! \file + #ifndef BLACKSIM_SIMULATORINFO_H #define BLACKSIM_SIMULATORINFO_H diff --git a/src/blacksim/simulatorinfolist.cpp b/src/blacksim/simulatorinfolist.cpp index 1bb04d4be..37fd0e4d8 100644 --- a/src/blacksim/simulatorinfolist.cpp +++ b/src/blacksim/simulatorinfolist.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 "simulatorinfolist.h" diff --git a/src/blacksim/simulatorinfolist.h b/src/blacksim/simulatorinfolist.h index 0894ce1de..d3b71f2c6 100644 --- a/src/blacksim/simulatorinfolist.h +++ b/src/blacksim/simulatorinfolist.h @@ -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. + */ //! \file diff --git a/src/blacksim/simulatormodelmappings.cpp b/src/blacksim/simulatormodelmappings.cpp index 356f2f4d0..bdd8ded62 100644 --- a/src/blacksim/simulatormodelmappings.cpp +++ b/src/blacksim/simulatormodelmappings.cpp @@ -1,3 +1,12 @@ +/* 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 "simulatormodelmappings.h" namespace BlackSim diff --git a/src/blacksim/simulatormodelmappings.h b/src/blacksim/simulatormodelmappings.h index f20b887fd..19ba41444 100644 --- a/src/blacksim/simulatormodelmappings.h +++ b/src/blacksim/simulatormodelmappings.h @@ -17,9 +17,7 @@ namespace BlackSim { - /*! - * \brief Model mappings - */ + //! Model mappings class ISimulatorModelMappings : public QObject { Q_OBJECT diff --git a/src/blacksim/simulatorsetup.cpp b/src/blacksim/simulatorsetup.cpp index 3b6bd9abf..2056d26b0 100644 --- a/src/blacksim/simulatorsetup.cpp +++ b/src/blacksim/simulatorsetup.cpp @@ -1,3 +1,12 @@ +/* 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 "simulatorsetup.h" namespace BlackSim diff --git a/src/plugins/simulator/fs9/host_node.h b/src/plugins/simulator/fs9/host_node.h index 202cf10db..e6e76a365 100644 --- a/src/plugins/simulator/fs9/host_node.h +++ b/src/plugins/simulator/fs9/host_node.h @@ -6,6 +6,7 @@ * including this file, may be copied, modified, propagated, or distributed except according to the terms * contained in the LICENSE file. */ + #ifndef BLACKSIMPLUGIN_FS9_HOST_NODE_H #define BLACKSIMPLUGIN_FS9_HOST_NODE_H diff --git a/src/plugins/simulator/fs9/simulator_fs9.h b/src/plugins/simulator/fs9/simulator_fs9.h index 5e46d2ad0..857729b62 100644 --- a/src/plugins/simulator/fs9/simulator_fs9.h +++ b/src/plugins/simulator/fs9/simulator_fs9.h @@ -46,14 +46,16 @@ namespace BlackSimPlugin virtual BlackSim::CSimulatorInfo getSimulatorInfo() const override; }; - //! \brief FSX Simulator Implementation + //! FSX Simulator Implementation class CSimulatorFs9 : public BlackCore::ISimulator { Q_OBJECT + public: - //! \brief Constructor + //! Constructor CSimulatorFs9(QObject *parent = nullptr); + //! Destructor virtual ~CSimulatorFs9(); //! \copydoc ISimulator::isConnected() diff --git a/src/swiftgui_standard/swiftguistd_init.cpp b/src/swiftgui_standard/swiftguistd_init.cpp index 9bb1e8054..2e05cea57 100644 --- a/src/swiftgui_standard/swiftguistd_init.cpp +++ b/src/swiftgui_standard/swiftguistd_init.cpp @@ -167,7 +167,7 @@ void SwiftGuiStd::initGuiSignals() // sliders connect(this->ui->comp_MainInfoArea->getSettingsComponent(), &CSettingsComponent::changedUsersUpdateInterval, this->ui->comp_MainInfoArea->getUserComponent(), &CUserComponent::setUpdateIntervalSeconds); - connect(this->ui->comp_MainInfoArea->getSettingsComponent(), &CSettingsComponent::changedAircraftsUpdateInterval, this->ui->comp_MainInfoArea->getAircraftComponent(), &CAircraftComponent::setUpdateIntervalSeconds); + connect(this->ui->comp_MainInfoArea->getSettingsComponent(), &CSettingsComponent::changedAircraftUpdateInterval, this->ui->comp_MainInfoArea->getAircraftComponent(), &CAircraftComponent::setUpdateIntervalSeconds); connect(this->ui->comp_MainInfoArea->getSettingsComponent(), &CSettingsComponent::changedAtcStationsUpdateInterval, this->ui->comp_MainInfoArea->getAtcStationComponent(), &::CAtcStationComponent::setUpdateIntervalSeconds); // login