refactor: Fix readability-redundant-member-init warning

This commit is contained in:
Lars Toenning
2025-10-25 17:08:05 +02:00
parent 3758b2b5b9
commit fc54023644
55 changed files with 31 additions and 85 deletions

View File

@@ -44,6 +44,7 @@ Checks: >
modernize-use-using, modernize-use-using,
readability-use-std-min-max, readability-use-std-min-max,
readability-use-anyofallof, readability-use-anyofallof,
readability-redundant-member-init,
CheckOptions: CheckOptions:
- key: readability-identifier-naming.ClassCase - key: readability-identifier-naming.ClassCase

View File

@@ -8,8 +8,6 @@
namespace swift::core::fsd namespace swift::core::fsd
{ {
AddAtc::AddAtc() : MessageBase() {}
AddAtc::AddAtc(const QString &callsign, const QString &realName, const QString &cid, const QString &password, AddAtc::AddAtc(const QString &callsign, const QString &realName, const QString &cid, const QString &password,
AtcRating rating, int protocolRevision) AtcRating rating, int protocolRevision)
: MessageBase(callsign, "SERVER"), m_cid(cid), m_password(password), m_rating(rating), : MessageBase(callsign, "SERVER"), m_cid(cid), m_password(password), m_rating(rating),

View File

@@ -47,7 +47,7 @@ namespace swift::core::fsd
QString realName() const { return m_realName; } QString realName() const { return m_realName; }
private: private:
AddAtc(); AddAtc() = default;
QString m_cid; QString m_cid;
QString m_password; QString m_password;

View File

@@ -50,7 +50,7 @@ namespace swift::core::fsd
static QString pdu() { return "#AP"; } static QString pdu() { return "#AP"; }
private: private:
AddPilot() : MessageBase() {} AddPilot() = default;
QString m_cid; QString m_cid;
QString m_password; QString m_password;

View File

@@ -11,8 +11,6 @@ using namespace swift::misc::network;
namespace swift::core::fsd namespace swift::core::fsd
{ {
AtcDataUpdate::AtcDataUpdate() : MessageBase() {}
AtcDataUpdate::AtcDataUpdate(const QString &sender, int frequencykHz, CFacilityType facility, int visibleRange, AtcDataUpdate::AtcDataUpdate(const QString &sender, int frequencykHz, CFacilityType facility, int visibleRange,
AtcRating rating, double latitude, double longitude, int elevation) AtcRating rating, double latitude, double longitude, int elevation)
: MessageBase(sender, {}), m_frequencykHz(frequencykHz), m_facility(facility), m_visibleRange(visibleRange), : MessageBase(sender, {}), m_frequencykHz(frequencykHz), m_facility(facility), m_visibleRange(visibleRange),

View File

@@ -46,7 +46,7 @@ namespace swift::core::fsd
private: private:
//! Ctor //! Ctor
AtcDataUpdate(); AtcDataUpdate() = default;
}; };
//! Equal to operator //! Equal to operator

View File

@@ -7,8 +7,6 @@
namespace swift::core::fsd namespace swift::core::fsd
{ {
AuthChallenge::AuthChallenge() : MessageBase() {}
AuthChallenge::AuthChallenge(const QString &sender, const QString &target, const QString &challengeKey) AuthChallenge::AuthChallenge(const QString &sender, const QString &target, const QString &challengeKey)
: MessageBase(sender, target), m_challengeKey(challengeKey) : MessageBase(sender, target), m_challengeKey(challengeKey)
{} {}

View File

@@ -30,7 +30,7 @@ namespace swift::core::fsd
private: private:
//! Ctor //! Ctor
AuthChallenge(); AuthChallenge() = default;
}; };
//! Equal to operator //! Equal to operator

View File

@@ -7,8 +7,6 @@
namespace swift::core::fsd namespace swift::core::fsd
{ {
AuthResponse::AuthResponse() : MessageBase() {}
AuthResponse::AuthResponse(const QString &sender, const QString &receiver, const QString &response) AuthResponse::AuthResponse(const QString &sender, const QString &receiver, const QString &response)
: MessageBase(sender, receiver), m_response(response) : MessageBase(sender, receiver), m_response(response)
{} {}

View File

@@ -30,7 +30,7 @@ namespace swift::core::fsd
QString m_response; //!< response QString m_response; //!< response
private: private:
AuthResponse(); AuthResponse() = default;
}; };
//! Equal to operator //! Equal to operator

View File

@@ -7,8 +7,6 @@
namespace swift::core::fsd namespace swift::core::fsd
{ {
ClientIdentification::ClientIdentification() : MessageBase() {}
ClientIdentification::ClientIdentification(const QString &sender, quint16 clientId, const QString &clientName, ClientIdentification::ClientIdentification(const QString &sender, quint16 clientId, const QString &clientName,
int clientVersionMajor, int clientVersionMinor, const QString &userCid, int clientVersionMajor, int clientVersionMinor, const QString &userCid,
const QString &sysUid, const QString &initialChallenge) const QString &sysUid, const QString &initialChallenge)

View File

@@ -43,7 +43,7 @@ namespace swift::core::fsd
//! @} //! @}
private: private:
ClientIdentification(); ClientIdentification() = default;
}; };
//! Equal to operator //! Equal to operator

View File

@@ -8,8 +8,6 @@
namespace swift::core::fsd namespace swift::core::fsd
{ {
ClientQuery::ClientQuery() : MessageBase() {}
ClientQuery::ClientQuery(const QString &sender, const QString &clientToBeQueried, ClientQueryType queryType, ClientQuery::ClientQuery(const QString &sender, const QString &clientToBeQueried, ClientQueryType queryType,
const QStringList &queryData) const QStringList &queryData)
: MessageBase(sender, clientToBeQueried), m_queryType(queryType), m_queryData(queryData) : MessageBase(sender, clientToBeQueried), m_queryType(queryType), m_queryData(queryData)

View File

@@ -40,7 +40,7 @@ namespace swift::core::fsd
//! @} //! @}
private: private:
ClientQuery(); ClientQuery() = default;
}; };
//! Equal to operator //! Equal to operator

View File

@@ -7,8 +7,6 @@
namespace swift::core::fsd namespace swift::core::fsd
{ {
DeleteAtc::DeleteAtc() : MessageBase() {}
DeleteAtc::DeleteAtc(const QString &sender, const QString &cid) : MessageBase(sender), m_cid(cid) {} DeleteAtc::DeleteAtc(const QString &sender, const QString &cid) : MessageBase(sender), m_cid(cid) {}
QStringList DeleteAtc::toTokens() const QStringList DeleteAtc::toTokens() const

View File

@@ -29,7 +29,7 @@ namespace swift::core::fsd
QString m_cid; //!< id QString m_cid; //!< id
private: private:
DeleteAtc(); DeleteAtc() = default;
}; };
//! Equal to operator //! Equal to operator

View File

@@ -9,8 +9,6 @@ using namespace swift::misc;
namespace swift::core::fsd namespace swift::core::fsd
{ {
DeletePilot::DeletePilot() : MessageBase() {}
DeletePilot::DeletePilot(const QString &callsign, const QString &id) : MessageBase(callsign), m_cid(id) {} DeletePilot::DeletePilot(const QString &callsign, const QString &id) : MessageBase(callsign), m_cid(id) {}
QStringList DeletePilot::toTokens() const QStringList DeletePilot::toTokens() const

View File

@@ -31,7 +31,7 @@ namespace swift::core::fsd
private: private:
//! Ctor //! Ctor
DeletePilot(); DeletePilot() = default;
}; };
//! Equal to operator //! Equal to operator

View File

@@ -7,8 +7,6 @@
namespace swift::core::fsd namespace swift::core::fsd
{ {
FSDIdentification::FSDIdentification() : MessageBase() {}
FSDIdentification::FSDIdentification(const QString &callsign, const QString &receiver, const QString &serverVersion, FSDIdentification::FSDIdentification(const QString &callsign, const QString &receiver, const QString &serverVersion,
const QString &initialChallenge) const QString &initialChallenge)
: MessageBase(callsign, receiver), m_serverVersion(serverVersion), m_initialChallenge(initialChallenge) : MessageBase(callsign, receiver), m_serverVersion(serverVersion), m_initialChallenge(initialChallenge)

View File

@@ -34,7 +34,7 @@ namespace swift::core::fsd
//! @} //! @}
private: private:
FSDIdentification(); FSDIdentification() = default;
}; };
} // namespace swift::core::fsd } // namespace swift::core::fsd

View File

@@ -8,8 +8,6 @@
namespace swift::core::fsd namespace swift::core::fsd
{ {
InterimPilotDataUpdate::InterimPilotDataUpdate() : MessageBase() {}
InterimPilotDataUpdate::InterimPilotDataUpdate(const QString &sender, const QString &receiver, double latitude, InterimPilotDataUpdate::InterimPilotDataUpdate(const QString &sender, const QString &receiver, double latitude,
double longitude, int altitudeTrue, int groundSpeed, double pitch, double longitude, int altitudeTrue, int groundSpeed, double pitch,
double bank, double heading, bool onGround) double bank, double heading, bool onGround)

View File

@@ -42,7 +42,7 @@ namespace swift::core::fsd
//! @} //! @}
private: private:
InterimPilotDataUpdate(); InterimPilotDataUpdate() = default;
}; };
//! Equal to operator //! Equal to operator

View File

@@ -7,8 +7,6 @@
namespace swift::core::fsd namespace swift::core::fsd
{ {
KillRequest::KillRequest() : MessageBase() {}
KillRequest::KillRequest(const QString &callsign, const QString &receiver, const QString &reason) KillRequest::KillRequest(const QString &callsign, const QString &receiver, const QString &reason)
: MessageBase(callsign, receiver), m_reason(reason) : MessageBase(callsign, receiver), m_reason(reason)
{} {}

View File

@@ -30,7 +30,7 @@ namespace swift::core::fsd
QString m_reason; //!< reason for kill request/kicked QString m_reason; //!< reason for kill request/kicked
private: private:
KillRequest(); KillRequest() = default;
}; };
//! Equal to operator //! Equal to operator

View File

@@ -12,8 +12,6 @@ using namespace swift::misc::aviation;
namespace swift::core::fsd namespace swift::core::fsd
{ {
PilotDataUpdate::PilotDataUpdate() : MessageBase() {}
PilotDataUpdate::PilotDataUpdate(CTransponder::TransponderMode transponderMode, const QString &sender, PilotDataUpdate::PilotDataUpdate(CTransponder::TransponderMode transponderMode, const QString &sender,
int transponderCode, PilotRating rating, double latitude, double longitude, int transponderCode, PilotRating rating, double latitude, double longitude,
int altitudeTrue, int altitudePressure, int groundSpeed, double pitch, double bank, int altitudeTrue, int altitudePressure, int groundSpeed, double pitch, double bank,

View File

@@ -49,7 +49,7 @@ namespace swift::core::fsd
//! @} //! @}
private: private:
PilotDataUpdate(); PilotDataUpdate() = default;
}; };
//! Equal to operator //! Equal to operator

View File

@@ -7,8 +7,6 @@
namespace swift::core::fsd namespace swift::core::fsd
{ {
Ping::Ping() : MessageBase() {}
Ping::Ping(const QString &sender, const QString &receiver, const QString &timestamp) Ping::Ping(const QString &sender, const QString &receiver, const QString &timestamp)
: MessageBase(sender, receiver), m_timestamp(timestamp) : MessageBase(sender, receiver), m_timestamp(timestamp)
{} {}

View File

@@ -29,7 +29,7 @@ namespace swift::core::fsd
QString m_timestamp; //!< timestamp QString m_timestamp; //!< timestamp
private: private:
Ping(); Ping() = default;
}; };
//! Equal to operator //! Equal to operator

View File

@@ -7,8 +7,6 @@
namespace swift::core::fsd namespace swift::core::fsd
{ {
PlaneInfoRequest::PlaneInfoRequest() : MessageBase() {}
PlaneInfoRequest::PlaneInfoRequest(const QString &sender, const QString &receiver) : MessageBase(sender, receiver) PlaneInfoRequest::PlaneInfoRequest(const QString &sender, const QString &receiver) : MessageBase(sender, receiver)
{} {}

View File

@@ -28,7 +28,7 @@ namespace swift::core::fsd
static QString pdu() { return QStringLiteral("#SB"); } static QString pdu() { return QStringLiteral("#SB"); }
private: private:
PlaneInfoRequest(); PlaneInfoRequest() = default;
}; };
//! Equal to operator //! Equal to operator

View File

@@ -7,8 +7,6 @@
namespace swift::core::fsd namespace swift::core::fsd
{ {
PlaneInfoRequestFsinn::PlaneInfoRequestFsinn() : MessageBase() {}
PlaneInfoRequestFsinn::PlaneInfoRequestFsinn(const QString &sender, const QString &receiver, PlaneInfoRequestFsinn::PlaneInfoRequestFsinn(const QString &sender, const QString &receiver,
const QString &airlineIcao, const QString &aircraftIcao, const QString &airlineIcao, const QString &aircraftIcao,
const QString &aircraftIcaoCombinedType, const QString &aircraftIcaoCombinedType,

View File

@@ -37,7 +37,7 @@ namespace swift::core::fsd
//! @} //! @}
private: private:
PlaneInfoRequestFsinn(); PlaneInfoRequestFsinn() = default;
}; };
//! Equal to operator //! Equal to operator

View File

@@ -7,8 +7,6 @@
namespace swift::core::fsd namespace swift::core::fsd
{ {
PlaneInformation::PlaneInformation() : MessageBase() {}
PlaneInformation::PlaneInformation(const QString &sender, const QString &receiver, const QString &aircraft, PlaneInformation::PlaneInformation(const QString &sender, const QString &receiver, const QString &aircraft,
const QString &airline = QString(), const QString &livery = QString()) const QString &airline = QString(), const QString &livery = QString())
: MessageBase(sender, receiver), m_aircraft(aircraft), m_airline(airline), m_livery(livery) : MessageBase(sender, receiver), m_aircraft(aircraft), m_airline(airline), m_livery(livery)

View File

@@ -36,7 +36,7 @@ namespace swift::core::fsd
//! @} //! @}
private: private:
PlaneInformation(); PlaneInformation() = default;
}; };
//! Equal to operator //! Equal to operator

View File

@@ -7,8 +7,6 @@
namespace swift::core::fsd namespace swift::core::fsd
{ {
PlaneInformationFsinn::PlaneInformationFsinn() : MessageBase() {}
PlaneInformationFsinn::PlaneInformationFsinn(const QString &sender, const QString &receiver, PlaneInformationFsinn::PlaneInformationFsinn(const QString &sender, const QString &receiver,
const QString &airlineIcao, const QString &aircraftIcao, const QString &airlineIcao, const QString &aircraftIcao,
const QString &aircraftIcaoCombinedType, const QString &aircraftIcaoCombinedType,

View File

@@ -37,7 +37,7 @@ namespace swift::core::fsd
//! @} //! @}
private: private:
PlaneInformationFsinn(); PlaneInformationFsinn() = default;
}; };
//! Equal to operator //! Equal to operator

View File

@@ -7,8 +7,6 @@
namespace swift::core::fsd namespace swift::core::fsd
{ {
Pong::Pong() : MessageBase() {}
Pong::Pong(const QString &sender, const QString &receiver, const QString &timestamp) Pong::Pong(const QString &sender, const QString &receiver, const QString &timestamp)
: MessageBase(sender, receiver), m_timestamp(timestamp) : MessageBase(sender, receiver), m_timestamp(timestamp)
{} {}

View File

@@ -29,7 +29,7 @@ namespace swift::core::fsd
QString m_timestamp; //!< timestamp QString m_timestamp; //!< timestamp
private: private:
Pong(); Pong() = default;
}; };
//! Equal to operator //! Equal to operator

View File

@@ -12,8 +12,6 @@ using namespace swift::misc::aviation;
namespace swift::core::fsd namespace swift::core::fsd
{ {
Rehost::Rehost() : MessageBase() {}
Rehost::Rehost(const QString &sender, const QString &hostname) : MessageBase(sender, {}), m_hostname(hostname) {} Rehost::Rehost(const QString &sender, const QString &hostname) : MessageBase(sender, {}), m_hostname(hostname) {}
QStringList Rehost::toTokens() const { return { m_sender, m_hostname }; } QStringList Rehost::toTokens() const { return { m_sender, m_hostname }; }

View File

@@ -33,7 +33,7 @@ namespace swift::core::fsd
//! @} //! @}
private: private:
Rehost(); Rehost() = default;
}; };
//! Equal to operator //! Equal to operator

View File

@@ -7,8 +7,6 @@
namespace swift::core::fsd namespace swift::core::fsd
{ {
TextMessage::TextMessage() : MessageBase() {}
TextMessage::TextMessage(const QString &sender, const QString &receiver, const QString &message) TextMessage::TextMessage(const QString &sender, const QString &receiver, const QString &message)
: MessageBase(sender, receiver), m_message(message) : MessageBase(sender, receiver), m_message(message)
{ {

View File

@@ -42,7 +42,7 @@ namespace swift::core::fsd
QVector<int> m_frequencies; //!< frequencies in case of radio message. QVector<int> m_frequencies; //!< frequencies in case of radio message.
private: private:
TextMessage(); TextMessage() = default;
}; };
} // namespace swift::core::fsd } // namespace swift::core::fsd

View File

@@ -14,8 +14,6 @@ using namespace swift::misc::aviation;
namespace swift::core::fsd namespace swift::core::fsd
{ {
VisualPilotDataPeriodic::VisualPilotDataPeriodic() : MessageBase() {}
VisualPilotDataPeriodic::VisualPilotDataPeriodic(const QString &sender, double latitude, double longitude, VisualPilotDataPeriodic::VisualPilotDataPeriodic(const QString &sender, double latitude, double longitude,
double altitudeTrue, double heightAgl, double pitch, double bank, double altitudeTrue, double heightAgl, double pitch, double bank,
double heading, double xVelocity, double yVelocity, double heading, double xVelocity, double yVelocity,

View File

@@ -54,7 +54,7 @@ namespace swift::core::fsd
//! @} //! @}
private: private:
VisualPilotDataPeriodic(); VisualPilotDataPeriodic() = default;
}; };
//! Equal to operator //! Equal to operator

View File

@@ -14,8 +14,6 @@ using namespace swift::misc::aviation;
namespace swift::core::fsd namespace swift::core::fsd
{ {
VisualPilotDataStopped::VisualPilotDataStopped() : MessageBase() {}
VisualPilotDataStopped::VisualPilotDataStopped(const QString &sender, double latitude, double longitude, VisualPilotDataStopped::VisualPilotDataStopped(const QString &sender, double latitude, double longitude,
double altitudeTrue, double heightAgl, double pitch, double bank, double altitudeTrue, double heightAgl, double pitch, double bank,
double heading, double noseGearAngle) double heading, double noseGearAngle)

View File

@@ -46,7 +46,7 @@ namespace swift::core::fsd
//! @} //! @}
private: private:
VisualPilotDataStopped(); VisualPilotDataStopped() = default;
}; };
//! Equal to operator //! Equal to operator

View File

@@ -13,8 +13,6 @@ using namespace swift::misc::aviation;
namespace swift::core::fsd namespace swift::core::fsd
{ {
VisualPilotDataToggle::VisualPilotDataToggle() : MessageBase() {}
VisualPilotDataToggle::VisualPilotDataToggle(const QString &sender, const QString &client, bool active) VisualPilotDataToggle::VisualPilotDataToggle(const QString &sender, const QString &client, bool active)
: MessageBase(sender, {}), m_client(client), m_active(active) : MessageBase(sender, {}), m_client(client), m_active(active)
{} {}

View File

@@ -34,7 +34,7 @@ namespace swift::core::fsd
//! @} //! @}
private: private:
VisualPilotDataToggle(); VisualPilotDataToggle() = default;
}; };
//! Equal to operator //! Equal to operator

View File

@@ -15,8 +15,6 @@ using namespace swift::misc::aviation;
namespace swift::core::fsd namespace swift::core::fsd
{ {
VisualPilotDataUpdate::VisualPilotDataUpdate() : MessageBase() {}
VisualPilotDataUpdate::VisualPilotDataUpdate(const QString &sender, double latitude, double longitude, VisualPilotDataUpdate::VisualPilotDataUpdate(const QString &sender, double latitude, double longitude,
double altitudeTrue, double heightAgl, double pitch, double bank, double altitudeTrue, double heightAgl, double pitch, double bank,
double heading, double xVelocity, double yVelocity, double zVelocity, double heading, double xVelocity, double yVelocity, double zVelocity,

View File

@@ -58,7 +58,7 @@ namespace swift::core::fsd
//! @} //! @}
// private: // not private: used in CFSDClient::handleVisualPilotDataUpdate // private: // not private: used in CFSDClient::handleVisualPilotDataUpdate
VisualPilotDataUpdate(); VisualPilotDataUpdate() = default;
}; };
//! Equal to operator //! Equal to operator

View File

@@ -1232,7 +1232,7 @@ namespace swift::core
} }
} }
ISimulatorListener::ISimulatorListener(const CSimulatorPluginInfo &info) : QObject(), m_info(info) ISimulatorListener::ISimulatorListener(const CSimulatorPluginInfo &info) : m_info(info)
{ {
this->setObjectName("ISimulatorListener:" + info.toQString()); this->setObjectName("ISimulatorListener:" + info.toQString());

View File

@@ -39,8 +39,7 @@ namespace swift::gui::components
return cats; return cats;
} }
CSimulatorComponent::CSimulatorComponent(QWidget *parent) CSimulatorComponent::CSimulatorComponent(QWidget *parent) : QTabWidget(parent), ui(new Ui::CSimulatorComponent)
: QTabWidget(parent), CEnableForDockWidgetInfoArea(), ui(new Ui::CSimulatorComponent)
{ {
Q_ASSERT_X(sGui, Q_FUNC_INFO, "Need sGui"); Q_ASSERT_X(sGui, Q_FUNC_INFO, "Need sGui");

View File

@@ -25,8 +25,7 @@ using namespace swift::core::context;
namespace swift::gui::components namespace swift::gui::components
{ {
CUserComponent::CUserComponent(QWidget *parent) CUserComponent::CUserComponent(QWidget *parent) : QTabWidget(parent), ui(new Ui::CUserComponent)
: QTabWidget(parent), CEnableForDockWidgetInfoArea(), ui(new Ui::CUserComponent)
{ {
ui->setupUi(this); ui->setupUi(this);
this->setCurrentIndex(0); this->setCurrentIndex(0);

View File

@@ -16,10 +16,7 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::misc::network, CUrlLog)
namespace swift::misc::network namespace swift::misc::network
{ {
CUrlLog::CUrlLog(const CUrl &url) : ITimestampBased(), m_id(uniqueId()), m_url(url) CUrlLog::CUrlLog(const CUrl &url) : m_id(uniqueId()), m_url(url) { ITimestampBased::setCurrentUtcTime(); }
{
ITimestampBased::setCurrentUtcTime();
}
void CUrlLog::setResponseTimestampToNow() void CUrlLog::setResponseTimestampToNow()
{ {

View File

@@ -24,9 +24,7 @@ namespace swift::misc::simulation
return cats; return cats;
} }
CRemoteAircraftProvider::CRemoteAircraftProvider(QObject *parent) CRemoteAircraftProvider::CRemoteAircraftProvider(QObject *parent) : QObject(parent), CIdentifiable(this) {}
: QObject(parent), IRemoteAircraftProvider(), CIdentifiable(this)
{}
CSimulatedAircraftList CRemoteAircraftProvider::getAircraftInRange() const CSimulatedAircraftList CRemoteAircraftProvider::getAircraftInRange() const
{ {