mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
Ref T240, style/minor fixes
* Q_DECLARE_METATYPE was wrong * missing/unused include * suppress CPP check warning
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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<ColumnIndex>();
|
||||
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
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<CRawFsdMessage>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexRawMessage:
|
||||
|
||||
@@ -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 <QDateTime>
|
||||
#include <QMetaType>
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 <QStringList>
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
|
||||
#include <QMetaType>
|
||||
#include <initializer_list>
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
@@ -27,7 +28,7 @@ namespace BlackMisc
|
||||
//! Value object encapsulating a list raw FSD messages.
|
||||
class BLACKMISC_EXPORT CRawFsdMessageList :
|
||||
public CSequence<CRawFsdMessage>,
|
||||
public BlackMisc::Mixin::MetaType<CRawFsdMessageList>
|
||||
public Mixin::MetaType<CRawFsdMessageList>
|
||||
{
|
||||
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<BlackMisc::Network::CRawFsdMessageList>)
|
||||
Q_DECLARE_METATYPE(BlackMisc::CSequence<BlackMisc::Network::CRawFsdMessageList>)
|
||||
Q_DECLARE_METATYPE(BlackMisc::CCollection<BlackMisc::Network::CRawFsdMessage>)
|
||||
Q_DECLARE_METATYPE(BlackMisc::CSequence<BlackMisc::Network::CRawFsdMessage>)
|
||||
|
||||
#endif //guard
|
||||
|
||||
Reference in New Issue
Block a user