From 55534cbb0908ae9c442fbf0dfa8787e46bd11543 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Mon, 12 Mar 2018 18:04:34 +0100 Subject: [PATCH] Formatting --- src/blackcore/network.h | 42 +++++++------------ src/blackcore/weatherdata.h | 1 - .../settingsvatsimreaderscomponent.h | 2 +- src/blackgui/guiactionbind.cpp | 2 +- src/blackgui/models/countrylistmodel.h | 4 +- src/blackgui/views/countryview.cpp | 4 +- src/blackgui/views/countryview.h | 9 ++-- src/blackmisc/aviation/atcstationlist.h | 6 +-- src/blackmisc/aviation/callsignobjectlist.cpp | 2 +- src/blackmisc/connectionguard.cpp | 2 +- src/plugins/simulator/fs9/directplaypeer.cpp | 5 ++- src/plugins/simulator/fs9/directplaypeer.h | 2 +- 12 files changed, 33 insertions(+), 48 deletions(-) diff --git a/src/blackcore/network.h b/src/blackcore/network.h index 8bec27ed0..db908314d 100644 --- a/src/blackcore/network.h +++ b/src/blackcore/network.h @@ -66,9 +66,7 @@ namespace BlackCore Q_OBJECT protected: - /*! - * Constructor - */ + //! Constructor INetwork( BlackMisc::Network::IClientProvider *clientProvider, BlackMisc::Simulation::IOwnAircraftProvider *ownAircraftProvider, @@ -78,30 +76,22 @@ namespace BlackCore BlackMisc::Simulation::COwnAircraftAware(ownAircraftProvider) {} public: - /*! - * Destructor. - */ + //! Destructor virtual ~INetwork() {} - /*! - * Underlying library info. - */ + //! Underlying library info. virtual const QString &getLibraryInfo(bool detailed) const = 0; - /*! - * Flags for capabilities bitfield. - */ - enum - { - AcceptsAtisResponses = 1 << 0, - SupportsInterimPosUpdates = 1 << 1, - SupportsIcaoCodes = 1 << 2, - SupportsAircraftConfigs = 1 << 3 - }; + //! Flags for capabilities bitfield +// enum Capability +// { +// AcceptsAtisResponses = 1 << 0, +// SupportsInterimPosUpdates = 1 << 1, +// SupportsIcaoCodes = 1 << 2, +// SupportsAircraftConfigs = 1 << 3 +// }; - /*! - * Login modes - */ + //! Login modes enum LoginMode { LoginNormal = 0, //!< Normal login @@ -109,9 +99,7 @@ namespace BlackCore LoginStealth //!< Login stealth mode }; - /*! - * Status of the connection. - */ + //! Status of the connection. enum ConnectionStatus { Disconnected = 0, //!< Not connected @@ -124,9 +112,7 @@ namespace BlackCore }; Q_ENUM(ConnectionStatus) - /*! - * Convert a ConnectionStatus to a string. - */ + //! Convert a ConnectionStatus to a string. static QString connectionStatusToString(ConnectionStatus status) { const int index = staticMetaObject.indexOfEnumerator("ConnectionStatus"); diff --git a/src/blackcore/weatherdata.h b/src/blackcore/weatherdata.h index fb7f53d9f..978d9eaea 100644 --- a/src/blackcore/weatherdata.h +++ b/src/blackcore/weatherdata.h @@ -15,7 +15,6 @@ #include "blackcore/blackcoreexport.h" #include "blackmisc/pq/length.h" #include "blackmisc/weather/weathergrid.h" - #include namespace BlackCore diff --git a/src/blackgui/components/settingsvatsimreaderscomponent.h b/src/blackgui/components/settingsvatsimreaderscomponent.h index 2ea7706e9..a362d8edf 100644 --- a/src/blackgui/components/settingsvatsimreaderscomponent.h +++ b/src/blackgui/components/settingsvatsimreaderscomponent.h @@ -34,7 +34,7 @@ namespace BlackGui explicit CSettingsVatsimReadersComponent(QWidget *parent = nullptr); //! Destructor - ~CSettingsVatsimReadersComponent(); + virtual ~CSettingsVatsimReadersComponent(); private slots: void ps_settingsChanged(); diff --git a/src/blackgui/guiactionbind.cpp b/src/blackgui/guiactionbind.cpp index cb7a07e10..8d3ca535d 100644 --- a/src/blackgui/guiactionbind.cpp +++ b/src/blackgui/guiactionbind.cpp @@ -90,7 +90,7 @@ namespace BlackGui Q_ASSERT_X(CInputManager::instance(), Q_FUNC_INFO, "Missing input manager"); if (this->hasTarget()) { - CInputManager::instance()->unbind(this->m_index); + CInputManager::instance()->unbind(m_index); } this->reset(); } diff --git a/src/blackgui/models/countrylistmodel.h b/src/blackgui/models/countrylistmodel.h index 9091cbfa2..53e420eba 100644 --- a/src/blackgui/models/countrylistmodel.h +++ b/src/blackgui/models/countrylistmodel.h @@ -9,8 +9,8 @@ //! \file -#ifndef BLACKGUI_COUNTRYLISTMODEL_H -#define BLACKGUI_COUNTRYLISTMODEL_H +#ifndef BLACKGUI_MODELS_COUNTRYLISTMODEL_H +#define BLACKGUI_MODELS_COUNTRYLISTMODEL_H #include "blackgui/blackguiexport.h" #include "blackgui/models/listmodeldbobjects.h" diff --git a/src/blackgui/views/countryview.cpp b/src/blackgui/views/countryview.cpp index 7f2bab9f5..31dfec60f 100644 --- a/src/blackgui/views/countryview.cpp +++ b/src/blackgui/views/countryview.cpp @@ -21,5 +21,5 @@ namespace BlackGui this->standardInit(new CCountryListModel(this)); this->setMenu(MenuDefaultDbViews); } - } -} // namespace + } // ns +} // ns diff --git a/src/blackgui/views/countryview.h b/src/blackgui/views/countryview.h index 7121f4fb6..352390d33 100644 --- a/src/blackgui/views/countryview.h +++ b/src/blackgui/views/countryview.h @@ -9,8 +9,8 @@ //! \file -#ifndef BLACKGUI_COUNTRYVIEW_H -#define BLACKGUI_COUNTRYVIEW_H +#ifndef BLACKGUI_VIEWS_COUNTRYVIEW_H +#define BLACKGUI_VIEWS_COUNTRYVIEW_H #include "blackgui/blackguiexport.h" #include "blackgui/models/countrylistmodel.h" @@ -20,7 +20,6 @@ class QWidget; namespace BlackMisc { class CCountry; } - namespace BlackGui { namespace Views @@ -32,6 +31,6 @@ namespace BlackGui //! Constructor explicit CCountryView(QWidget *parent = nullptr); }; - } -} + } // ns +} // ns #endif // guard diff --git a/src/blackmisc/aviation/atcstationlist.h b/src/blackmisc/aviation/atcstationlist.h index cd051b730..75dbf9e27 100644 --- a/src/blackmisc/aviation/atcstationlist.h +++ b/src/blackmisc/aviation/atcstationlist.h @@ -32,9 +32,9 @@ namespace BlackMisc //! Value object for a list of ATC stations. class BLACKMISC_EXPORT CAtcStationList : public CSequence, - public BlackMisc::Aviation::ICallsignObjectList, - public BlackMisc::Geo::IGeoObjectWithRelativePositionList, - public BlackMisc::Mixin::MetaType + public Aviation::ICallsignObjectList, + public Geo::IGeoObjectWithRelativePositionList, + public Mixin::MetaType { public: BLACKMISC_DECLARE_USING_MIXIN_METATYPE(CAtcStationList) diff --git a/src/blackmisc/aviation/callsignobjectlist.cpp b/src/blackmisc/aviation/callsignobjectlist.cpp index 202e805df..249512daa 100644 --- a/src/blackmisc/aviation/callsignobjectlist.cpp +++ b/src/blackmisc/aviation/callsignobjectlist.cpp @@ -101,7 +101,7 @@ namespace BlackMisc { CONTAINER r; if (suffix.isEmpty()) { return r; } - QString sfxUpper(suffix.trimmed().toUpper()); + const QString sfxUpper(suffix.trimmed().toUpper()); r = this->container().findBy([ = ](const OBJ & csObj) { return (csObj.getCallsign().getSuffix() == sfxUpper); diff --git a/src/blackmisc/connectionguard.cpp b/src/blackmisc/connectionguard.cpp index bebe61a12..9a2924a83 100644 --- a/src/blackmisc/connectionguard.cpp +++ b/src/blackmisc/connectionguard.cpp @@ -29,7 +29,7 @@ namespace BlackMisc CConnectionGuard::~CConnectionGuard() { - disconnectAll(); + this->disconnectAll(); } int CConnectionGuard::disconnectAll() diff --git a/src/plugins/simulator/fs9/directplaypeer.cpp b/src/plugins/simulator/fs9/directplaypeer.cpp index c4a53f862..b99dff36c 100644 --- a/src/plugins/simulator/fs9/directplaypeer.cpp +++ b/src/plugins/simulator/fs9/directplaypeer.cpp @@ -20,6 +20,7 @@ #include using namespace BlackMisc; +using namespace BlackMisc::Aviation; namespace BlackSimPlugin { @@ -31,7 +32,7 @@ namespace BlackSimPlugin return cats; } - CDirectPlayPeer::CDirectPlayPeer(QObject *owner, const BlackMisc::Aviation::CCallsign &callsign) + CDirectPlayPeer::CDirectPlayPeer(QObject *owner, const CCallsign &callsign) : CContinuousWorker(owner, "peer_" + callsign.toQString()), m_callsign(callsign), m_mutexHostList(QMutex::Recursive), @@ -103,7 +104,7 @@ namespace BlackSimPlugin // Proceeed only, if the sender is our local player if (pReceiveMsg->dpnidSender == m_playerUser) { - QByteArray messageData = QByteArray((char *)pReceiveMsg->pReceiveData, pReceiveMsg->dwReceiveDataSize); + const QByteArray messageData = QByteArray((char *)pReceiveMsg->pReceiveData, pReceiveMsg->dwReceiveDataSize); emit customPacketReceived(messageData); } break; diff --git a/src/plugins/simulator/fs9/directplaypeer.h b/src/plugins/simulator/fs9/directplaypeer.h index d91a9ecf8..dfadc82e0 100644 --- a/src/plugins/simulator/fs9/directplaypeer.h +++ b/src/plugins/simulator/fs9/directplaypeer.h @@ -78,7 +78,7 @@ namespace BlackSimPlugin //! Creates a new DirectPlay device address HRESULT createHostAddress(); - BlackMisc::Aviation::CCallsign m_callsign; //!< Peer callsign + const BlackMisc::Aviation::CCallsign m_callsign; //!< Peer callsign IDirectPlay8Peer *m_directPlayPeer = nullptr; //!< DirectPlay peer address IDirectPlay8Address *m_deviceAddress = nullptr; //!< DirectPlay device address