diff --git a/cppcheck.supp b/cppcheck.supp index 839dd7824..24a4a2547 100644 --- a/cppcheck.supp +++ b/cppcheck.supp @@ -16,6 +16,7 @@ variableScope:src/plugins/weatherdata/gfs/g2clib/*.c // std::initializer_list should always be passed by value passedByValue:src/blackmisc/input/actionhotkeylist.h +passedByValue:src/blackmisc/network/rawfsdmessagelist.cpp passedByValue:src/blackmisc/logcategorylist.h passedByValue:src/blackmisc/platformset.cpp diff --git a/src/blackmisc/network/rawfsdmessage.cpp b/src/blackmisc/network/rawfsdmessage.cpp index e4da6cfbb..8813bc027 100644 --- a/src/blackmisc/network/rawfsdmessage.cpp +++ b/src/blackmisc/network/rawfsdmessage.cpp @@ -52,16 +52,14 @@ namespace BlackMisc return allPacketTypes; } - CVariant CRawFsdMessage::propertyByIndex(const BlackMisc::CPropertyIndex &index) const + CVariant CRawFsdMessage::propertyByIndex(const CPropertyIndex &index) const { if (index.isMyself()) { return CVariant::from(*this); } - ColumnIndex i = index.frontCasted(); + const ColumnIndex i = index.frontCasted(); switch (i) { - case IndexReceptionTime: - return CVariant::fromValue(this->m_rawMessage); - case IndexRawMessage: - return CVariant::fromValue(this->m_receptionTime); + case IndexReceptionTime: return CVariant::fromValue(m_rawMessage); + case IndexRawMessage: return CVariant::fromValue(m_receptionTime); default: return CValueObject::propertyByIndex(index); } @@ -70,7 +68,7 @@ namespace BlackMisc void CRawFsdMessage::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant) { if (index.isMyself()) { (*this) = variant.to(); return; } - ColumnIndex i = index.frontCasted(); + const ColumnIndex i = index.frontCasted(); switch (i) { case IndexRawMessage: diff --git a/src/blackmisc/network/rawfsdmessage.h b/src/blackmisc/network/rawfsdmessage.h index 5e1f57176..4c05a41d5 100644 --- a/src/blackmisc/network/rawfsdmessage.h +++ b/src/blackmisc/network/rawfsdmessage.h @@ -12,12 +12,11 @@ #ifndef BLACKMISC_NETWORK_RAWFSDMESSAGE_H #define BLACKMISC_NETWORK_RAWFSDMESSAGE_H -#include "blackmisc/blackmiscexport.h" -#include "blackmisc/metaclass.h" -#include "blackmisc/statusmessagelist.h" -#include "blackmisc/propertyindex.h" #include "blackmisc/valueobject.h" #include "blackmisc/variant.h" +#include "blackmisc/metaclass.h" +#include "blackmisc/propertyindex.h" +#include "blackmisc/blackmiscexport.h" #include #include @@ -34,7 +33,7 @@ namespace BlackMisc //! Properties by index enum ColumnIndex { - IndexReceptionTime = BlackMisc::CPropertyIndex::GlobalIndexCRawFsdMessage, + IndexReceptionTime = CPropertyIndex::GlobalIndexCRawFsdMessage, IndexRawMessage }; @@ -63,10 +62,10 @@ namespace BlackMisc static const QStringList &getAllPacketTypes (); //! \copydoc BlackMisc::Mixin::Index::propertyByIndex - CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const; + CVariant propertyByIndex(const CPropertyIndex &index) const; //! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex - void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const CVariant &variant); + void setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant); //! \copydoc BlackMisc::Mixin::String::toQString() QString convertToQString(bool i18n = false) const; diff --git a/src/blackmisc/network/rawfsdmessagelist.cpp b/src/blackmisc/network/rawfsdmessagelist.cpp index a7f2911f7..2fc3ca094 100644 --- a/src/blackmisc/network/rawfsdmessagelist.cpp +++ b/src/blackmisc/network/rawfsdmessagelist.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2017 +/* Copyright (C) 2018 * 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 diff --git a/src/blackmisc/network/rawfsdmessagelist.h b/src/blackmisc/network/rawfsdmessagelist.h index 2983849b8..9433f2355 100644 --- a/src/blackmisc/network/rawfsdmessagelist.h +++ b/src/blackmisc/network/rawfsdmessagelist.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2017 +/* Copyright (C) 2018 * 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 @@ -13,12 +13,13 @@ #define BLACKMISC_NETWORK_RAWFSDMESSAGELIST_H #include "rawfsdmessage.h" -#include "blackmisc/blackmiscexport.h" #include "blackmisc/collection.h" #include "blackmisc/sequence.h" #include "blackmisc/variant.h" -#include +#include "blackmisc/blackmiscexport.h" + #include +#include namespace BlackMisc { @@ -27,7 +28,7 @@ namespace BlackMisc //! Value object encapsulating a list raw FSD messages. class BLACKMISC_EXPORT CRawFsdMessageList : public CSequence, - public BlackMisc::Mixin::MetaType + public Mixin::MetaType { public: BLACKMISC_DECLARE_USING_MIXIN_METATYPE(CRawFsdMessageList) @@ -51,7 +52,7 @@ namespace BlackMisc } // namespace Q_DECLARE_METATYPE(BlackMisc::Network::CRawFsdMessageList) -Q_DECLARE_METATYPE(BlackMisc::CCollection) -Q_DECLARE_METATYPE(BlackMisc::CSequence) +Q_DECLARE_METATYPE(BlackMisc::CCollection) +Q_DECLARE_METATYPE(BlackMisc::CSequence) #endif //guard