From fefedd03f90f32822cb6b8edba0082728b41620d Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Sat, 11 Oct 2025 23:45:20 +0200 Subject: [PATCH 01/21] refactor: Format inc files --- scripts/run_clang_format.py | 3 +- src/config/buildconfig.inc | 4 +- .../settings/xswiftbussettingsqtfree.inc | 200 ++++++++++++------ 3 files changed, 143 insertions(+), 64 deletions(-) diff --git a/scripts/run_clang_format.py b/scripts/run_clang_format.py index 7388bd756e..c78e984304 100755 --- a/scripts/run_clang_format.py +++ b/scripts/run_clang_format.py @@ -8,7 +8,8 @@ def should_file_formatted(file) -> bool: - return file.endswith(".cpp") or file.endswith(".h") + excluded_filenames = ["datarefs.inc"] + return file not in excluded_filenames and (file.endswith(".cpp") or file.endswith(".h") or file.endswith(".inc")) def get_formattable_files(folder_name): diff --git a/src/config/buildconfig.inc b/src/config/buildconfig.inc index 9ce49eda73..b9cc429d99 100644 --- a/src/config/buildconfig.inc +++ b/src/config/buildconfig.inc @@ -14,7 +14,9 @@ namespace swift::config { constexpr bool CBuildConfig::isCompiledWithMsFlightSimulatorSupport() { - return CBuildConfig::isCompiledWithFs9Support() || CBuildConfig::isCompiledWithFsxSupport() || CBuildConfig::isCompiledWithP3DSupport() || isCompiledWithMSFSSupport() || isCompiledWithMSFS2024Support(); + return CBuildConfig::isCompiledWithFs9Support() || CBuildConfig::isCompiledWithFsxSupport() || + CBuildConfig::isCompiledWithP3DSupport() || isCompiledWithMSFSSupport() || + isCompiledWithMSFS2024Support(); } constexpr bool CBuildConfig::isRunningOnWindowsNtPlatform() diff --git a/src/misc/simulation/settings/xswiftbussettingsqtfree.inc b/src/misc/simulation/settings/xswiftbussettingsqtfree.inc index a6bf95227c..a130e51441 100644 --- a/src/misc/simulation/settings/xswiftbussettingsqtfree.inc +++ b/src/misc/simulation/settings/xswiftbussettingsqtfree.inc @@ -1,16 +1,16 @@ // SPDX-FileCopyrightText: Copyright (C) 2019 swift Project Community / Contributors // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 -#include "xswiftbussettingsqtfree.h" - -#include #include +#include #include "nlohmann/json.hpp" +#include "xswiftbussettingsqtfree.h" + #ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" #endif using namespace swift::misc::simulation::settings; @@ -46,57 +46,85 @@ namespace swift::misc if (parsed.is_discarded()) { return false; } int c = 0; - if (parsed.contains(CXSwiftBusSettingsQtFree::JsonDBusServerAddress) && parsed[CXSwiftBusSettingsQtFree::JsonDBusServerAddress].is_string()) + if (parsed.contains(CXSwiftBusSettingsQtFree::JsonDBusServerAddress) && + parsed[CXSwiftBusSettingsQtFree::JsonDBusServerAddress].is_string()) { - m_dBusServerAddress = parsed[CXSwiftBusSettingsQtFree::JsonDBusServerAddress].get(); c++; + m_dBusServerAddress = parsed[CXSwiftBusSettingsQtFree::JsonDBusServerAddress].get(); + c++; } - if (parsed.contains(CXSwiftBusSettingsQtFree::JsonMessageBox) && parsed[CXSwiftBusSettingsQtFree::JsonMessageBox].is_string()) + if (parsed.contains(CXSwiftBusSettingsQtFree::JsonMessageBox) && + parsed[CXSwiftBusSettingsQtFree::JsonMessageBox].is_string()) { - m_msgBox = parsed[CXSwiftBusSettingsQtFree::JsonMessageBox].get(); c++; + m_msgBox = parsed[CXSwiftBusSettingsQtFree::JsonMessageBox].get(); + c++; } - if (parsed.contains(CXSwiftBusSettingsQtFree::JsonNightTextureMode) && parsed[CXSwiftBusSettingsQtFree::JsonNightTextureMode].is_string()) + if (parsed.contains(CXSwiftBusSettingsQtFree::JsonNightTextureMode) && + parsed[CXSwiftBusSettingsQtFree::JsonNightTextureMode].is_string()) { - m_nightTextureMode = parsed[CXSwiftBusSettingsQtFree::JsonNightTextureMode].get(); c++; + m_nightTextureMode = parsed[CXSwiftBusSettingsQtFree::JsonNightTextureMode].get(); + c++; } - if (parsed.contains(CXSwiftBusSettingsQtFree::JsonDrawingLabels) && parsed[CXSwiftBusSettingsQtFree::JsonDrawingLabels].is_boolean()) + if (parsed.contains(CXSwiftBusSettingsQtFree::JsonDrawingLabels) && + parsed[CXSwiftBusSettingsQtFree::JsonDrawingLabels].is_boolean()) { - m_drawingLabels = parsed[CXSwiftBusSettingsQtFree::JsonDrawingLabels].get(); c++; + m_drawingLabels = parsed[CXSwiftBusSettingsQtFree::JsonDrawingLabels].get(); + c++; } - if (parsed.contains(CXSwiftBusSettingsQtFree::JsonLabelColor) && parsed[CXSwiftBusSettingsQtFree::JsonLabelColor].is_number_integer()) + if (parsed.contains(CXSwiftBusSettingsQtFree::JsonLabelColor) && + parsed[CXSwiftBusSettingsQtFree::JsonLabelColor].is_number_integer()) { - m_labelColor = parsed[CXSwiftBusSettingsQtFree::JsonLabelColor].get(); c++; + m_labelColor = parsed[CXSwiftBusSettingsQtFree::JsonLabelColor].get(); + c++; } - if (parsed.contains(CXSwiftBusSettingsQtFree::JsonBundleTaxiLandingLights) && parsed[CXSwiftBusSettingsQtFree::JsonBundleTaxiLandingLights].is_boolean()) + if (parsed.contains(CXSwiftBusSettingsQtFree::JsonBundleTaxiLandingLights) && + parsed[CXSwiftBusSettingsQtFree::JsonBundleTaxiLandingLights].is_boolean()) { - m_bundleTaxiLandingLights = parsed[CXSwiftBusSettingsQtFree::JsonBundleTaxiLandingLights].get(); c++; + m_bundleTaxiLandingLights = + parsed[CXSwiftBusSettingsQtFree::JsonBundleTaxiLandingLights].get(); + c++; } - if (parsed.contains(CXSwiftBusSettingsQtFree::JsonTcas) && parsed[CXSwiftBusSettingsQtFree::JsonTcas].is_boolean()) + if (parsed.contains(CXSwiftBusSettingsQtFree::JsonTcas) && + parsed[CXSwiftBusSettingsQtFree::JsonTcas].is_boolean()) { - m_tcasEnabled = parsed[CXSwiftBusSettingsQtFree::JsonTcas].get(); c++; + m_tcasEnabled = parsed[CXSwiftBusSettingsQtFree::JsonTcas].get(); + c++; } - if (parsed.contains(CXSwiftBusSettingsQtFree::JsonTerrainProbe) && parsed[CXSwiftBusSettingsQtFree::JsonTerrainProbe].is_boolean()) + if (parsed.contains(CXSwiftBusSettingsQtFree::JsonTerrainProbe) && + parsed[CXSwiftBusSettingsQtFree::JsonTerrainProbe].is_boolean()) { - m_terrainProbeEnabled = parsed[CXSwiftBusSettingsQtFree::JsonTerrainProbe].get(); c++; + m_terrainProbeEnabled = parsed[CXSwiftBusSettingsQtFree::JsonTerrainProbe].get(); + c++; } - if (parsed.contains(CXSwiftBusSettingsQtFree::JsonLogRenderPhases) && parsed[CXSwiftBusSettingsQtFree::JsonLogRenderPhases].is_boolean()) + if (parsed.contains(CXSwiftBusSettingsQtFree::JsonLogRenderPhases) && + parsed[CXSwiftBusSettingsQtFree::JsonLogRenderPhases].is_boolean()) { - m_logRenderPhases = parsed[CXSwiftBusSettingsQtFree::JsonLogRenderPhases].get(); c++; + m_logRenderPhases = parsed[CXSwiftBusSettingsQtFree::JsonLogRenderPhases].get(); + c++; } - if (parsed.contains(CXSwiftBusSettingsQtFree::JsonMaxPlanes) && parsed[CXSwiftBusSettingsQtFree::JsonMaxPlanes].is_number_integer()) + if (parsed.contains(CXSwiftBusSettingsQtFree::JsonMaxPlanes) && + parsed[CXSwiftBusSettingsQtFree::JsonMaxPlanes].is_number_integer()) { - m_maxPlanes = parsed[CXSwiftBusSettingsQtFree::JsonMaxPlanes].get(); c++; + m_maxPlanes = parsed[CXSwiftBusSettingsQtFree::JsonMaxPlanes].get(); + c++; } - if (parsed.contains(CXSwiftBusSettingsQtFree::JsonMaxDrawDistance) && parsed[CXSwiftBusSettingsQtFree::JsonMaxDrawDistance].is_number_float()) + if (parsed.contains(CXSwiftBusSettingsQtFree::JsonMaxDrawDistance) && + parsed[CXSwiftBusSettingsQtFree::JsonMaxDrawDistance].is_number_float()) { - m_maxDrawDistanceNM = parsed[CXSwiftBusSettingsQtFree::JsonMaxDrawDistance].get(); c++; + m_maxDrawDistanceNM = parsed[CXSwiftBusSettingsQtFree::JsonMaxDrawDistance].get(); + c++; } - if (parsed.contains(CXSwiftBusSettingsQtFree::JsonFollowAircraftDistanceM) && parsed[CXSwiftBusSettingsQtFree::JsonFollowAircraftDistanceM].is_number_integer()) + if (parsed.contains(CXSwiftBusSettingsQtFree::JsonFollowAircraftDistanceM) && + parsed[CXSwiftBusSettingsQtFree::JsonFollowAircraftDistanceM].is_number_integer()) { - m_followAircraftDistanceM = parsed[CXSwiftBusSettingsQtFree::JsonFollowAircraftDistanceM].get(); c++; + m_followAircraftDistanceM = + parsed[CXSwiftBusSettingsQtFree::JsonFollowAircraftDistanceM].get(); + c++; } - if (parsed.contains(CXSwiftBusSettingsQtFree::JsonTimestamp) && parsed[CXSwiftBusSettingsQtFree::JsonTimestamp].is_number_integer()) + if (parsed.contains(CXSwiftBusSettingsQtFree::JsonTimestamp) && + parsed[CXSwiftBusSettingsQtFree::JsonTimestamp].is_number_integer()) { - m_msSinceEpochQtFree = parsed[CXSwiftBusSettingsQtFree::JsonTimestamp].get(); c++; + m_msSinceEpochQtFree = parsed[CXSwiftBusSettingsQtFree::JsonTimestamp].get(); + c++; } this->objectUpdated(); // post processing return c == 13; @@ -106,7 +134,6 @@ namespace swift::misc { nlohmann::json json; - json[JsonDBusServerAddress] = m_dBusServerAddress; json[JsonNightTextureMode] = m_nightTextureMode; json[JsonMessageBox] = m_msgBox; @@ -127,47 +154,96 @@ namespace swift::misc std::string CXSwiftBusSettingsQtFree::convertToString() const { return "DBusServer: " + m_dBusServerAddress + - ", drawLabels: " + qtfreeutils::boolToYesNo(m_drawingLabels) + - ", labelColor: " + std::to_string((m_labelColor >> 16) & 0xff) + - ";" + std::to_string((m_labelColor >> 8) & 0xff) + - ";" + std::to_string(m_labelColor & 0xff) + - ", bundle lights: " + qtfreeutils::boolToYesNo(m_bundleTaxiLandingLights) + - ", phases: " + qtfreeutils::boolToYesNo(m_logRenderPhases) + - ", TCAS: " + qtfreeutils::boolToYesNo(m_tcasEnabled) + - ", terr.probe: " + qtfreeutils::boolToYesNo(m_terrainProbeEnabled) + - ", night t.: " + m_nightTextureMode + - ", max planes: " + std::to_string(m_maxPlanes) + + ", drawLabels: " + qtfreeutils::boolToYesNo(m_drawingLabels) + + ", labelColor: " + std::to_string((m_labelColor >> 16) & 0xff) + ";" + + std::to_string((m_labelColor >> 8) & 0xff) + ";" + std::to_string(m_labelColor & 0xff) + + ", bundle lights: " + qtfreeutils::boolToYesNo(m_bundleTaxiLandingLights) + + ", phases: " + qtfreeutils::boolToYesNo(m_logRenderPhases) + + ", TCAS: " + qtfreeutils::boolToYesNo(m_tcasEnabled) + + ", terr.probe: " + qtfreeutils::boolToYesNo(m_terrainProbeEnabled) + + ", night t.: " + m_nightTextureMode + ", max planes: " + std::to_string(m_maxPlanes) + ", max distance NM: " + std::to_string(m_maxDrawDistanceNM) + - ", follow dist m: " + std::to_string(m_followAircraftDistanceM) + - ", msg.box: " + m_msgBox + - ", ts: " + std::to_string(m_msSinceEpochQtFree); + ", follow dist m: " + std::to_string(m_followAircraftDistanceM) + ", msg.box: " + m_msgBox + + ", ts: " + std::to_string(m_msSinceEpochQtFree); } int CXSwiftBusSettingsQtFree::update(const CXSwiftBusSettingsQtFree &newValues) { int changed = 0; - if (m_dBusServerAddress != newValues.m_dBusServerAddress) { m_dBusServerAddress = newValues.m_dBusServerAddress; changed++; } - if (m_msgBox != newValues.m_msgBox) { m_msgBox = newValues.m_msgBox; changed++; } - if (m_drawingLabels != newValues.m_drawingLabels) { m_drawingLabels = newValues.m_drawingLabels; changed++; } - if (m_labelColor != newValues.m_labelColor) { m_labelColor = newValues.m_labelColor; changed++; } - if (m_nightTextureMode != newValues.m_nightTextureMode) { m_nightTextureMode = newValues.m_nightTextureMode; changed++; } - if (m_logRenderPhases != newValues.m_logRenderPhases) { m_logRenderPhases = newValues.m_logRenderPhases; changed++; } - if (m_tcasEnabled != newValues.m_tcasEnabled) { m_tcasEnabled = newValues.m_tcasEnabled; changed++; } - if (m_terrainProbeEnabled != newValues.m_terrainProbeEnabled) { m_terrainProbeEnabled = newValues.m_terrainProbeEnabled; changed++; } - if (m_maxPlanes != newValues.m_maxPlanes) { m_maxPlanes = newValues.m_maxPlanes; changed++; } - if (m_msSinceEpochQtFree != newValues.m_msSinceEpochQtFree) { m_msSinceEpochQtFree = newValues.m_msSinceEpochQtFree; changed++; } - if (m_bundleTaxiLandingLights != newValues.m_bundleTaxiLandingLights) { m_bundleTaxiLandingLights = newValues.m_bundleTaxiLandingLights; changed++; } - if (m_followAircraftDistanceM != newValues.m_followAircraftDistanceM) { m_followAircraftDistanceM = newValues.m_followAircraftDistanceM; changed++; } - if (!qtfreeutils::isFuzzyEqual(m_maxDrawDistanceNM, newValues.m_maxDrawDistanceNM)) { m_maxDrawDistanceNM = newValues.m_maxDrawDistanceNM; changed++; } + if (m_dBusServerAddress != newValues.m_dBusServerAddress) + { + m_dBusServerAddress = newValues.m_dBusServerAddress; + changed++; + } + if (m_msgBox != newValues.m_msgBox) + { + m_msgBox = newValues.m_msgBox; + changed++; + } + if (m_drawingLabels != newValues.m_drawingLabels) + { + m_drawingLabels = newValues.m_drawingLabels; + changed++; + } + if (m_labelColor != newValues.m_labelColor) + { + m_labelColor = newValues.m_labelColor; + changed++; + } + if (m_nightTextureMode != newValues.m_nightTextureMode) + { + m_nightTextureMode = newValues.m_nightTextureMode; + changed++; + } + if (m_logRenderPhases != newValues.m_logRenderPhases) + { + m_logRenderPhases = newValues.m_logRenderPhases; + changed++; + } + if (m_tcasEnabled != newValues.m_tcasEnabled) + { + m_tcasEnabled = newValues.m_tcasEnabled; + changed++; + } + if (m_terrainProbeEnabled != newValues.m_terrainProbeEnabled) + { + m_terrainProbeEnabled = newValues.m_terrainProbeEnabled; + changed++; + } + if (m_maxPlanes != newValues.m_maxPlanes) + { + m_maxPlanes = newValues.m_maxPlanes; + changed++; + } + if (m_msSinceEpochQtFree != newValues.m_msSinceEpochQtFree) + { + m_msSinceEpochQtFree = newValues.m_msSinceEpochQtFree; + changed++; + } + if (m_bundleTaxiLandingLights != newValues.m_bundleTaxiLandingLights) + { + m_bundleTaxiLandingLights = newValues.m_bundleTaxiLandingLights; + changed++; + } + if (m_followAircraftDistanceM != newValues.m_followAircraftDistanceM) + { + m_followAircraftDistanceM = newValues.m_followAircraftDistanceM; + changed++; + } + if (!qtfreeutils::isFuzzyEqual(m_maxDrawDistanceNM, newValues.m_maxDrawDistanceNM)) + { + m_maxDrawDistanceNM = newValues.m_maxDrawDistanceNM; + changed++; + } if (changed > 0) { this->objectUpdated(); } // post processing return changed; } - } // ns - } // ns -} // ns + } // namespace settings + } // namespace simulation +} // namespace swift::misc #ifdef __GNUC__ -#pragma GCC diagnostic pop +# pragma GCC diagnostic pop #endif From 036a99f4dc96f532badbbfb99acd09b1ed17b794 Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Sat, 25 Oct 2025 14:30:22 +0200 Subject: [PATCH 02/21] build: Fix compilation with no PCH --- src/gui/components/aboutdialog.cpp | 1 + src/gui/components/flightplancomponent.h | 1 + src/gui/components/hotkeydialog.h | 1 + src/gui/components/networkdetailscomponent.cpp | 1 - src/gui/components/settingsnetworkserverscomponent.cpp | 1 - src/gui/editors/cockpitcomform.cpp | 1 - src/gui/editors/serverform.cpp | 1 - src/gui/enableforviewbasedindicator.h | 2 ++ src/gui/filters/aircraftmodelfilterdialog.cpp | 1 - src/gui/filters/airlineicaofilterbar.h | 5 +---- src/gui/filters/countryfilterbar.cpp | 1 - src/gui/filters/liveryfilterbar.h | 2 +- src/gui/models/aircraftmodellistmodel.cpp | 1 - src/gui/models/airlineicaolistmodel.h | 4 ++-- src/gui/models/atcstationlistmodel.cpp | 1 - src/gui/models/interpolationsetupmodel.cpp | 1 + src/gui/models/liverylistmodel.h | 2 +- src/gui/views/viewcallsignobjects.h | 1 + src/misc/stringutils.cpp | 1 + 19 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/gui/components/aboutdialog.cpp b/src/gui/components/aboutdialog.cpp index b8476bc5aa..cd37684051 100644 --- a/src/gui/components/aboutdialog.cpp +++ b/src/gui/components/aboutdialog.cpp @@ -8,6 +8,7 @@ #include "gui/guiapplication.h" #include "gui/guiutility.h" #include "misc/fileutils.h" +#include "misc/swiftdirectories.h" namespace swift::gui::components { diff --git a/src/gui/components/flightplancomponent.h b/src/gui/components/flightplancomponent.h index 1cb9abf45c..0d77aaa2b1 100644 --- a/src/gui/components/flightplancomponent.h +++ b/src/gui/components/flightplancomponent.h @@ -8,6 +8,7 @@ #include #include +#include #include #include #include diff --git a/src/gui/components/hotkeydialog.h b/src/gui/components/hotkeydialog.h index 756d218b8d..5f3b719d22 100644 --- a/src/gui/components/hotkeydialog.h +++ b/src/gui/components/hotkeydialog.h @@ -6,6 +6,7 @@ #ifndef SWIFT_GUI_COMPONENTS_HOTKEYDIALOG_H #define SWIFT_GUI_COMPONENTS_HOTKEYDIALOG_H +#include #include #include #include diff --git a/src/gui/components/networkdetailscomponent.cpp b/src/gui/components/networkdetailscomponent.cpp index 62d035a7d7..01f7a7359e 100644 --- a/src/gui/components/networkdetailscomponent.cpp +++ b/src/gui/components/networkdetailscomponent.cpp @@ -13,7 +13,6 @@ #include "gui/uppercasevalidator.h" using namespace swift::misc::network; -using namespace swift::misc::audio; using namespace swift::misc::aviation; using namespace swift::core; using namespace swift::core::data; diff --git a/src/gui/components/settingsnetworkserverscomponent.cpp b/src/gui/components/settingsnetworkserverscomponent.cpp index 02e72ba902..b3c19c1ccb 100644 --- a/src/gui/components/settingsnetworkserverscomponent.cpp +++ b/src/gui/components/settingsnetworkserverscomponent.cpp @@ -28,7 +28,6 @@ using namespace swift::gui; using namespace swift::misc; using namespace swift::misc::network; using namespace swift::misc::aviation; -using namespace swift::misc::audio; namespace swift::gui::components { diff --git a/src/gui/editors/cockpitcomform.cpp b/src/gui/editors/cockpitcomform.cpp index 92f8e58c89..b9e6896e12 100644 --- a/src/gui/editors/cockpitcomform.cpp +++ b/src/gui/editors/cockpitcomform.cpp @@ -15,7 +15,6 @@ using namespace swift::misc; using namespace swift::misc::aviation; -using namespace swift::misc::audio; using namespace swift::misc::physical_quantities; using namespace swift::misc::math; using namespace swift::misc::simulation; diff --git a/src/gui/editors/serverform.cpp b/src/gui/editors/serverform.cpp index d105708ede..7dc2b617ca 100644 --- a/src/gui/editors/serverform.cpp +++ b/src/gui/editors/serverform.cpp @@ -13,7 +13,6 @@ #include "misc/network/user.h" using namespace swift::misc; -using namespace swift::misc::audio; using namespace swift::misc::network; namespace swift::gui::editors diff --git a/src/gui/enableforviewbasedindicator.h b/src/gui/enableforviewbasedindicator.h index 5a0f480762..3f908b093e 100644 --- a/src/gui/enableforviewbasedindicator.h +++ b/src/gui/enableforviewbasedindicator.h @@ -6,6 +6,8 @@ #ifndef SWIFT_GUI_ENABLEFORVIEWBASEDINDICATOR_H #define SWIFT_GUI_ENABLEFORVIEWBASEDINDICATOR_H +#include + #include "gui/swiftguiexport.h" namespace swift::gui::views diff --git a/src/gui/filters/aircraftmodelfilterdialog.cpp b/src/gui/filters/aircraftmodelfilterdialog.cpp index 92469dd73c..f4f4096816 100644 --- a/src/gui/filters/aircraftmodelfilterdialog.cpp +++ b/src/gui/filters/aircraftmodelfilterdialog.cpp @@ -11,7 +11,6 @@ using namespace swift::gui::models; using namespace swift::gui::filters; using namespace swift::misc::simulation; -using namespace swift::misc::network; namespace swift::gui::filters { diff --git a/src/gui/filters/airlineicaofilterbar.h b/src/gui/filters/airlineicaofilterbar.h index a677cc0e44..48ecdf6e4d 100644 --- a/src/gui/filters/airlineicaofilterbar.h +++ b/src/gui/filters/airlineicaofilterbar.h @@ -15,6 +15,7 @@ #include "gui/models/modelfilter.h" #include "gui/swiftguiexport.h" #include "misc/aviation/airlineicaocode.h" +#include "misc/aviation/airlineicaocodelist.h" namespace Ui { @@ -23,10 +24,6 @@ namespace Ui namespace swift::misc { class CCountry; - namespace aviation - { - class CAirlineIcaoCodeList; - } } // namespace swift::misc namespace swift::gui::filters { diff --git a/src/gui/filters/countryfilterbar.cpp b/src/gui/filters/countryfilterbar.cpp index d97a679afd..b679e80afa 100644 --- a/src/gui/filters/countryfilterbar.cpp +++ b/src/gui/filters/countryfilterbar.cpp @@ -15,7 +15,6 @@ using namespace swift::gui; using namespace swift::gui::models; using namespace swift::misc; -using namespace swift::misc::network; namespace swift::gui::filters { diff --git a/src/gui/filters/liveryfilterbar.h b/src/gui/filters/liveryfilterbar.h index ca734b4f04..88cbbd1a15 100644 --- a/src/gui/filters/liveryfilterbar.h +++ b/src/gui/filters/liveryfilterbar.h @@ -14,6 +14,7 @@ #include "gui/filters/filterwidget.h" #include "gui/models/modelfilter.h" #include "gui/swiftguiexport.h" +#include "misc/aviation/liverylist.h" #include "misc/rgbcolor.h" namespace Ui @@ -23,7 +24,6 @@ namespace Ui namespace swift::misc::aviation { class CLivery; - class CLiveryList; } // namespace swift::misc::aviation namespace swift::gui::filters { diff --git a/src/gui/models/aircraftmodellistmodel.cpp b/src/gui/models/aircraftmodellistmodel.cpp index 9d6f69bab6..92cd78989f 100644 --- a/src/gui/models/aircraftmodellistmodel.cpp +++ b/src/gui/models/aircraftmodellistmodel.cpp @@ -20,7 +20,6 @@ using namespace swift::misc; using namespace swift::misc::simulation; using namespace swift::misc::aviation; -using namespace swift::misc::network; using namespace swift::misc::physical_quantities; namespace swift::gui::models diff --git a/src/gui/models/airlineicaolistmodel.h b/src/gui/models/airlineicaolistmodel.h index 671ddb5d1e..e01eef92ce 100644 --- a/src/gui/models/airlineicaolistmodel.h +++ b/src/gui/models/airlineicaolistmodel.h @@ -8,13 +8,13 @@ #include "gui/models/listmodeldbobjects.h" #include "gui/swiftguiexport.h" +#include "misc/aviation/airlineicaocodelist.h" class QObject; namespace swift::misc::aviation { class CAirlineIcaoCode; - class CAirlineIcaoCodeList; } // namespace swift::misc::aviation namespace swift::gui::models @@ -29,7 +29,7 @@ namespace swift::gui::models //! Constructor explicit CAirlineIcaoCodeListModel(QObject *parent = nullptr); - //! Destructor + //! DestructorCAirlineIcaoCodeList virtual ~CAirlineIcaoCodeListModel() {} }; } // namespace swift::gui::models diff --git a/src/gui/models/atcstationlistmodel.cpp b/src/gui/models/atcstationlistmodel.cpp index 5765eec94b..65261ed9ad 100644 --- a/src/gui/models/atcstationlistmodel.cpp +++ b/src/gui/models/atcstationlistmodel.cpp @@ -25,7 +25,6 @@ #include "misc/propertyindexvariantmap.h" using namespace swift::misc::physical_quantities; -using namespace swift::misc::audio; using namespace swift::misc::aviation; using namespace swift::misc::network; diff --git a/src/gui/models/interpolationsetupmodel.cpp b/src/gui/models/interpolationsetupmodel.cpp index bf6b229e06..9bc027ea33 100644 --- a/src/gui/models/interpolationsetupmodel.cpp +++ b/src/gui/models/interpolationsetupmodel.cpp @@ -7,6 +7,7 @@ #include #include "gui/models/columns.h" +#include "misc/country.h" using namespace swift::misc; using namespace swift::misc::physical_quantities; diff --git a/src/gui/models/liverylistmodel.h b/src/gui/models/liverylistmodel.h index 8b2b956566..566919d169 100644 --- a/src/gui/models/liverylistmodel.h +++ b/src/gui/models/liverylistmodel.h @@ -8,13 +8,13 @@ #include "gui/models/listmodeldbobjects.h" #include "gui/swiftguiexport.h" +#include "misc/aviation/liverylist.h" class QObject; namespace swift::misc::aviation { class CLivery; - class CLiveryList; } // namespace swift::misc::aviation namespace swift::gui::models diff --git a/src/gui/views/viewcallsignobjects.h b/src/gui/views/viewcallsignobjects.h index 68652dac55..533723ac2b 100644 --- a/src/gui/views/viewcallsignobjects.h +++ b/src/gui/views/viewcallsignobjects.h @@ -7,6 +7,7 @@ #define SWIFT_GUI_VIEWS_VIEWCALLSIGNOBJECTS_H #include "gui/views/viewbase.h" +#include "misc/aviation/callsignset.h" class QAction; class QIntValidator; diff --git a/src/misc/stringutils.cpp b/src/misc/stringutils.cpp index 5bed045381..13f7442ecd 100644 --- a/src/misc/stringutils.cpp +++ b/src/misc/stringutils.cpp @@ -10,6 +10,7 @@ #include #include #include +#include namespace swift::misc { From 06469007ff89bfc01957ff5e6b59733d1ca31b6d Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Sat, 4 Oct 2025 12:25:24 +0200 Subject: [PATCH 03/21] fix: Extend comment for new simulators --- src/config/buildconfig.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/buildconfig.h b/src/config/buildconfig.h index 95b99fc5fc..08551b0c31 100644 --- a/src/config/buildconfig.h +++ b/src/config/buildconfig.h @@ -36,7 +36,7 @@ namespace swift::config //! with FSUIPC support? static constexpr bool isCompiledWithFsuipcSupport(); // defined in buildconfig_gen.inc.in - //! Compiled with any MS Flight Simulator support (P3D, FSX, FS9) + //! Compiled with any MS Flight Simulator support (P3D, FSX, FS9, MSFS, MSFS24) static constexpr bool isCompiledWithMsFlightSimulatorSupport(); //! with XPlane support? From 8c93f001799cd83c30881727ddb9f2c7c37ac12d Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Sat, 11 Oct 2025 21:52:29 +0200 Subject: [PATCH 04/21] refactor: Fix deprecation warning --- src/misc/dictionary.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/misc/dictionary.h b/src/misc/dictionary.h index f22e6bbb96..6d70924810 100644 --- a/src/misc/dictionary.h +++ b/src/misc/dictionary.h @@ -499,9 +499,9 @@ namespace swift::misc "Maps must have the same key type"); if (map1.empty() || map2.empty()) { return; } auto it1 = implementationOf(map1).lowerBound(map2.cbegin().key()); - auto end1 = implementationOf(map1).upperBound((map2.cend() - 1).key()); + auto end1 = implementationOf(map1).upperBound(std::prev(map2.cend()).key()); auto it2 = implementationOf(map2).lowerBound(map1.cbegin().key()); - auto end2 = implementationOf(map2).upperBound((map1.cend() - 1).key()); + auto end2 = implementationOf(map2).upperBound(std::prev(map1.cend()).key()); while (it1 != end1 && it2 != end2) { if (it1.key() < it2.key()) { ++it1; } From e29818a5be4854b9ed77d9cb8f10dd398233b2c8 Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Fri, 10 Oct 2025 23:12:12 +0200 Subject: [PATCH 05/21] refactor: Move chunkware to third_party --- src/sound/CMakeLists.txt | 14 +-------- .../sampleprovider/simplecompressoreffect.h | 3 +- third_party/CMakeLists.txt | 1 + third_party/chunkware_dsp/CMakeLists.txt | 29 +++++++++++++++++++ .../chunkware_dsp}/SimpleComp.cpp | 0 .../chunkware_dsp}/SimpleComp.cpp.license | 0 .../chunkware_dsp}/SimpleComp.h | 6 ++-- .../chunkware_dsp}/SimpleComp.h.license | 0 .../chunkware_dsp}/SimpleCompProcess.inl | 0 .../SimpleCompProcess.inl.license | 0 .../chunkware_dsp}/SimpleEnvelope.cpp | 0 .../chunkware_dsp}/SimpleEnvelope.cpp.license | 0 .../chunkware_dsp}/SimpleEnvelope.h | 2 +- .../chunkware_dsp}/SimpleEnvelope.h.license | 0 .../chunkware_dsp}/SimpleGain.h | 0 .../chunkware_dsp}/SimpleGain.h.license | 0 .../chunkware_dsp}/SimpleGate.cpp | 0 .../chunkware_dsp}/SimpleGate.cpp.license | 0 .../chunkware_dsp}/SimpleGate.h | 6 ++-- .../chunkware_dsp}/SimpleGate.h.license | 0 .../chunkware_dsp}/SimpleGateProcess.inl | 0 .../SimpleGateProcess.inl.license | 0 .../chunkware_dsp}/SimpleHeader.h | 0 .../chunkware_dsp}/SimpleHeader.h.license | 0 .../chunkware_dsp}/SimpleLimit.cpp | 0 .../chunkware_dsp}/SimpleLimit.cpp.license | 0 .../chunkware_dsp}/SimpleLimit.h | 6 ++-- .../chunkware_dsp}/SimpleLimit.h.license | 0 .../chunkware_dsp}/SimpleLimitProcess.inl | 0 .../SimpleLimitProcess.inl.license | 0 30 files changed, 43 insertions(+), 24 deletions(-) create mode 100644 third_party/chunkware_dsp/CMakeLists.txt rename {src/sound/dsp => third_party/chunkware_dsp}/SimpleComp.cpp (100%) rename {src/sound/dsp => third_party/chunkware_dsp}/SimpleComp.cpp.license (100%) rename {src/sound/dsp => third_party/chunkware_dsp}/SimpleComp.h (95%) rename {src/sound/dsp => third_party/chunkware_dsp}/SimpleComp.h.license (100%) rename {src/sound/dsp => third_party/chunkware_dsp}/SimpleCompProcess.inl (100%) rename {src/sound/dsp => third_party/chunkware_dsp}/SimpleCompProcess.inl.license (100%) rename {src/sound/dsp => third_party/chunkware_dsp}/SimpleEnvelope.cpp (100%) rename {src/sound/dsp => third_party/chunkware_dsp}/SimpleEnvelope.cpp.license (100%) rename {src/sound/dsp => third_party/chunkware_dsp}/SimpleEnvelope.h (98%) rename {src/sound/dsp => third_party/chunkware_dsp}/SimpleEnvelope.h.license (100%) rename {src/sound/dsp => third_party/chunkware_dsp}/SimpleGain.h (100%) rename {src/sound/dsp => third_party/chunkware_dsp}/SimpleGain.h.license (100%) rename {src/sound/dsp => third_party/chunkware_dsp}/SimpleGate.cpp (100%) rename {src/sound/dsp => third_party/chunkware_dsp}/SimpleGate.cpp.license (100%) rename {src/sound/dsp => third_party/chunkware_dsp}/SimpleGate.h (95%) rename {src/sound/dsp => third_party/chunkware_dsp}/SimpleGate.h.license (100%) rename {src/sound/dsp => third_party/chunkware_dsp}/SimpleGateProcess.inl (100%) rename {src/sound/dsp => third_party/chunkware_dsp}/SimpleGateProcess.inl.license (100%) rename {src/sound/dsp => third_party/chunkware_dsp}/SimpleHeader.h (100%) rename {src/sound/dsp => third_party/chunkware_dsp}/SimpleHeader.h.license (100%) rename {src/sound/dsp => third_party/chunkware_dsp}/SimpleLimit.cpp (100%) rename {src/sound/dsp => third_party/chunkware_dsp}/SimpleLimit.cpp.license (100%) rename {src/sound/dsp => third_party/chunkware_dsp}/SimpleLimit.h (95%) rename {src/sound/dsp => third_party/chunkware_dsp}/SimpleLimit.h.license (100%) rename {src/sound/dsp => third_party/chunkware_dsp}/SimpleLimitProcess.inl (100%) rename {src/sound/dsp => third_party/chunkware_dsp}/SimpleLimitProcess.inl.license (100%) diff --git a/src/sound/CMakeLists.txt b/src/sound/CMakeLists.txt index 1da1a5dfc2..faef421937 100644 --- a/src/sound/CMakeLists.txt +++ b/src/sound/CMakeLists.txt @@ -8,19 +8,6 @@ add_library(sound SHARED codecs/opusdecoder.h codecs/opusencoder.cpp codecs/opusencoder.h - dsp/SimpleComp.cpp - dsp/SimpleComp.h - dsp/SimpleCompProcess.inl - dsp/SimpleEnvelope.cpp - dsp/SimpleEnvelope.h - dsp/SimpleGain.h - dsp/SimpleGate.cpp - dsp/SimpleGate.h - dsp/SimpleGateProcess.inl - dsp/SimpleHeader.h - dsp/SimpleLimit.cpp - dsp/SimpleLimit.h - dsp/SimpleLimitProcess.inl dsp/biquadfilter.cpp dsp/biquadfilter.h notificationplayer.cpp @@ -76,6 +63,7 @@ target_link_libraries(sound Qt::Multimedia misc Opus::opus + ChunkwareDsp ) install(TARGETS sound diff --git a/src/sound/sampleprovider/simplecompressoreffect.h b/src/sound/sampleprovider/simplecompressoreffect.h index 879a9e180f..f84dd55caa 100644 --- a/src/sound/sampleprovider/simplecompressoreffect.h +++ b/src/sound/sampleprovider/simplecompressoreffect.h @@ -9,7 +9,8 @@ #include #include -#include "sound/dsp/SimpleComp.h" +#include "chunkware_dsp/SimpleComp.h" + #include "sound/sampleprovider/sampleprovider.h" #include "sound/swiftsoundexport.h" diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index 1227319488..922a90fd40 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -1,6 +1,7 @@ # SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors # SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 +add_subdirectory(chunkware_dsp) add_subdirectory(simplecrypt) add_subdirectory(qjsonwebtoken) add_subdirectory(cmake/msgpack EXCLUDE_FROM_ALL SYSTEM) diff --git a/third_party/chunkware_dsp/CMakeLists.txt b/third_party/chunkware_dsp/CMakeLists.txt new file mode 100644 index 0000000000..df73961b26 --- /dev/null +++ b/third_party/chunkware_dsp/CMakeLists.txt @@ -0,0 +1,29 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(ChunkwareDsp STATIC) +target_sources(ChunkwareDsp + PRIVATE + SimpleComp.cpp + SimpleComp.h + SimpleCompProcess.inl + SimpleEnvelope.cpp + SimpleEnvelope.h + SimpleGain.h + SimpleGate.cpp + SimpleGate.h + SimpleGateProcess.inl + SimpleHeader.h + SimpleLimit.cpp + SimpleLimit.h + SimpleLimitProcess.inl +) +target_include_directories(ChunkwareDsp + PUBLIC + ${PROJECT_SOURCE_DIR}/third_party +) +set_property(TARGET ChunkwareDsp PROPERTY POSITION_INDEPENDENT_CODE ON) +set_source_files_properties(SimpleComp.cpp PROPERTIES SKIP_LINTING ON) +set_source_files_properties(SimpleEnvelope.cpp PROPERTIES SKIP_LINTING ON) +set_source_files_properties(SimpleGate.cpp PROPERTIES SKIP_LINTING ON) +set_source_files_properties(SimpleLimit.cpp PROPERTIES SKIP_LINTING ON) diff --git a/src/sound/dsp/SimpleComp.cpp b/third_party/chunkware_dsp/SimpleComp.cpp similarity index 100% rename from src/sound/dsp/SimpleComp.cpp rename to third_party/chunkware_dsp/SimpleComp.cpp diff --git a/src/sound/dsp/SimpleComp.cpp.license b/third_party/chunkware_dsp/SimpleComp.cpp.license similarity index 100% rename from src/sound/dsp/SimpleComp.cpp.license rename to third_party/chunkware_dsp/SimpleComp.cpp.license diff --git a/src/sound/dsp/SimpleComp.h b/third_party/chunkware_dsp/SimpleComp.h similarity index 95% rename from src/sound/dsp/SimpleComp.h rename to third_party/chunkware_dsp/SimpleComp.h index 078b91202b..30c5bb4b04 100644 --- a/src/sound/dsp/SimpleComp.h +++ b/third_party/chunkware_dsp/SimpleComp.h @@ -30,9 +30,9 @@ #ifndef chunkware_simple_SIMPLE_COMP_H #define chunkware_simple_SIMPLE_COMP_H -#include "SimpleHeader.h" // common header -#include "SimpleEnvelope.h" // for base class -#include "SimpleGain.h" // for gain functions +#include "chunkware_dsp/SimpleEnvelope.h" +#include "chunkware_dsp/SimpleGain.h" +#include "chunkware_dsp/SimpleHeader.h" namespace chunkware_simple { diff --git a/src/sound/dsp/SimpleComp.h.license b/third_party/chunkware_dsp/SimpleComp.h.license similarity index 100% rename from src/sound/dsp/SimpleComp.h.license rename to third_party/chunkware_dsp/SimpleComp.h.license diff --git a/src/sound/dsp/SimpleCompProcess.inl b/third_party/chunkware_dsp/SimpleCompProcess.inl similarity index 100% rename from src/sound/dsp/SimpleCompProcess.inl rename to third_party/chunkware_dsp/SimpleCompProcess.inl diff --git a/src/sound/dsp/SimpleCompProcess.inl.license b/third_party/chunkware_dsp/SimpleCompProcess.inl.license similarity index 100% rename from src/sound/dsp/SimpleCompProcess.inl.license rename to third_party/chunkware_dsp/SimpleCompProcess.inl.license diff --git a/src/sound/dsp/SimpleEnvelope.cpp b/third_party/chunkware_dsp/SimpleEnvelope.cpp similarity index 100% rename from src/sound/dsp/SimpleEnvelope.cpp rename to third_party/chunkware_dsp/SimpleEnvelope.cpp diff --git a/src/sound/dsp/SimpleEnvelope.cpp.license b/third_party/chunkware_dsp/SimpleEnvelope.cpp.license similarity index 100% rename from src/sound/dsp/SimpleEnvelope.cpp.license rename to third_party/chunkware_dsp/SimpleEnvelope.cpp.license diff --git a/src/sound/dsp/SimpleEnvelope.h b/third_party/chunkware_dsp/SimpleEnvelope.h similarity index 98% rename from src/sound/dsp/SimpleEnvelope.h rename to third_party/chunkware_dsp/SimpleEnvelope.h index ee11cb0e2a..d0c0143958 100644 --- a/src/sound/dsp/SimpleEnvelope.h +++ b/third_party/chunkware_dsp/SimpleEnvelope.h @@ -31,7 +31,7 @@ #ifndef __SIMPLE_ENVELOPE_H__ #define __SIMPLE_ENVELOPE_H__ -#include "SimpleHeader.h" // common header +#include "SimpleHeader.h" namespace chunkware_simple { diff --git a/src/sound/dsp/SimpleEnvelope.h.license b/third_party/chunkware_dsp/SimpleEnvelope.h.license similarity index 100% rename from src/sound/dsp/SimpleEnvelope.h.license rename to third_party/chunkware_dsp/SimpleEnvelope.h.license diff --git a/src/sound/dsp/SimpleGain.h b/third_party/chunkware_dsp/SimpleGain.h similarity index 100% rename from src/sound/dsp/SimpleGain.h rename to third_party/chunkware_dsp/SimpleGain.h diff --git a/src/sound/dsp/SimpleGain.h.license b/third_party/chunkware_dsp/SimpleGain.h.license similarity index 100% rename from src/sound/dsp/SimpleGain.h.license rename to third_party/chunkware_dsp/SimpleGain.h.license diff --git a/src/sound/dsp/SimpleGate.cpp b/third_party/chunkware_dsp/SimpleGate.cpp similarity index 100% rename from src/sound/dsp/SimpleGate.cpp rename to third_party/chunkware_dsp/SimpleGate.cpp diff --git a/src/sound/dsp/SimpleGate.cpp.license b/third_party/chunkware_dsp/SimpleGate.cpp.license similarity index 100% rename from src/sound/dsp/SimpleGate.cpp.license rename to third_party/chunkware_dsp/SimpleGate.cpp.license diff --git a/src/sound/dsp/SimpleGate.h b/third_party/chunkware_dsp/SimpleGate.h similarity index 95% rename from src/sound/dsp/SimpleGate.h rename to third_party/chunkware_dsp/SimpleGate.h index a469dfc5c4..1a4844b677 100644 --- a/src/sound/dsp/SimpleGate.h +++ b/third_party/chunkware_dsp/SimpleGate.h @@ -31,9 +31,9 @@ #ifndef chunkware__SIMPLE_GATE_H #define chunkware__SIMPLE_GATE_H -#include "SimpleHeader.h" // common header -#include "SimpleEnvelope.h" // for base class -#include "SimpleGain.h" // for gain functions +#include "chunkware_dsp/SimpleEnvelope.h" +#include "chunkware_dsp/SimpleGain.h" // for gain functions +#include "chunkware_dsp/SimpleHeader.h" // common header namespace chunkware_simple { diff --git a/src/sound/dsp/SimpleGate.h.license b/third_party/chunkware_dsp/SimpleGate.h.license similarity index 100% rename from src/sound/dsp/SimpleGate.h.license rename to third_party/chunkware_dsp/SimpleGate.h.license diff --git a/src/sound/dsp/SimpleGateProcess.inl b/third_party/chunkware_dsp/SimpleGateProcess.inl similarity index 100% rename from src/sound/dsp/SimpleGateProcess.inl rename to third_party/chunkware_dsp/SimpleGateProcess.inl diff --git a/src/sound/dsp/SimpleGateProcess.inl.license b/third_party/chunkware_dsp/SimpleGateProcess.inl.license similarity index 100% rename from src/sound/dsp/SimpleGateProcess.inl.license rename to third_party/chunkware_dsp/SimpleGateProcess.inl.license diff --git a/src/sound/dsp/SimpleHeader.h b/third_party/chunkware_dsp/SimpleHeader.h similarity index 100% rename from src/sound/dsp/SimpleHeader.h rename to third_party/chunkware_dsp/SimpleHeader.h diff --git a/src/sound/dsp/SimpleHeader.h.license b/third_party/chunkware_dsp/SimpleHeader.h.license similarity index 100% rename from src/sound/dsp/SimpleHeader.h.license rename to third_party/chunkware_dsp/SimpleHeader.h.license diff --git a/src/sound/dsp/SimpleLimit.cpp b/third_party/chunkware_dsp/SimpleLimit.cpp similarity index 100% rename from src/sound/dsp/SimpleLimit.cpp rename to third_party/chunkware_dsp/SimpleLimit.cpp diff --git a/src/sound/dsp/SimpleLimit.cpp.license b/third_party/chunkware_dsp/SimpleLimit.cpp.license similarity index 100% rename from src/sound/dsp/SimpleLimit.cpp.license rename to third_party/chunkware_dsp/SimpleLimit.cpp.license diff --git a/src/sound/dsp/SimpleLimit.h b/third_party/chunkware_dsp/SimpleLimit.h similarity index 95% rename from src/sound/dsp/SimpleLimit.h rename to third_party/chunkware_dsp/SimpleLimit.h index 65320cc11b..4a839d2fe5 100644 --- a/src/sound/dsp/SimpleLimit.h +++ b/third_party/chunkware_dsp/SimpleLimit.h @@ -31,9 +31,9 @@ #ifndef chunkware_SIMPLE_LIMIT_H #define chunkware_SIMPLE_LIMIT_H -#include "SimpleHeader.h" // common header -#include "SimpleEnvelope.h" // for base class of FastEnvelope -#include "SimpleGain.h" // for gain functions +#include "chunkware_dsp/SimpleHeader.h" // common header +#include "chunkware_dsp/SimpleEnvelope.h" // for base class of FastEnvelope +#include "chunkware_dsp/SimpleGain.h" // for gain functions #include namespace chunkware_simple diff --git a/src/sound/dsp/SimpleLimit.h.license b/third_party/chunkware_dsp/SimpleLimit.h.license similarity index 100% rename from src/sound/dsp/SimpleLimit.h.license rename to third_party/chunkware_dsp/SimpleLimit.h.license diff --git a/src/sound/dsp/SimpleLimitProcess.inl b/third_party/chunkware_dsp/SimpleLimitProcess.inl similarity index 100% rename from src/sound/dsp/SimpleLimitProcess.inl rename to third_party/chunkware_dsp/SimpleLimitProcess.inl diff --git a/src/sound/dsp/SimpleLimitProcess.inl.license b/third_party/chunkware_dsp/SimpleLimitProcess.inl.license similarity index 100% rename from src/sound/dsp/SimpleLimitProcess.inl.license rename to third_party/chunkware_dsp/SimpleLimitProcess.inl.license From 899b5d6ba48874dc57d5a4fd34ce67b6a3d60a41 Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Sat, 25 Oct 2025 12:31:19 +0200 Subject: [PATCH 06/21] ci: Run static code analysis --- .clang-tidy | 28 +----- .github/workflows/build.yml | 57 ++++++++++++ CMakeLists.txt | 1 + CMakePresets.json | 16 ++++ scripts/run_clang_tidy.py | 43 --------- scripts/run_static_analysis.py | 160 +++++++++++++++++++++++++++++++++ src/core/CMakeLists.txt | 13 +-- src/gui/CMakeLists.txt | 14 +-- src/misc/CMakeLists.txt | 10 ++- 9 files changed, 258 insertions(+), 84 deletions(-) delete mode 100644 scripts/run_clang_tidy.py create mode 100644 scripts/run_static_analysis.py diff --git a/.clang-tidy b/.clang-tidy index c5306d66ba..4e01201452 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,32 +1,8 @@ # SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors # SPDX-License-Identifier: CC0-1.0 -Checks: - - '-*' - - 'modernize-*' - - '-modernize-use-trailing-return-type' - - '-modernize-use-nodiscard' - - '-modernize-pass-by-value' - - '-modernize-avoid-c-arrays' - - 'bugprone-*' - - '-bugprone-easily-swappable-parameters' - - 'readability-*' - - '-readability-identifier-length' - - '-readability-implicit-bool-conversion' - - '-readability-braces-around-statements' - - '-readability-function-cognitive-complexity' - - '-readability-convert-member-functions-to-static' - - '-readability-math-missing-parentheses' - - '-readability-avoid-unconditional-preprocessor-if' - - '-readability-magic-numbers' - - '-readability-container-size-empty' - - 'cppcoreguidelines-*' - - '-cppcoreguidelines-avoid-magic-numbers' - - '-cppcoreguidelines-non-private-member-variables-in-classes' - - '-cppcoreguidelines-avoid-c-arrays' - - '-cppcoreguidelines-owning-memory' - - '-cppcoreguidelines-misleading-capture-default-by-value' - - '-cppcoreguidelines-pro-bounds-array-to-pointer-decay' +Checks: > + -*, CheckOptions: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 29a0074e66..486ea3de2a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,6 +18,7 @@ env: do_vatsim_key: ${{ github.event_name == 'push' }} do_symbols: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} do_doxygen: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + do_static_analysis: ${{ github.event_name == 'push' && github.ref != 'refs/heads/main' }} qt_version: 6.10.0 bitrock_version: qt-professional-24.7.0 bitrock_url: https://releases.installbuilder.com/installbuilder @@ -104,6 +105,62 @@ jobs: uses: actions/upload-pages-artifact@v3 with: path: docs/html/ + - name: Check if clang-tidy analysis is required + id: check_need_clang_tidy + run: | + if python3 -u scripts/run_static_analysis.py --check-changed-files; then + echo "should_run_clang_tidy=false" >> $GITHUB_OUTPUT + else + echo "should_run_clang_tidy=true" >> $GITHUB_OUTPUT + fi + - name: Checkout repository + if: ${{ steps.check_need_clang_tidy.outputs.should_run_clang_tidy == 'true' }} + uses: actions/checkout@v4 + with: + fetch-depth: '0' + submodules: 'true' + - name: Install Qt + if: ${{ steps.check_need_clang_tidy.outputs.should_run_clang_tidy == 'true' }} + uses: jurplel/install-qt-action@v4 + with: + version: ${{ env.qt_version }} + modules: 'qtmultimedia' + cache: true + - name: Install dependencies + if: ${{ steps.check_need_clang_tidy.outputs.should_run_clang_tidy == 'true' }} + run: | + sudo apt-get -y install dbus-x11 libglu1-mesa-dev libpulse-dev libdbus-1-dev ninja-build + pip3 install requests conan + - name: Checkout externals + if: ${{ env.use_externals == 'true' && steps.check_need_clang_tidy.outputs.should_run_clang_tidy == 'true' }} + uses: actions/checkout@v4 + env: + EXTERNALS_PAT: ${{ secrets.EXTERNALS_PAT }} + with: + repository: ${{ env.externals }} + ref: ${{ env.externals_sha }} + token: ${{ env.EXTERNALS_PAT }} + path: 'third_party/externals' + - name: Install conan dependencies + if: ${{ steps.check_need_clang_tidy.outputs.should_run_clang_tidy == 'true' }} + shell: bash + env: + ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }} + ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }} + run: | + conan profile detect + conan remote disable conancenter + conan remote add swift https://artifactory.swift-project.org/artifactory/api/conan/conan-local + conan remote login swift "$ARTIFACTORY_USER" --password "$ARTIFACTORY_TOKEN" + conan install . --output-folder=build_conan --deployer=full_deploy -pr=ci/profile_linux + - name: Run clang-tidy + if: ${{ steps.check_need_clang_tidy.outputs.should_run_clang_tidy == 'true' }} + shell: bash + run: | + mkdir build && pushd build + cmake .. --preset ci-build-linux-no-pch + popd + python3 scripts/run_static_analysis.py --clang-tidy --build-path build --changed-files-ci buildLinux: runs-on: ubuntu-22.04 diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c8a5476de..cc8f841ac7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,6 +59,7 @@ option(SWIFT_MINIFY_DEBUG_SYMBOLS "Minify debug symbols" OFF) option(SWIFT_ONLY_XSWIFTBUS_WORKAROUND "Only build xswiftbus (useful when compiling on ARM)" OFF) option(SWIFT_USE_CRASHPAD "Use crashpad" OFF) +option(SWIFT_USE_PCH "Use precompiled headers" ON) # Shortcut to only build xswiftbus diff --git a/CMakePresets.json b/CMakePresets.json index 03bba8ed1e..7c4a02749b 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -77,6 +77,22 @@ "SWIFT_USE_CRASHPAD": "OFF" } }, + { + "name": "ci-build-linux-no-pch", + "displayName": "CI Build Linux without PCH (used for static code analysis)", + "inherits": "ci-build-linux", + "generator": "Ninja", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + }, + "cacheVariables": { + "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", + "VATSIM_KEY_JSON": "", + "SWIFT_USE_PCH": "OFF" + } + }, { "name": "dev-debug", "displayName": "Development Debug", diff --git a/scripts/run_clang_tidy.py b/scripts/run_clang_tidy.py deleted file mode 100644 index f20462ee69..0000000000 --- a/scripts/run_clang_tidy.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/env python - -# SPDX-FileCopyrightText: Copyright (C) 2025 swift Project Community / Contributors -# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -"""This script runs clang-tidy only on files that have changed compared to the latest origin/main branch.""" - -import argparse - -import utils -import os -import subprocess - -def run_clang_tidy(build_path: str): - src_path = utils.get_swift_source_path() - os.chdir(src_path) - - result = subprocess.run( - ['git', 'diff', '--name-only', 'origin/main...HEAD'], - check=True, - stdout=subprocess.PIPE, - text=True - ) - - files = [line for line in result.stdout.splitlines() if (line.endswith('.cpp') or line.endswith('.h')) and not line.startswith('tests')] - nproc = os.cpu_count() - subprocess.run([ - 'xargs', - '-P', str(nproc), - '-n', '1', - '-r', - 'clang-tidy', - '-p', build_path, - '--warnings-as-errors', '*' - ], input='\n'.join(files), text=True, check=True) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser(prog="swift clang-tidy helper") - parser.add_argument("--build-path", required=True, help='Path to build folder') - args = parser.parse_args() - - run_clang_tidy(args.build_path) diff --git a/scripts/run_static_analysis.py b/scripts/run_static_analysis.py new file mode 100644 index 0000000000..76d11f73e6 --- /dev/null +++ b/scripts/run_static_analysis.py @@ -0,0 +1,160 @@ +#!/bin/env python + +# SPDX-FileCopyrightText: Copyright (C) 2025 swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +"""This script runs static analysis tools only on files that have changed compared to the latest origin/main branch.""" + +import argparse +import json +import os +import subprocess +from subprocess import CalledProcessError + +import utils + +# Currently we are not checking all directories as they might need to run compilation first for Qt UIC +CHECK_DIRECTORIES = [ + "src/core", + "src/misc", + "src/input", + "src/sound", +] + + +def _get_all_files(build_path: str) -> list[str]: + """Get all files inside the compile commands.""" + src_path = utils.get_swift_source_path() + os.chdir(src_path) + + with open(os.path.join(build_path, "compile_commands.json"), 'r') as f: + commands = json.load(f) + commands = set([os.path.relpath(entry["file"], utils.get_swift_source_path()) for entry in commands]) + + commands = [command for command in commands if + not command.startswith("third_party") and not command.startswith(build_path)] + return commands + + +def _get_all_files_ci(build_path: str) -> list[str]: + """Get all files in the compile commands and which will be checked in CI runs.""" + src_path = utils.get_swift_source_path() + os.chdir(src_path) + + with open(os.path.join(build_path, "compile_commands.json"), 'r') as f: + commands = json.load(f) + commands = set([os.path.relpath(entry["file"], utils.get_swift_source_path()) for entry in commands]) + + commands = [command for command in commands if command.startswith(tuple(CHECK_DIRECTORIES))] + return commands + + +def _get_changed_files_ci(build_path: str) -> set[str]: + """Get all files in the compile commands which has changed since the last main commit and are in the included directories.""" + src_path = utils.get_swift_source_path() + os.chdir(src_path) + + result = subprocess.run( + ['git', 'diff', '--name-only', 'origin/main'], + check=True, + stdout=subprocess.PIPE, + text=True + ) + with open(os.path.join(build_path, "compile_commands.json"), 'r') as f: + commands = json.load(f) + commands = set([os.path.relpath(entry["file"], utils.get_swift_source_path()) for entry in commands]) + + files = set([line for line in result.stdout.splitlines() if + (line.endswith('.cpp') or line.endswith('.h')) and line.startswith(tuple(CHECK_DIRECTORIES))]) + return files & commands + + +def _has_changed_files() -> bool: + src_path = utils.get_swift_source_path() + os.chdir(src_path) + + result = subprocess.run( + ['git', 'diff', '--name-only', 'origin/main'], + check=True, + stdout=subprocess.PIPE, + text=True + ) + + return len([line for line in result.stdout.splitlines() if + (line.endswith('.cpp') or line.endswith('.h')) and line.startswith(tuple(CHECK_DIRECTORIES))]) > 0 + + +def run_clang_tidy(build_path: str, changed_source_files: set[str]): + print(f"Run clang-tidy on files: {changed_source_files}") + nproc = 10 + try: + subprocess.run([ + 'xargs', + '-P', str(nproc), + '-n', '1', + '-r', + 'clang-tidy', + '-p', build_path, + '--warnings-as-errors', '*', + '--quiet', + '--header-filter', f'{utils.get_swift_source_path()}/src/', + ], input='\n'.join(changed_source_files), text=True, check=True) + except CalledProcessError: + print("Clang-tidy finished with errors") + exit(1) + + +def run_clazy(build_path: str, changed_source_files: set[str]): + print(f"Run clazy on files: {changed_source_files}") + nproc = os.cpu_count() + try: + subprocess.run([ + 'clazy-standalone', + '-p', build_path, + "-extra-arg", "-Werror", + "-extra-arg", "-Wno-unnecessary-virtual-specifier", + '--header-filter', '(config|core|gui|input|misc|plugins|sound|swiftcore|swiftdata|swiftguistandard|swiftlauncher|xswiftbus)/', + *changed_source_files + ], text=True, check=True) + except CalledProcessError: + print("Clazy finished with errors") + exit(1) + + +def main(): + parser = argparse.ArgumentParser(prog="swift clang-tidy helper") + parser.add_argument("--build-path", help='Path to build folder') + + check_mode = parser.add_mutually_exclusive_group(required=True) + check_mode.add_argument("--all-files", action="store_true", + help="Run check on all files in the compile commands") + check_mode.add_argument("--all-files-ci", action="store_true", + help="Run check on all files in the compile commands and which will be checked in CI runs.") + check_mode.add_argument("--changed-files-ci", action="store_true", + help="Run check on all files in the compile commands which are changed since the last main commit and are in the included directories (no Qt UIC files).") + check_mode.add_argument("--check-changed-files", action="store_true", + help="Check if files have changed for evaluation. Program exits with 0 if no files changed; with 1 otherwise") + + parser.add_argument("--clang-tidy", action="store_true", + help="Run clang-tidy checks") + parser.add_argument("--clazy", action="store_true", + help="Run clazy checks") + args = parser.parse_args() + + if args.all_files: + source_files = _get_all_files(args.build_path) + elif args.all_files_ci: + source_files = _get_all_files_ci(args.build_path) + elif args.changed_files_ci: + source_files = _get_changed_files_ci(args.build_path) + else: + exit(1 if _has_changed_files() else 0) + + if args.clang_tidy: + run_clang_tidy(args.build_path, source_files) + elif args.clazy: + run_clazy(args.build_path, source_files) + + +if __name__ == '__main__': + main() diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 1a4f7e67f1..48fba4b95d 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -272,11 +272,14 @@ endif() target_compile_definitions(core PRIVATE BUILD_SWIFT_CORE_LIB) -target_precompile_headers(core - PRIVATE - ${SWIFT_MISC_PCH} - ${SWIFT_CORE_PCH} -) + +if(SWIFT_USE_PCH) + target_precompile_headers(core + PRIVATE + ${SWIFT_MISC_PCH} + ${SWIFT_CORE_PCH} + ) +endif() install(TARGETS core LIBRARY DESTINATION lib diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 0d95bbf765..3152aafe97 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -881,12 +881,14 @@ target_link_libraries(gui target_compile_definitions(gui PRIVATE BUILD_SWIFT_GUI_LIB) -target_precompile_headers(gui - PRIVATE - ${SWIFT_MISC_PCH} - ${SWIFT_CORE_PCH} - ${SWIFT_GUI_PCH} -) +if(SWIFT_USE_PCH) + target_precompile_headers(gui + PRIVATE + ${SWIFT_MISC_PCH} + ${SWIFT_CORE_PCH} + ${SWIFT_GUI_PCH} + ) +endif() install(TARGETS gui LIBRARY DESTINATION lib diff --git a/src/misc/CMakeLists.txt b/src/misc/CMakeLists.txt index 40bd0d4c2f..018a84ab4f 100644 --- a/src/misc/CMakeLists.txt +++ b/src/misc/CMakeLists.txt @@ -718,10 +718,12 @@ if(APPLE) target_link_libraries(misc PRIVATE "-lbsm -framework AVFoundation -framework Security -framework CoreFoundation -framework ApplicationServices -framework Foundation -framework IOKit") endif() -target_precompile_headers(misc - PRIVATE - ${SWIFT_MISC_PCH} -) +if(SWIFT_USE_PCH) + target_precompile_headers(misc + PRIVATE + ${SWIFT_MISC_PCH} + ) +endif() install(TARGETS misc LIBRARY DESTINATION lib From 29bc905e5680bae4bcfe431fc2b0be07e896eca5 Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Thu, 9 Oct 2025 22:35:53 +0200 Subject: [PATCH 07/21] refactor: Fix clang-tidy modernize-use-auto --- .clang-tidy | 1 + samples/afvclient/main.cpp | 6 +- .../samplesphysicalquantities.cpp | 6 +- .../afv/audio/soundcardsampleprovider.cpp | 3 +- .../afv/connection/apiserverconnection.cpp | 2 +- src/core/afv/connection/clientconnection.cpp | 2 +- src/core/aircraftmatcher.cpp | 2 +- src/core/context/contextapplicationproxy.cpp | 2 +- src/core/context/contextaudio.cpp | 2 +- src/core/data/globalsetup.cpp | 4 +- src/core/data/launchersetup.cpp | 4 +- src/core/data/vatsimsetup.cpp | 4 +- src/core/db/databasereader.cpp | 2 +- src/core/db/databasewriter.cpp | 4 +- src/core/vatsim/vatsimsettings.cpp | 8 +- .../aircraftmodelstringcompleter.cpp | 2 +- src/gui/components/applicationclosedialog.cpp | 2 +- src/gui/components/atcbuttoncomponent.cpp | 8 +- src/gui/components/atcstationcomponent.cpp | 6 +- .../components/audionotificationcomponent.cpp | 2 +- src/gui/components/callsigncompleter.cpp | 4 +- .../components/cockpitinfoareacomponent.cpp | 2 +- src/gui/components/colorselector.cpp | 12 +-- src/gui/components/configurationwizard.cpp | 2 +- src/gui/components/coreinfoareacomponent.cpp | 4 +- src/gui/components/datainfoareacomponent.cpp | 4 +- .../components/datamaininfoareacomponent.cpp | 4 +- .../dbaircrafticaoselectorcomponent.cpp | 6 +- .../components/dbairlineicaoselectorbase.cpp | 4 +- .../dbairlineicaoselectorcomponent.cpp | 2 +- .../dbairlinenameselectorcomponent.cpp | 3 +- .../components/dbcountryselectorcomponent.cpp | 6 +- .../dbdistributorselectorcomponent.cpp | 6 +- .../components/dbliveryselectorcomponent.cpp | 6 +- src/gui/components/dbloaddatadialog.cpp | 2 +- src/gui/components/dbmappingcomponent.cpp | 6 +- .../components/dbmappingcomponentaware.cpp | 2 +- src/gui/components/dbownmodelscomponent.cpp | 4 +- src/gui/components/dbownmodelsetcomponent.cpp | 22 +++--- .../components/dbreducemodelduplicates.cpp | 2 +- src/gui/components/flightplancomponent.cpp | 8 +- src/gui/components/hotkeydialog.cpp | 12 +-- .../interpolationsetupcomponent.cpp | 2 +- src/gui/components/logincomponent.cpp | 2 +- src/gui/components/maininfoareacomponent.cpp | 4 +- .../components/mainkeypadareacomponent.cpp | 2 +- src/gui/components/mappingcomponent.cpp | 4 +- src/gui/components/marginsinput.cpp | 2 +- src/gui/components/modelmatchercomponent.cpp | 2 +- src/gui/components/navigatordialog.cpp | 6 +- .../components/networkdetailscomponent.cpp | 2 +- .../otherswiftversionscomponent.cpp | 2 +- src/gui/components/ownaircraftcomponent.cpp | 4 +- src/gui/components/radarcomponent.cpp | 17 ++--- .../components/rawfsdmessagescomponent.cpp | 3 +- .../components/settingshotkeycomponent.cpp | 8 +- .../components/settingssimulatorcomponent.cpp | 2 +- .../components/settingstextmessagestyle.cpp | 4 +- src/gui/components/simulatorcomponent.cpp | 2 +- src/gui/components/statusmessagesdetail.cpp | 2 +- src/gui/components/textmessagecomponent.cpp | 12 +-- src/gui/dockwidget.cpp | 6 +- src/gui/dockwidgetinfoarea.cpp | 6 +- src/gui/editors/aircrafticaoform.cpp | 4 +- src/gui/editors/airlineicaoform.cpp | 4 +- src/gui/editors/distributorform.cpp | 2 +- src/gui/editors/liveryform.cpp | 6 +- src/gui/editors/modelmappingform.cpp | 2 +- src/gui/editors/modelmappingmodifyform.cpp | 3 +- src/gui/editors/serverform.cpp | 2 +- src/gui/enableforframelesswindow.cpp | 2 +- src/gui/eventfilter.cpp | 4 +- src/gui/filters/aircraftmodelfilterbar.cpp | 2 +- src/gui/filters/countryfilterbar.cpp | 2 +- src/gui/guiactionbind.cpp | 4 +- src/gui/guiutility.cpp | 18 ++--- src/gui/guiutility.h | 2 +- src/gui/infoarea.cpp | 36 ++++----- src/gui/menus/aircraftmodelmenus.cpp | 2 +- src/gui/models/actionmodel.cpp | 2 +- src/gui/models/aircraftcategorytreemodel.cpp | 4 +- src/gui/models/atcstationlistmodel.cpp | 2 +- src/gui/models/atcstationtreemodel.cpp | 3 +- src/gui/models/columnformatters.cpp | 30 ++++---- src/gui/models/listmodelbase.cpp | 6 +- src/gui/models/simulatedaircraftlistmodel.cpp | 2 +- src/gui/overlaymessages.cpp | 2 +- src/gui/pluginselector.cpp | 14 ++-- src/gui/settings/dockwidgetsettings.cpp | 4 +- src/gui/settings/guisettings.cpp | 4 +- src/gui/settings/navigatorsettings.cpp | 4 +- src/gui/settings/textmessagesettings.cpp | 4 +- src/gui/settings/viewupdatesettings.cpp | 4 +- src/gui/stylesheetutility.cpp | 2 +- src/gui/views/aircraftcategorytreeview.cpp | 4 +- .../views/aircraftmodelvalidationdialog.cpp | 2 +- src/gui/views/aircraftmodelview.cpp | 22 +++--- src/gui/views/atcstationtreeview.cpp | 10 +-- src/gui/views/checkboxdelegate.cpp | 6 +- src/gui/views/viewbase.cpp | 7 +- src/gui/views/viewbasenontemplate.cpp | 14 ++-- src/gui/views/viewdbobjects.cpp | 10 +-- src/input/linux/joysticklinux.cpp | 6 +- src/input/linux/keyboardlinux.cpp | 2 +- src/misc/applicationinfo.cpp | 6 +- src/misc/aviation/aircraftcategory.cpp | 6 +- src/misc/aviation/aircrafticaocode.cpp | 6 +- src/misc/aviation/aircraftlights.cpp | 6 +- src/misc/aviation/aircraftparts.cpp | 6 +- src/misc/aviation/aircraftsituation.cpp | 6 +- src/misc/aviation/aircraftsituationchange.cpp | 6 +- src/misc/aviation/airlineicaocode.cpp | 6 +- src/misc/aviation/airport.cpp | 6 +- src/misc/aviation/altitude.cpp | 2 +- src/misc/aviation/atcstation.cpp | 6 +- src/misc/aviation/callsign.cpp | 6 +- src/misc/aviation/flightplan.cpp | 6 +- src/misc/aviation/informationmessage.cpp | 6 +- src/misc/aviation/livery.cpp | 6 +- src/misc/aviation/modulator.cpp | 6 +- src/misc/aviation/ongroundinfo.cpp | 4 +- src/misc/aviation/simbriefdata.cpp | 4 +- src/misc/aviation/transponder.cpp | 4 +- src/misc/country.cpp | 6 +- src/misc/db/artifact.cpp | 4 +- src/misc/db/datastore.cpp | 12 +-- src/misc/db/dbinfo.cpp | 6 +- src/misc/db/distribution.cpp | 4 +- src/misc/db/updateinfo.cpp | 4 +- src/misc/directories.cpp | 4 +- src/misc/geo/coordinategeodetic.cpp | 12 +-- src/misc/geo/elevationplane.cpp | 4 +- src/misc/identifier.cpp | 4 +- src/misc/input/actionhotkey.cpp | 4 +- src/misc/input/joystickbutton.cpp | 4 +- src/misc/input/keyboardkey.cpp | 4 +- src/misc/namevariantpair.cpp | 6 +- src/misc/network/authenticateduser.cpp | 4 +- src/misc/network/client.cpp | 4 +- src/misc/network/clientprovider.cpp | 2 +- src/misc/network/ecosystem.cpp | 6 +- src/misc/network/networkutils.cpp | 2 +- src/misc/network/rawfsdmessage.cpp | 4 +- src/misc/network/remotefile.cpp | 4 +- src/misc/network/role.cpp | 4 +- src/misc/network/server.cpp | 6 +- src/misc/network/textmessage.cpp | 6 +- src/misc/network/url.cpp | 4 +- src/misc/network/urllog.cpp | 4 +- src/misc/network/user.cpp | 6 +- src/misc/orderable.cpp | 4 +- src/misc/platform.cpp | 6 +- src/misc/pq/physicalquantity.cpp | 6 +- src/misc/provider.h | 2 +- src/misc/rgbcolor.cpp | 6 +- src/misc/simulation/aircraftmatchersetup.cpp | 4 +- src/misc/simulation/aircraftmodel.cpp | 6 +- src/misc/simulation/distributor.cpp | 6 +- .../fscommon/aircraftcfgentries.cpp | 4 +- .../simulation/fscommon/bcdconversions.cpp | 2 +- .../simulation/fscommon/vpilotmodelrule.cpp | 4 +- .../interpolationrenderingsetup.cpp | 12 +-- .../interpolation/interpolatorspline.cpp | 6 +- .../simulation/matchingstatisticsentry.cpp | 6 +- src/misc/simulation/modelconverterx.cpp | 2 +- .../simulation/ownaircraftproviderdummy.cpp | 2 +- .../remoteaircraftproviderdummy.cpp | 2 +- .../settings/fgswiftbussettings.cpp | 4 +- .../simulation/settings/modelsettings.cpp | 4 +- .../simulation/settings/simulatorsettings.cpp | 8 +- .../settings/swiftpluginsettings.cpp | 4 +- .../simulation/settings/xswiftbussettings.cpp | 4 +- src/misc/simulation/simulatedaircraft.cpp | 6 +- src/misc/simulation/simulatorinternals.cpp | 4 +- src/misc/statusmessage.cpp | 6 +- src/misc/test/testservice.cpp | 2 +- src/misc/timestampbased.cpp | 10 +-- src/misc/variant.cpp | 2 +- src/misc/weather/presentweather.cpp | 4 +- src/misc/weather/windlayer.cpp | 4 +- .../simulatorflightgearconfig.cpp | 2 +- .../plugincommon/simulatorplugincommon.cpp | 2 +- .../xplaneconfig/simulatorxplaneconfig.cpp | 2 +- src/sound/notificationplayer.cpp | 2 +- .../sampleprovider/pinknoisegenerator.cpp | 2 +- src/sound/threadedtonepairplayer.cpp | 4 +- src/sound/wav/wavfile.cpp | 2 +- src/swiftguistandard/swiftguistd.cpp | 8 +- .../core/fsd/testfsdclient/testfsdclient.cpp | 74 +++++++++---------- .../testphysicalquantities.cpp | 10 +-- .../testpropertyindex/testpropertyindex.cpp | 2 +- tests/misc/testslot/testslot.cpp | 2 +- tests/misc/testvalueobject.h | 4 +- .../testvariantandmap/testvariantandmap.cpp | 4 +- 194 files changed, 523 insertions(+), 531 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 4e01201452..244e8cba09 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -3,6 +3,7 @@ Checks: > -*, + modernize-use-auto, CheckOptions: diff --git a/samples/afvclient/main.cpp b/samples/afvclient/main.cpp index fe0ad97db7..042711f435 100644 --- a/samples/afvclient/main.cpp +++ b/samples/afvclient/main.cpp @@ -33,12 +33,12 @@ int main(int argc, char *argv[]) swift::core::registerMetadata(); swift::core::CApplication a("sampleafvclient", CApplicationInfo::Sample); - CAfvMapReader *afvMapReader = new CAfvMapReader(&a); + auto *afvMapReader = new CAfvMapReader(&a); afvMapReader->updateFromMap(); - CAfvClient *voiceClient = new CAfvClient("https://voice1.vatsim.net", &qa); + auto *voiceClient = new CAfvClient("https://voice1.vatsim.net", &qa); voiceClient->start(QThread::TimeCriticalPriority); // background thread - CAfvClientBridge *voiceClientBridge = new CAfvClientBridge(voiceClient, &qa); + auto *voiceClientBridge = new CAfvClientBridge(voiceClient, &qa); QObject::connect(&qa, &QCoreApplication::aboutToQuit, [voiceClient]() { voiceClient->quitAndWait(); }); diff --git a/samples/miscquantities/samplesphysicalquantities.cpp b/samples/miscquantities/samplesphysicalquantities.cpp index 0e781d6b57..53be0a7ebe 100644 --- a/samples/miscquantities/samplesphysicalquantities.cpp +++ b/samples/miscquantities/samplesphysicalquantities.cpp @@ -67,9 +67,9 @@ namespace swift::sample out << f1 << " " << f1.valueRoundedWithUnit(CFrequencyUnit::MHz()) << " " << f1.valueRoundedWithUnit(CFrequencyUnit::GHz(), 3); - CSpeed s1 = CSpeed(100, CSpeedUnit::km_h()); - CSpeed s2 = CSpeed(1000, CSpeedUnit::ft_min()); - CSpeed s3 = CSpeed(s2); + CSpeed s1(100, CSpeedUnit::km_h()); + CSpeed s2(1000, CSpeedUnit::ft_min()); + CSpeed s3(s2); s3.switchUnit(CSpeedUnit::m_s()); out << s1 << " " << s1.valueRoundedWithUnit(CSpeedUnit::defaultUnit()) << " " << s1.valueRoundedWithUnit(CSpeedUnit::NM_h()); diff --git a/src/core/afv/audio/soundcardsampleprovider.cpp b/src/core/afv/audio/soundcardsampleprovider.cpp index 02b0607ced..e498f31dc4 100644 --- a/src/core/afv/audio/soundcardsampleprovider.cpp +++ b/src/core/afv/audio/soundcardsampleprovider.cpp @@ -33,8 +33,7 @@ namespace swift::core::afv::audio constexpr int voiceInputNumber = 4; // number of CallsignSampleProviders for (quint16 transceiverID : transceiverIDs) { - CReceiverSampleProvider *transceiverInput = - new CReceiverSampleProvider(m_waveFormat, transceiverID, voiceInputNumber, m_mixer); + auto transceiverInput = new CReceiverSampleProvider(m_waveFormat, transceiverID, voiceInputNumber, m_mixer); connect(transceiverInput, &CReceiverSampleProvider::receivingCallsignsChanged, this, &CSoundcardSampleProvider::receivingCallsignsChanged); m_receiverInputs.push_back(transceiverInput); diff --git a/src/core/afv/connection/apiserverconnection.cpp b/src/core/afv/connection/apiserverconnection.cpp index 4a3f1a3ecb..74f9f56c70 100644 --- a/src/core/afv/connection/apiserverconnection.cpp +++ b/src/core/afv/connection/apiserverconnection.cpp @@ -305,7 +305,7 @@ namespace swift::core::afv::connection QEventLoop *CApiServerConnection::newEventLoop() { - QEventLoop *loop = new QEventLoop(this); + auto *loop = new QEventLoop(this); if (sApp) { QObject::connect(sApp, &CApplication::aboutToShutdown, loop, &QEventLoop::quit, Qt::QueuedConnection); diff --git a/src/core/afv/connection/clientconnection.cpp b/src/core/afv/connection/clientconnection.cpp index 2b35ba620b..2c65096367 100644 --- a/src/core/afv/connection/clientconnection.cpp +++ b/src/core/afv/connection/clientconnection.cpp @@ -162,7 +162,7 @@ namespace swift::core::afv::connection if (deserializer.m_dtoNameBuffer == AudioRxOnTransceiversDto::getShortDtoName()) { // qDebug() << "Received audio data"; - const AudioRxOnTransceiversDto audioOnTransceiverDto = deserializer.getDto(); + const auto audioOnTransceiverDto = deserializer.getDto(); if (m_connection.isReceivingAudio() && m_connection.isConnected()) { emit audioReceived(audioOnTransceiverDto); diff --git a/src/core/aircraftmatcher.cpp b/src/core/aircraftmatcher.cpp index 1fb68626cb..b83fd71a67 100644 --- a/src/core/aircraftmatcher.cpp +++ b/src/core/aircraftmatcher.cpp @@ -756,7 +756,7 @@ namespace swift::core { if (ms.isQObject()) { - const MSInOutValues *reverseModelProcessed = qobject_cast(ms.toQObject()); + const auto *reverseModelProcessed = qobject_cast(ms.toQObject()); logMessage = reverseModelProcessed->getLogMessage(); if (!reverseModelProcessed->isModified()) { break; } diff --git a/src/core/context/contextapplicationproxy.cpp b/src/core/context/contextapplicationproxy.cpp index 63c9674038..cd5f719bcf 100644 --- a/src/core/context/contextapplicationproxy.cpp +++ b/src/core/context/contextapplicationproxy.cpp @@ -75,7 +75,7 @@ namespace swift::core::context CSettingsDictionary CContextApplicationProxy::getUnsavedSettingsKeysDescribed() const { - CSettingsDictionary result = + auto result = m_dBusInterface->callDBusRet(QLatin1String("getUnsavedSettingsKeysDescribed")); for (auto it = result.begin(); it != result.end(); ++it) { diff --git a/src/core/context/contextaudio.cpp b/src/core/context/contextaudio.cpp index 37379661c3..ced5251da7 100644 --- a/src/core/context/contextaudio.cpp +++ b/src/core/context/contextaudio.cpp @@ -588,7 +588,7 @@ namespace swift::core::context if (!m_voiceClient) { return; } const CCallsign cs = m_voiceClient->getCallsign(); - const CAfvClient::ConnectionStatus s = static_cast(status); + const auto s = static_cast(status); switch (s) { diff --git a/src/core/data/globalsetup.cpp b/src/core/data/globalsetup.cpp index f7cc975c6a..c2e7ab3e74 100644 --- a/src/core/data/globalsetup.cpp +++ b/src/core/data/globalsetup.cpp @@ -107,7 +107,7 @@ namespace swift::core::data { if (index.isMyself()) { return CVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexDbRootDirectory: return QVariant::fromValue(m_dbRootDirectoryUrl); @@ -136,7 +136,7 @@ namespace swift::core::data return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexDbRootDirectory: m_dbRootDirectoryUrl.setPropertyByIndex(index.copyFrontRemoved(), variant); break; diff --git a/src/core/data/launchersetup.cpp b/src/core/data/launchersetup.cpp index 5e23dee482..8598af98d2 100644 --- a/src/core/data/launchersetup.cpp +++ b/src/core/data/launchersetup.cpp @@ -22,7 +22,7 @@ namespace swift::core::data QVariant CLauncherSetup::propertyByIndex(swift::misc::CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexDBusAddress: return QVariant::fromValue(m_dBusAddress); @@ -40,7 +40,7 @@ namespace swift::core::data (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexDBusAddress: this->setDBusAddress(variant.toString()); break; diff --git a/src/core/data/vatsimsetup.cpp b/src/core/data/vatsimsetup.cpp index d501e57232..8237c78bda 100644 --- a/src/core/data/vatsimsetup.cpp +++ b/src/core/data/vatsimsetup.cpp @@ -54,7 +54,7 @@ namespace swift::core::data if (index.isMyself()) { return QVariant::fromValue(*this); } if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::propertyByIndex(index); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexFsdServers: return QVariant::fromValue(this->m_fsdServers); @@ -76,7 +76,7 @@ namespace swift::core::data return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexFsdServers: this->m_fsdServers = variant.value(); break; diff --git a/src/core/db/databasereader.cpp b/src/core/db/databasereader.cpp index 0262f1a117..40cf66cbd0 100644 --- a/src/core/db/databasereader.cpp +++ b/src/core/db/databasereader.cpp @@ -819,7 +819,7 @@ namespace swift::core::db if (started.isValid() && started.canConvert()) { const qint64 now = QDateTime::currentMSecsSinceEpoch(); - const qint64 start = started.value(); + const auto start = started.value(); this->setLoadTimeMs(now - start); m_requestStarted = start; m_responseReceived = now; diff --git a/src/core/db/databasewriter.cpp b/src/core/db/databasewriter.cpp index 952607d268..9ba63d3bbe 100644 --- a/src/core/db/databasewriter.cpp +++ b/src/core/db/databasewriter.cpp @@ -71,7 +71,7 @@ namespace swift::core::db } const bool compress = models.size() > 3; - QHttpMultiPart *multiPart = new QHttpMultiPart(QHttpMultiPart::FormDataType, this); + auto *multiPart = new QHttpMultiPart(QHttpMultiPart::FormDataType, this); multiPart->append(CDatabaseUtils::getJsonTextMultipart(models.toDatabaseJson(), compress)); if (sApp->getGlobalSetup().dbDebugFlag()) { multiPart->append(CDatabaseUtils::getMultipartWithDebugFlag()); } @@ -105,7 +105,7 @@ namespace swift::core::db const QString json = data.toDatabaseJson(); const bool compress = json.size() > 2048; - QHttpMultiPart *multiPart = new QHttpMultiPart(QHttpMultiPart::FormDataType, this); + auto *multiPart = new QHttpMultiPart(QHttpMultiPart::FormDataType, this); multiPart->append(CDatabaseUtils::getJsonTextMultipart(json, compress)); if (sApp->getGlobalSetup().dbDebugFlag()) { diff --git a/src/core/vatsim/vatsimsettings.cpp b/src/core/vatsim/vatsimsettings.cpp index fc8a8265c6..7fa05057e2 100644 --- a/src/core/vatsim/vatsimsettings.cpp +++ b/src/core/vatsim/vatsimsettings.cpp @@ -34,7 +34,7 @@ namespace swift::core::vatsim QVariant CReaderSettings::propertyByIndex(swift::misc::CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexInitialTime: return this->m_initialTime.propertyByIndex(index.copyFrontRemoved()); @@ -51,7 +51,7 @@ namespace swift::core::vatsim (*this) = variant.value(); return; } - ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexInitialTime: this->m_initialTime.setPropertyByIndex(index.copyFrontRemoved(), variant); break; @@ -79,7 +79,7 @@ namespace swift::core::vatsim QVariant CRawFsdMessageSettings::propertyByIndex(swift::misc::CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexRawFsdMessagesEnabled: return QVariant::fromValue(this->m_rawFsdMessagesEnabled); @@ -96,7 +96,7 @@ namespace swift::core::vatsim (*this) = variant.value(); return; } - ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexRawFsdMessagesEnabled: this->m_rawFsdMessagesEnabled = variant.toBool(); break; diff --git a/src/gui/components/aircraftmodelstringcompleter.cpp b/src/gui/components/aircraftmodelstringcompleter.cpp index e49a827ffc..8119b0e5eb 100644 --- a/src/gui/components/aircraftmodelstringcompleter.cpp +++ b/src/gui/components/aircraftmodelstringcompleter.cpp @@ -39,7 +39,7 @@ namespace swift::gui::components connect(&m_modelCaches, &CModelCaches::cacheChanged, this, &CAircraftModelStringCompleter::setSimulator, Qt::QueuedConnection); - CSimulatorInfo simulator = CSimulatorInfo(CSimulatorInfo::P3D); // default + auto simulator = CSimulatorInfo(CSimulatorInfo::P3D); // default if (sGui->getIContextSimulator()) { connect(sGui->getIContextSimulator(), &IContextSimulator::simulatorStatusChanged, this, diff --git a/src/gui/components/applicationclosedialog.cpp b/src/gui/components/applicationclosedialog.cpp index f5a1cd9c43..b7fcf3e4fd 100644 --- a/src/gui/components/applicationclosedialog.cpp +++ b/src/gui/components/applicationclosedialog.cpp @@ -76,7 +76,7 @@ namespace swift::gui::components const CSettingsDictionary settingsDictionary(sApp->getIContextApplication()->getUnsavedSettingsKeysDescribed()); QStringList descriptions = settingsDictionary.values(); descriptions.sort(); - QStringListModel *model = new QStringListModel(descriptions, this); + auto *model = new QStringListModel(descriptions, this); ui->lv_UnsavedSettings->setModel(model); ui->lv_UnsavedSettings->selectAll(); diff --git a/src/gui/components/atcbuttoncomponent.cpp b/src/gui/components/atcbuttoncomponent.cpp index b29ed4b643..976572b4bf 100644 --- a/src/gui/components/atcbuttoncomponent.cpp +++ b/src/gui/components/atcbuttoncomponent.cpp @@ -50,7 +50,7 @@ namespace swift::gui::components if (stations.isEmpty()) { return; } CGuiUtility::deleteLayout(this->layout(), true); - QGridLayout *layout = new QGridLayout(this); + auto *layout = new QGridLayout(this); layout->setObjectName("gl_CAtcButtonComponent"); layout->setSpacing(4); @@ -67,7 +67,7 @@ namespace swift::gui::components if (!station.getCallsign().hasAtcSuffix()) { continue; } } - QPushButton *button = new QPushButton(this); + auto *button = new QPushButton(this); button->setText(station.getCallsignAsString()); if (m_withIcons) { button->setIcon(CIcon(station.toIcon()).toQIcon()); } QObject::connect(button, &QPushButton::released, this, &CAtcButtonComponent::onButtonClicked); @@ -117,11 +117,11 @@ namespace swift::gui::components void CAtcButtonComponent::onButtonClicked() { - QPushButton *button = qobject_cast(QObject::sender()); + auto *button = qobject_cast(QObject::sender()); if (!button) { return; } const CVariant v(button->property("atc")); if (!v.isValid() || !v.canConvert()) { return; } - const CAtcStation station = v.value(); + const auto station = v.value(); emit this->requestAtcStation(station); } } // namespace swift::gui::components diff --git a/src/gui/components/atcstationcomponent.cpp b/src/gui/components/atcstationcomponent.cpp index d31954302e..ce4cff06ab 100644 --- a/src/gui/components/atcstationcomponent.cpp +++ b/src/gui/components/atcstationcomponent.cpp @@ -61,7 +61,7 @@ namespace swift::gui::components ui->tw_Atc->setCurrentIndex(0); ui->tw_Atc->tabBar()->setExpanding(false); ui->tw_Atc->tabBar()->setUsesScrollButtons(true); - CUpperCaseValidator *ucv = new CUpperCaseValidator(ui->le_AtcStationsOnlineMetar); + auto *ucv = new CUpperCaseValidator(ui->le_AtcStationsOnlineMetar); ui->le_AtcStationsOnlineMetar->setValidator(ucv); // some icons @@ -367,7 +367,7 @@ namespace swift::gui::components const QStringList airports = sGui->getWebDataServices()->getAirports().allIcaoCodes(true); if (!airports.isEmpty()) { - QCompleter *airportCompleter = new QCompleter(airports, this); + auto *airportCompleter = new QCompleter(airports, this); const int w5chars = airportCompleter->popup()->fontMetrics().size(Qt::TextSingleLine, "FooBa").width(); airportCompleter->popup()->setMinimumWidth(w5chars * 5); ui->le_AtcStationsOnlineMetar->setCompleter(airportCompleter); @@ -470,7 +470,7 @@ namespace swift::gui::components QVBoxLayout *CAtcStationComponent::vLayout() const { - QVBoxLayout *layout = qobject_cast(this->layout()); + auto *layout = qobject_cast(this->layout()); return layout; } } // namespace swift::gui::components diff --git a/src/gui/components/audionotificationcomponent.cpp b/src/gui/components/audionotificationcomponent.cpp index fee69e4dcf..06d522f726 100644 --- a/src/gui/components/audionotificationcomponent.cpp +++ b/src/gui/components/audionotificationcomponent.cpp @@ -201,7 +201,7 @@ namespace swift::gui::components const CStatusMessage msg = m_audioSettings.set(as); CLogMessage(this).preformatted(msg); - const QCheckBox *sender = qobject_cast(QObject::sender()); + const auto *sender = qobject_cast(QObject::sender()); if (checked && sGui && sGui->getCContextAudioBase() && sender) { const CNotificationSounds::NotificationFlag f = this->checkBoxToFlag(sender); diff --git a/src/gui/components/callsigncompleter.cpp b/src/gui/components/callsigncompleter.cpp index d849618fd5..914810a41d 100644 --- a/src/gui/components/callsigncompleter.cpp +++ b/src/gui/components/callsigncompleter.cpp @@ -28,7 +28,7 @@ namespace swift::gui::components Q_ASSERT_X(sGui, Q_FUNC_INFO, "Need sGui"); Q_ASSERT_X(sGui->getIContextNetwork(), Q_FUNC_INFO, "Need network context"); ui->setupUi(this); - CUpperCaseValidator *ucv = new CUpperCaseValidator(ui->le_Callsign); + auto *ucv = new CUpperCaseValidator(ui->le_Callsign); ui->le_Callsign->setValidator(ucv); ui->le_Callsign->setCompleter(*completer()); ui->led_Status->setToolTips("connected", "disconnected"); @@ -129,7 +129,7 @@ namespace swift::gui::components CSharedStringListCompleter *CCallsignCompleter::completer() { - static CSharedStringListCompleter *c = new CSharedStringListCompleter(); + static auto *c = new CSharedStringListCompleter(); return c; } } // namespace swift::gui::components diff --git a/src/gui/components/cockpitinfoareacomponent.cpp b/src/gui/components/cockpitinfoareacomponent.cpp index fb88400226..44da84adff 100644 --- a/src/gui/components/cockpitinfoareacomponent.cpp +++ b/src/gui/components/cockpitinfoareacomponent.cpp @@ -35,7 +35,7 @@ namespace swift::gui::components const QPixmap &CCockpitInfoAreaComponent::indexToPixmap(int areaIndex) const { - const InfoArea area = static_cast(areaIndex); + const auto area = static_cast(areaIndex); switch (area) { case InfoAreaAudio: return CIcons::appAudio16(); diff --git a/src/gui/components/colorselector.cpp b/src/gui/components/colorselector.cpp index c78d80a1ee..ff23543ebd 100644 --- a/src/gui/components/colorselector.cpp +++ b/src/gui/components/colorselector.cpp @@ -43,7 +43,7 @@ namespace swift::gui::components connect(ui->le_Color, &QLineEdit::editingFinished, this, &CColorSelector::onReturnPressed); connect(ui->le_Color, &QLineEdit::returnPressed, this, &CColorSelector::onReturnPressed); - QCompleter *completer = new QCompleter(QColor::colorNames(), this); + auto *completer = new QCompleter(QColor::colorNames(), this); completer->setCaseSensitivity(Qt::CaseInsensitive); completer->setMaxVisibleItems(10); completer->setCompletionMode(QCompleter::PopupCompletion); @@ -114,7 +114,7 @@ namespace swift::gui::components if (mime->hasColor()) { - const QColor color = qvariant_cast(event->mimeData()->colorData()); + const auto color = qvariant_cast(event->mimeData()->colorData()); if (!color.isValid()) { return; } this->setColor(color); } @@ -125,13 +125,13 @@ namespace swift::gui::components { if (valueVariant.canConvert()) { - const CRgbColor rgb(valueVariant.value()); + const auto rgb(valueVariant.value()); if (!rgb.isValid()) { return; } this->setColor(rgb); } else if (valueVariant.canConvert()) { - const QColor qColor(valueVariant.value()); + const auto qColor(valueVariant.value()); if (!qColor.isValid()) { return; } this->setColor(qColor); } @@ -157,8 +157,8 @@ namespace swift::gui::components const CRgbColor c(this->getColor()); if (!c.isValid()) { return; } - QDrag *drag = new QDrag(this); - QMimeData *mimeData = new QMimeData; + auto *drag = new QDrag(this); + auto *mimeData = new QMimeData; mimeData->setColorData(QVariant::fromValue(c.toQColor())); drag->setMimeData(mimeData); diff --git a/src/gui/components/configurationwizard.cpp b/src/gui/components/configurationwizard.cpp index c835eb184b..29c6cb4701 100644 --- a/src/gui/components/configurationwizard.cpp +++ b/src/gui/components/configurationwizard.cpp @@ -67,7 +67,7 @@ namespace swift::gui::components bool CConfigurationWizard::lastWizardStepSkipped(const QWizard *standardWizard) { - const CConfigurationWizard *wizard = qobject_cast(standardWizard); + const auto *wizard = qobject_cast(standardWizard); return wizard && wizard->lastStepSkipped(); } diff --git a/src/gui/components/coreinfoareacomponent.cpp b/src/gui/components/coreinfoareacomponent.cpp index cfda19c265..8e3bc7ebe3 100644 --- a/src/gui/components/coreinfoareacomponent.cpp +++ b/src/gui/components/coreinfoareacomponent.cpp @@ -29,7 +29,7 @@ namespace swift::gui::components QSize CCoreInfoAreaComponent::getPreferredSizeWhenFloating(int areaIndex) const { - InfoArea area = static_cast(areaIndex); + auto area = static_cast(areaIndex); switch (area) { case InfoAreaLog: return QSize(400, 300); @@ -39,7 +39,7 @@ namespace swift::gui::components const QPixmap &CCoreInfoAreaComponent::indexToPixmap(int areaIndex) const { - InfoArea area = static_cast(areaIndex); + auto area = static_cast(areaIndex); switch (area) { case InfoAreaLog: return CIcons::appLog16(); diff --git a/src/gui/components/datainfoareacomponent.cpp b/src/gui/components/datainfoareacomponent.cpp index 57a650a5ea..1127115d9d 100644 --- a/src/gui/components/datainfoareacomponent.cpp +++ b/src/gui/components/datainfoareacomponent.cpp @@ -101,7 +101,7 @@ namespace swift::gui::components QSize CDataInfoAreaComponent::getPreferredSizeWhenFloating(int areaIndex) const { - InfoArea area = static_cast(areaIndex); + auto area = static_cast(areaIndex); switch (area) { case InfoAreaAircraftIcao: @@ -116,7 +116,7 @@ namespace swift::gui::components const QPixmap &CDataInfoAreaComponent::indexToPixmap(int areaIndex) const { - InfoArea area = static_cast(areaIndex); + auto area = static_cast(areaIndex); switch (area) { case InfoAreaAircraftIcao: return CIcons::appAircraftIcao16(); diff --git a/src/gui/components/datamaininfoareacomponent.cpp b/src/gui/components/datamaininfoareacomponent.cpp index ca9e425f6c..45da54171d 100644 --- a/src/gui/components/datamaininfoareacomponent.cpp +++ b/src/gui/components/datamaininfoareacomponent.cpp @@ -68,7 +68,7 @@ namespace swift::gui::components QSize CDataMainInfoAreaComponent::getPreferredSizeWhenFloating(int areaIndex) const { - const InfoArea area = static_cast(areaIndex); + const auto area = static_cast(areaIndex); switch (area) { case InfoAreaData: @@ -81,7 +81,7 @@ namespace swift::gui::components const QPixmap &CDataMainInfoAreaComponent::indexToPixmap(int areaIndex) const { - const InfoArea area = static_cast(areaIndex); + const auto area = static_cast(areaIndex); switch (area) { case InfoAreaData: return CIcons::appDatabase16(); diff --git a/src/gui/components/dbaircrafticaoselectorcomponent.cpp b/src/gui/components/dbaircrafticaoselectorcomponent.cpp index abaf28078c..a89c972d8c 100644 --- a/src/gui/components/dbaircrafticaoselectorcomponent.cpp +++ b/src/gui/components/dbaircrafticaoselectorcomponent.cpp @@ -151,13 +151,13 @@ namespace swift::gui::components { if (valueVariant.canConvert()) { - CAircraftIcaoCode icao(valueVariant.value()); + auto icao(valueVariant.value()); if (!icao.hasValidDbKey()) { return; } this->setAircraftIcao(icao); } else if (valueVariant.canConvert()) { - CAircraftIcaoCodeList icaos(valueVariant.value()); + auto icaos(valueVariant.value()); if (icaos.isEmpty()) { return; } this->setAircraftIcao(icaos.front()); } @@ -186,7 +186,7 @@ namespace swift::gui::components { if (count > 0) { - QCompleter *c = new QCompleter(this->completerStrings(), this); + auto *c = new QCompleter(this->completerStrings(), this); c->setCaseSensitivity(Qt::CaseInsensitive); c->setCompletionMode(QCompleter::PopupCompletion); c->setMaxVisibleItems(10); diff --git a/src/gui/components/dbairlineicaoselectorbase.cpp b/src/gui/components/dbairlineicaoselectorbase.cpp index d8fc476e3f..3ea43da8bb 100644 --- a/src/gui/components/dbairlineicaoselectorbase.cpp +++ b/src/gui/components/dbairlineicaoselectorbase.cpp @@ -104,13 +104,13 @@ namespace swift::gui::components { if (valueVariant.canConvert()) { - const CAirlineIcaoCode icao(valueVariant.value()); + const auto icao(valueVariant.value()); if (!icao.hasValidDbKey()) { return; } this->setAirlineIcao(icao); } else if (valueVariant.canConvert()) { - const CAirlineIcaoCodeList icaos(valueVariant.value()); + const auto icaos(valueVariant.value()); if (icaos.isEmpty()) { return; } this->setAirlineIcao(icaos.front()); } diff --git a/src/gui/components/dbairlineicaoselectorcomponent.cpp b/src/gui/components/dbairlineicaoselectorcomponent.cpp index c1a9d7a914..0c1efd3735 100644 --- a/src/gui/components/dbairlineicaoselectorcomponent.cpp +++ b/src/gui/components/dbairlineicaoselectorcomponent.cpp @@ -79,7 +79,7 @@ namespace swift::gui::components QCompleter *CDbAirlineIcaoSelectorComponent::createCompleter() { - QCompleter *c = new QCompleter(completerStrings(), this); + auto *c = new QCompleter(completerStrings(), this); c->setCaseSensitivity(Qt::CaseInsensitive); c->setCompletionMode(QCompleter::PopupCompletion); c->setMaxVisibleItems(10); diff --git a/src/gui/components/dbairlinenameselectorcomponent.cpp b/src/gui/components/dbairlinenameselectorcomponent.cpp index 5e93608630..87de024695 100644 --- a/src/gui/components/dbairlinenameselectorcomponent.cpp +++ b/src/gui/components/dbairlinenameselectorcomponent.cpp @@ -51,8 +51,7 @@ namespace swift::gui::components QCompleter *CDbAirlineNameSelectorComponent::createCompleter() { - QCompleter *c = - new QCompleter(sGui->getWebDataServices()->getAirlineIcaoCodes().toNameCompleterStrings(), this); + auto *c = new QCompleter(sGui->getWebDataServices()->getAirlineIcaoCodes().toNameCompleterStrings(), this); c->setCaseSensitivity(Qt::CaseInsensitive); c->setCompletionMode(QCompleter::PopupCompletion); c->setMaxVisibleItems(10); diff --git a/src/gui/components/dbcountryselectorcomponent.cpp b/src/gui/components/dbcountryselectorcomponent.cpp index 83c302b2b7..c51819e550 100644 --- a/src/gui/components/dbcountryselectorcomponent.cpp +++ b/src/gui/components/dbcountryselectorcomponent.cpp @@ -129,13 +129,13 @@ namespace swift::gui::components { if (valueVariant.canConvert()) { - const CCountry country(valueVariant.value()); + const auto country(valueVariant.value()); if (!country.hasIsoCode()) { return; } this->setCountry(country); } else if (valueVariant.canConvert()) { - const CCountryList countries(valueVariant.value()); + const auto countries(valueVariant.value()); if (countries.isEmpty()) { return; } this->setCountry(countries.front()); } @@ -150,7 +150,7 @@ namespace swift::gui::components { if (count > 0) { - QCompleter *c = new QCompleter(sGui->getWebDataServices()->getCountries().toNameList(), this); + auto *c = new QCompleter(sGui->getWebDataServices()->getCountries().toNameList(), this); c->setCaseSensitivity(Qt::CaseInsensitive); c->setCompletionMode(QCompleter::PopupCompletion); c->setMaxVisibleItems(10); diff --git a/src/gui/components/dbdistributorselectorcomponent.cpp b/src/gui/components/dbdistributorselectorcomponent.cpp index 7129b06350..e06495989d 100644 --- a/src/gui/components/dbdistributorselectorcomponent.cpp +++ b/src/gui/components/dbdistributorselectorcomponent.cpp @@ -147,13 +147,13 @@ namespace swift::gui::components { if (valueVariant.canConvert()) { - CDistributor distributor(valueVariant.value()); + auto distributor(valueVariant.value()); if (!distributor.hasValidDbKey()) { return; } this->setDistributor(distributor); } else if (valueVariant.canConvert()) { - CDistributorList distributors(valueVariant.value()); + auto distributors(valueVariant.value()); if (distributors.isEmpty()) { return; } this->setDistributor(distributors.front()); } @@ -170,7 +170,7 @@ namespace swift::gui::components { const QStringList keysAndAliases( sGui->getWebDataServices()->getDistributors().getDbKeysAndAliases(true)); - QCompleter *c = new QCompleter(keysAndAliases, this); + auto *c = new QCompleter(keysAndAliases, this); c->setCaseSensitivity(Qt::CaseInsensitive); c->setCompletionMode(QCompleter::PopupCompletion); c->setMaxVisibleItems(10); diff --git a/src/gui/components/dbliveryselectorcomponent.cpp b/src/gui/components/dbliveryselectorcomponent.cpp index 560f13afaa..076e74309b 100644 --- a/src/gui/components/dbliveryselectorcomponent.cpp +++ b/src/gui/components/dbliveryselectorcomponent.cpp @@ -167,13 +167,13 @@ namespace swift::gui::components { if (valueVariant.canConvert()) { - const CLivery livery(valueVariant.value()); + const auto livery(valueVariant.value()); if (!livery.hasValidDbKey()) { return; } this->setLivery(livery); } else if (valueVariant.canConvert()) { - const CLiveryList liveries(valueVariant.value()); + const auto liveries(valueVariant.value()); if (liveries.isEmpty()) { return; } this->setLivery(liveries.front()); } @@ -191,7 +191,7 @@ namespace swift::gui::components if (count > 0) { const QStringList codes(sGui->getWebDataServices()->getLiveries().getCombinedCodesPlusInfoAndId(true)); - QCompleter *c = new QCompleter(codes, this); + auto *c = new QCompleter(codes, this); c->setCaseSensitivity(Qt::CaseInsensitive); c->setCompletionMode(QCompleter::PopupCompletion); c->setMaxVisibleItems(10); diff --git a/src/gui/components/dbloaddatadialog.cpp b/src/gui/components/dbloaddatadialog.cpp index 78f8c7c3bf..3376e2c13e 100644 --- a/src/gui/components/dbloaddatadialog.cpp +++ b/src/gui/components/dbloaddatadialog.cpp @@ -30,7 +30,7 @@ namespace swift::gui::components Q_ASSERT_X(sGui, Q_FUNC_INFO, "Need sGui"); ui->setupUi(this); this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); - QStringListModel *lvm = new QStringListModel(ui->lv_Entities); + auto *lvm = new QStringListModel(ui->lv_Entities); ui->comp_SimulatorSelector->setMode(CSimulatorSelector::RadioButtons); ui->lv_Entities->setModel(lvm); ui->bb_loadDataDialog->button(QDialogButtonBox::Apply)->setText("Load"); diff --git a/src/gui/components/dbmappingcomponent.cpp b/src/gui/components/dbmappingcomponent.cpp index cb8af7ca7a..beaa8de50d 100644 --- a/src/gui/components/dbmappingcomponent.cpp +++ b/src/gui/components/dbmappingcomponent.cpp @@ -451,7 +451,7 @@ namespace swift::gui::components m_modelModifyDialog->setValue(ui->comp_StashAircraft->view()->selectedObject()); } - const QDialog::DialogCode s = static_cast(m_modelModifyDialog->exec()); + const auto s = static_cast(m_modelModifyDialog->exec()); if (s == QDialog::Rejected) { return; } const CPropertyIndexVariantMap vm = m_modelModifyDialog->getValues(); ui->comp_StashAircraft->applyToSelected(vm); @@ -564,7 +564,7 @@ namespace swift::gui::components void CDbMappingComponent::onTabIndexChanged(int index) { - const CDbMappingComponent::TabIndex ti = static_cast(index); + const auto ti = static_cast(index); switch (ti) { case CDbMappingComponent::TabOwnModelSet: @@ -850,7 +850,7 @@ namespace swift::gui::components void CDbMappingComponent::CMappingVPilotMenu::customMenu(CMenuActions &menuActions) { - CDbMappingComponent *mapComp = qobject_cast(this->parent()); + auto *mapComp = qobject_cast(this->parent()); Q_ASSERT_X(mapComp, Q_FUNC_INFO, "Cannot access mapping component"); const bool canUseVPilot = mappingComponent()->withVPilot(); diff --git a/src/gui/components/dbmappingcomponentaware.cpp b/src/gui/components/dbmappingcomponentaware.cpp index 2c3720dbbb..5a50375b4f 100644 --- a/src/gui/components/dbmappingcomponentaware.cpp +++ b/src/gui/components/dbmappingcomponentaware.cpp @@ -21,7 +21,7 @@ namespace swift::gui::components // if we get a mapping component we use it if (!parent) { return; } if (!parent->isWidgetType()) { return; } - CDbMappingComponent *m = qobject_cast(parent); + auto *m = qobject_cast(parent); if (!m) { return; } m_mappingComponent = m; } diff --git a/src/gui/components/dbownmodelscomponent.cpp b/src/gui/components/dbownmodelscomponent.cpp index 6b94c12c29..1a24f7f472 100644 --- a/src/gui/components/dbownmodelscomponent.cpp +++ b/src/gui/components/dbownmodelscomponent.cpp @@ -282,7 +282,7 @@ namespace swift::gui::components QStringLiteral("Completely reload '%1' models from disk?").arg(simulator.toQString(true)), QMessageBox::Ok | QMessageBox::Cancel, this); msgBox.setDefaultButton(QMessageBox::Cancel); - const QMessageBox::StandardButton reply = static_cast(msgBox.exec()); + const auto reply = static_cast(msgBox.exec()); if (reply != QMessageBox::Ok) { return; } this->requestSimulatorModels(simulator, IAircraftModelLoader::InBackgroundNoCache); @@ -497,7 +497,7 @@ namespace swift::gui::components "override the loaded models from the simulator.\nNormally you would not want that (cancel).", QMessageBox::Save | QMessageBox::Cancel, this); msgBox.setDefaultButton(QMessageBox::Cancel); - const QMessageBox::StandardButton reply = static_cast(msgBox.exec()); + const auto reply = static_cast(msgBox.exec()); if (reply != QMessageBox::Cancel) { return; } const CAircraftModelList models = ui->tvp_OwnAircraftModels->container(); if (models.isEmpty()) { return; } diff --git a/src/gui/components/dbownmodelsetcomponent.cpp b/src/gui/components/dbownmodelsetcomponent.cpp index 39fe3a1c9f..4c39cb7f05 100644 --- a/src/gui/components/dbownmodelsetcomponent.cpp +++ b/src/gui/components/dbownmodelsetcomponent.cpp @@ -335,7 +335,7 @@ namespace swift::gui::components CAircraftModelList models = ui->tvp_OwnModelSet->containerOrFilteredContainer(); const CSimulatorInfo simulator = this->getModelSetSimulator(); m_reduceModelsDialog->setModels(models, simulator); - const QDialog::DialogCode ret = static_cast(m_reduceModelsDialog->exec()); + const auto ret = static_cast(m_reduceModelsDialog->exec()); if (ret != QDialog::Accepted) { return; } const CAircraftModelList removeModels = m_reduceModelsDialog->getRemoveCandidates(); const CSimulatorInfo removeSimulator = m_reduceModelsDialog->getSimulator(); @@ -412,7 +412,7 @@ namespace swift::gui::components { m_modelSetFormDialog->setModal(true); m_modelSetFormDialog->reloadData(); - const QDialog::DialogCode rc = static_cast(m_modelSetFormDialog->exec()); + const auto rc = static_cast(m_modelSetFormDialog->exec()); if (rc == QDialog::Accepted) { this->setModelSet(m_modelSetFormDialog->getModelSet(), m_modelSetFormDialog->getSimulatorInfo()); @@ -504,13 +504,13 @@ namespace swift::gui::components const bool noSims = sims.isNoSimulator() || sims.isUnspecified(); if (!noSims) { - CDbOwnModelSetComponent *ownModelSetComp = qobject_cast(this->parent()); + auto *ownModelSetComp = qobject_cast(this->parent()); Q_ASSERT_X(ownModelSetComp, Q_FUNC_INFO, "Cannot access parent"); if (m_setActions.isEmpty()) { if (sims.isFSX()) { - QAction *a = new QAction(CIcons::appModels16(), "FSX models", this); + auto *a = new QAction(CIcons::appModels16(), "FSX models", this); connect(a, &QAction::triggered, ownModelSetComp, [ownModelSetComp](bool checked) { Q_UNUSED(checked) ownModelSetComp->setSimulator(CSimulatorInfo(CSimulatorInfo::FSX)); @@ -526,7 +526,7 @@ namespace swift::gui::components } if (sims.isP3D()) { - QAction *a = new QAction(CIcons::appModels16(), "P3D models", this); + auto *a = new QAction(CIcons::appModels16(), "P3D models", this); connect(a, &QAction::triggered, ownModelSetComp, [ownModelSetComp](bool checked) { Q_UNUSED(checked) ownModelSetComp->setSimulator(CSimulatorInfo(CSimulatorInfo::P3D)); @@ -542,7 +542,7 @@ namespace swift::gui::components } if (sims.isFS9()) { - QAction *a = new QAction(CIcons::appModels16(), "FS9 models", this); + auto *a = new QAction(CIcons::appModels16(), "FS9 models", this); connect(a, &QAction::triggered, ownModelSetComp, [ownModelSetComp](bool checked) { Q_UNUSED(checked) ownModelSetComp->setSimulator(CSimulatorInfo(CSimulatorInfo::FS9)); @@ -558,7 +558,7 @@ namespace swift::gui::components } if (sims.isXPlane()) { - QAction *a = new QAction(CIcons::appModels16(), "XPlane models", this); + auto *a = new QAction(CIcons::appModels16(), "XPlane models", this); connect(a, &QAction::triggered, ownModelSetComp, [ownModelSetComp](bool checked) { Q_UNUSED(checked) ownModelSetComp->setSimulator(CSimulatorInfo(CSimulatorInfo::XPLANE)); @@ -574,7 +574,7 @@ namespace swift::gui::components } if (sims.isFG()) { - QAction *a = new QAction(CIcons::appModels16(), "FG models", this); + auto *a = new QAction(CIcons::appModels16(), "FG models", this); connect(a, &QAction::triggered, ownModelSetComp, [ownModelSetComp](bool checked) { Q_UNUSED(checked) ownModelSetComp->setSimulator(CSimulatorInfo(CSimulatorInfo::FG)); @@ -590,7 +590,7 @@ namespace swift::gui::components } if (sims.isMSFS()) { - QAction *a = new QAction(CIcons::appModels16(), "MSFS models", this); + auto *a = new QAction(CIcons::appModels16(), "MSFS models", this); connect(a, &QAction::triggered, ownModelSetComp, [ownModelSetComp](bool checked) { Q_UNUSED(checked) ownModelSetComp->setSimulator(CSimulatorInfo(CSimulatorInfo::MSFS)); @@ -606,7 +606,7 @@ namespace swift::gui::components } if (sims.isMSFS2024()) { - QAction *a = new QAction(CIcons::appModels16(), "MSFS2024 models", this); + auto *a = new QAction(CIcons::appModels16(), "MSFS2024 models", this); connect(a, &QAction::triggered, ownModelSetComp, [ownModelSetComp](bool checked) { Q_UNUSED(checked) ownModelSetComp->setSimulator(CSimulatorInfo(CSimulatorInfo::MSFS2024)); @@ -621,7 +621,7 @@ namespace swift::gui::components m_setNewActions.append(a); } - QAction *a = new QAction(CIcons::appDistributors16(), "Apply distributor preferences", this); + auto *a = new QAction(CIcons::appDistributors16(), "Apply distributor preferences", this); connect(a, &QAction::triggered, ownModelSetComp, &CDbOwnModelSetComponent::distributorPreferencesChanged, Qt::QueuedConnection); m_setActions.append(a); diff --git a/src/gui/components/dbreducemodelduplicates.cpp b/src/gui/components/dbreducemodelduplicates.cpp index 93790acfc2..ec14d08749 100644 --- a/src/gui/components/dbreducemodelduplicates.cpp +++ b/src/gui/components/dbreducemodelduplicates.cpp @@ -61,7 +61,7 @@ namespace swift::gui::components const QStringList distributors = models.getDistributors().getDbKeysAndAliases(true); const int distributorCount = m_models.getDistributors().sizeInt(); - QCompleter *c = new QCompleter(distributors, this); + auto *c = new QCompleter(distributors, this); c->setCaseSensitivity(Qt::CaseInsensitive); ui->le_Distributor->setCompleter(c); ui->le_Models->setText(QStringLiteral("%1 models for simulator '%2', distributors: %3") diff --git a/src/gui/components/flightplancomponent.cpp b/src/gui/components/flightplancomponent.cpp index 5f703e8039..053eedf788 100644 --- a/src/gui/components/flightplancomponent.cpp +++ b/src/gui/components/flightplancomponent.cpp @@ -107,7 +107,7 @@ namespace swift::gui::components ui->le_NavComEquipment->setReadOnly(true); ui->le_SsrEquipment->setReadOnly(true); - CUpperCaseEventFilter *ef = new CUpperCaseEventFilter(ui->pte_Route); + auto *ef = new CUpperCaseEventFilter(ui->pte_Route); ui->pte_Route->installEventFilter(ef); ef = new CUpperCaseEventFilter(ui->pte_Remarks); ui->pte_Remarks->installEventFilter(ef); @@ -822,7 +822,7 @@ namespace swift::gui::components { if (!m_altitudeDialog) { m_altitudeDialog = new CAltitudeDialog(this); } - const QDialog::DialogCode ret = static_cast(m_altitudeDialog->exec()); + const auto ret = static_cast(m_altitudeDialog->exec()); if (ret != QDialog::Accepted) { return; } if (!m_altitudeDialog->getAltitudeString().isEmpty()) @@ -1073,7 +1073,7 @@ namespace swift::gui::components { if (!sGui || !sGui->hasWebDataServices()) { return; } const QStringList aircraft(sGui->getWebDataServices()->getAircraftIcaoCodes().allDesignators().values()); - QCompleter *aircraftCompleter = new QCompleter(aircraft, this); + auto *aircraftCompleter = new QCompleter(aircraft, this); aircraftCompleter->setMaxVisibleItems(10); const int w5chars1 = aircraftCompleter->popup()->fontMetrics().size(Qt::TextSingleLine, "FooBa").width(); aircraftCompleter->popup()->setMinimumWidth(w5chars1 * 5); @@ -1082,7 +1082,7 @@ namespace swift::gui::components ui->le_AircraftType->setCompleter(aircraftCompleter); const QStringList airports = sGui->getWebDataServices()->getAirports().allIcaoCodes(true); - QCompleter *airportCompleter = new QCompleter(airports, this); + auto *airportCompleter = new QCompleter(airports, this); airportCompleter->setMaxVisibleItems(10); const int w5chars2 = airportCompleter->popup()->fontMetrics().size(Qt::TextSingleLine, "FooBa").width(); airportCompleter->popup()->setMinimumWidth(w5chars2 * 5); diff --git a/src/gui/components/hotkeydialog.cpp b/src/gui/components/hotkeydialog.cpp index 5bba5763e0..02389b3f25 100644 --- a/src/gui/components/hotkeydialog.cpp +++ b/src/gui/components/hotkeydialog.cpp @@ -201,7 +201,7 @@ namespace swift::gui::components int currentIndex = 0; const bool select = !keyboardKey.isUnknown(); - CKeySelectionBox *ksb = new CKeySelectionBox(ui->qf_Advanced); + auto *ksb = new CKeySelectionBox(ui->qf_Advanced); ksb->addItem(noKeyButton(), QVariant::fromValue(CKeyboardKey())); // at front for (const CKeyboardKey &supportedKey : allSupportedKeys) { @@ -225,7 +225,7 @@ namespace swift::gui::components { int currentIndex = -1; - CKeySelectionBox *ksb = new CKeySelectionBox(ui->qf_Advanced); + auto *ksb = new CKeySelectionBox(ui->qf_Advanced); ksb->addItem(noKeyButton(), QVariant::fromValue(CJoystickButton())); // at front for (const CJoystickButton &availableButton : allAvailableButtons) { @@ -344,8 +344,8 @@ namespace swift::gui::components if (ksb->itemData(oldIndex).canConvert() && ksb->itemData(newIndex).canConvert()) { - CKeyboardKey oldKey = ksb->itemData(oldIndex).value(); - CKeyboardKey newKey = ksb->itemData(newIndex).value(); + auto oldKey = ksb->itemData(oldIndex).value(); + auto newKey = ksb->itemData(newIndex).value(); CHotkeyCombination combination = m_actionHotkey.getCombination(); if (newKey.isUnknown()) { combination.removeKeyboardKey(oldKey); } @@ -356,8 +356,8 @@ namespace swift::gui::components if (ksb->itemData(oldIndex).canConvert() && ksb->itemData(newIndex).canConvert()) { - CJoystickButton oldButton = ksb->itemData(oldIndex).value(); - CJoystickButton newButton = ksb->itemData(newIndex).value(); + auto oldButton = ksb->itemData(oldIndex).value(); + auto newButton = ksb->itemData(newIndex).value(); CHotkeyCombination combination = m_actionHotkey.getCombination(); if (!newButton.isValid()) { combination.removeJoystickButton(oldButton); } diff --git a/src/gui/components/interpolationsetupcomponent.cpp b/src/gui/components/interpolationsetupcomponent.cpp index 2da8475c0a..7769189b82 100644 --- a/src/gui/components/interpolationsetupcomponent.cpp +++ b/src/gui/components/interpolationsetupcomponent.cpp @@ -260,7 +260,7 @@ namespace swift::gui::components { if (deletedObjects.canConvert()) { - const CInterpolationSetupList deletedSetups = deletedObjects.value(); + const auto deletedSetups = deletedObjects.value(); if (deletedSetups.isEmpty()) { return; } // make sure the setups are really deleted diff --git a/src/gui/components/logincomponent.cpp b/src/gui/components/logincomponent.cpp index 3087427305..8a083a58c6 100644 --- a/src/gui/components/logincomponent.cpp +++ b/src/gui/components/logincomponent.cpp @@ -309,7 +309,7 @@ namespace swift::gui::components void CLoginComponent::onSimulatorStatusChanged(int status) { - ISimulator::SimulatorStatus s = static_cast(status); + auto s = static_cast(status); if (!this->hasValidContexts()) { return; } m_simulatorConnected = s.testFlag(ISimulator::Connected); this->updateUiConnectState(); diff --git a/src/gui/components/maininfoareacomponent.cpp b/src/gui/components/maininfoareacomponent.cpp index de170547c2..e07abca16e 100644 --- a/src/gui/components/maininfoareacomponent.cpp +++ b/src/gui/components/maininfoareacomponent.cpp @@ -78,7 +78,7 @@ namespace swift::gui::components QSize CMainInfoAreaComponent::getPreferredSizeWhenFloating(int areaIndex) const { - const InfoArea area = static_cast(areaIndex); + const auto area = static_cast(areaIndex); switch (area) { case InfoAreaCockpit: @@ -111,7 +111,7 @@ namespace swift::gui::components const QPixmap &CMainInfoAreaComponent::indexToPixmap(int areaIndex) const { - const InfoArea area = static_cast(areaIndex); + const auto area = static_cast(areaIndex); switch (area) { case InfoAreaCockpit: return CIcons::appCockpit16(); diff --git a/src/gui/components/mainkeypadareacomponent.cpp b/src/gui/components/mainkeypadareacomponent.cpp index 857869dccc..54573393c1 100644 --- a/src/gui/components/mainkeypadareacomponent.cpp +++ b/src/gui/components/mainkeypadareacomponent.cpp @@ -113,7 +113,7 @@ namespace swift::gui::components void CMainKeypadAreaComponent::buttonSelected() { if (!sGui || sGui->isShuttingDown()) { return; } - QPushButton *senderButton = static_cast(QObject::sender()); + auto *senderButton = static_cast(QObject::sender()); Q_ASSERT_X(senderButton, Q_FUNC_INFO, "No sender button"); if (!senderButton) { return; } const CMainInfoAreaComponent::InfoArea infoArea = buttonToMainInfoArea(senderButton); diff --git a/src/gui/components/mappingcomponent.cpp b/src/gui/components/mappingcomponent.cpp index f10c295910..6fc561cc83 100644 --- a/src/gui/components/mappingcomponent.cpp +++ b/src/gui/components/mappingcomponent.cpp @@ -239,7 +239,7 @@ namespace swift::gui::components void CMappingComponent::onChangedSimulatedAircraftInView(const CVariant &object, const CPropertyIndex &index) { if (!index.contains(CSimulatedAircraft::IndexEnabled)) { return; } // we only deal with enabled/disabled here - const CSimulatedAircraft sa = object.to(); // changed in GUI + const auto sa = object.to(); // changed in GUI const CSimulatedAircraft saFromBackend = sGui->getIContextNetwork()->getAircraftInRangeForCallsign(sa.getCallsign()); if (!saFromBackend.hasValidCallsign()) { return; } // obviously deleted @@ -520,7 +520,7 @@ namespace swift::gui::components void CMappingComponent::onTabWidgetChanged(int index) { Q_UNUSED(index); - const TabWidget w = static_cast(index); + const auto w = static_cast(index); const bool show = (w == TabAircraftModels) || (w == TabRenderedAircraft); this->showAircraftModelDetails(show); } diff --git a/src/gui/components/marginsinput.cpp b/src/gui/components/marginsinput.cpp index 53ff6f982f..0b6f2f91b0 100644 --- a/src/gui/components/marginsinput.cpp +++ b/src/gui/components/marginsinput.cpp @@ -20,7 +20,7 @@ namespace swift::gui::components connect(ui->le_Right, &QLineEdit::returnPressed, this, &CMarginsInput::confirmed); connect(ui->le_Top, &QLineEdit::returnPressed, this, &CMarginsInput::confirmed); - QIntValidator *v = new QIntValidator(0, 100, this); + auto *v = new QIntValidator(0, 100, this); ui->le_Bottom->setValidator(v); ui->le_Left->setValidator(v); ui->le_Right->setValidator(v); diff --git a/src/gui/components/modelmatchercomponent.cpp b/src/gui/components/modelmatchercomponent.cpp index 61adff8a40..0e1c443d1f 100644 --- a/src/gui/components/modelmatchercomponent.cpp +++ b/src/gui/components/modelmatchercomponent.cpp @@ -214,7 +214,7 @@ namespace swift::gui::components { if (!m_settingsDialog) { m_settingsDialog = new CSettingsMatchingDialog(this); } m_settingsDialog->setMatchingSetup(m_matcher.getSetup()); - const QDialog::DialogCode r = static_cast(m_settingsDialog->exec()); + const auto r = static_cast(m_settingsDialog->exec()); if (r == QDialog::Accepted) { m_matcher.setSetup(m_settingsDialog->getMatchingSetup()); } } diff --git a/src/gui/components/navigatordialog.cpp b/src/gui/components/navigatordialog.cpp index 3ee0477d6b..ff0825442b 100644 --- a/src/gui/components/navigatordialog.cpp +++ b/src/gui/components/navigatordialog.cpp @@ -89,7 +89,7 @@ namespace swift::gui::components CGuiUtility::deleteLayout(ui->fr_NavigatorDialogInner->layout(), false); // new layout - QGridLayout *gridLayout = new QGridLayout(ui->fr_NavigatorDialogInner); + auto *gridLayout = new QGridLayout(ui->fr_NavigatorDialogInner); gridLayout->setObjectName("gl_CNavigatorDialog"); gridLayout->setSpacing(0); gridLayout->setContentsMargins(0, 0, 0, 0); @@ -101,7 +101,7 @@ namespace swift::gui::components for (QAction *action : this->actions()) { if (!action) { continue; } - QToolButton *tb = new QToolButton(ui->fr_NavigatorDialogInner); + auto *tb = new QToolButton(ui->fr_NavigatorDialogInner); tb->setDefaultAction(action); tb->setObjectName(this->objectName() % u':' % action->objectName()); if (!action->text().isEmpty()) { tb->setToolTip(action->text()); } @@ -266,7 +266,7 @@ namespace swift::gui::components void CNavigatorDialog::changeLayout() { - QAction *a = qobject_cast(QObject::sender()); + auto *a = qobject_cast(QObject::sender()); if (!a) { return; } QString v(a->data().toString()); if (v == "1c") { buildNavigator(1); } diff --git a/src/gui/components/networkdetailscomponent.cpp b/src/gui/components/networkdetailscomponent.cpp index 01f7a7359e..f564da719c 100644 --- a/src/gui/components/networkdetailscomponent.cpp +++ b/src/gui/components/networkdetailscomponent.cpp @@ -43,7 +43,7 @@ namespace swift::gui::components constexpr int MaxLength = 10; constexpr int MinLength = 0; - CUpperCaseValidator *ucv = new CUpperCaseValidator(MinLength, MaxLength, ui->le_PartnerCallsign); + auto *ucv = new CUpperCaseValidator(MinLength, MaxLength, ui->le_PartnerCallsign); ucv->setAllowedCharacters09AZ(); ui->le_PartnerCallsign->setMaxLength(MaxLength); ui->le_PartnerCallsign->setValidator(ucv); diff --git a/src/gui/components/otherswiftversionscomponent.cpp b/src/gui/components/otherswiftversionscomponent.cpp index 99df32a00d..aac00a3e7e 100644 --- a/src/gui/components/otherswiftversionscomponent.cpp +++ b/src/gui/components/otherswiftversionscomponent.cpp @@ -68,7 +68,7 @@ namespace swift::gui::components void COtherSwiftVersionsComponent::onObjectSelected(const CVariant &object) { if (!object.canConvert()) { return; } - const CApplicationInfo info(object.value()); + const auto info(object.value()); emit this->versionChanged(info); } } // namespace swift::gui::components diff --git a/src/gui/components/ownaircraftcomponent.cpp b/src/gui/components/ownaircraftcomponent.cpp index e897cbdeaf..87be26428c 100644 --- a/src/gui/components/ownaircraftcomponent.cpp +++ b/src/gui/components/ownaircraftcomponent.cpp @@ -48,7 +48,7 @@ namespace swift::gui::components constexpr int MaxLength = 10; constexpr int MinLength = 0; - CUpperCaseValidator *ucv = new CUpperCaseValidator(MinLength, MaxLength, ui->le_Callsign); + auto *ucv = new CUpperCaseValidator(MinLength, MaxLength, ui->le_Callsign); ucv->setAllowedCharacters09AZ(); ui->le_Callsign->setMaxLength(MaxLength); ui->le_Callsign->setValidator(ucv); @@ -130,7 +130,7 @@ namespace swift::gui::components void COwnAircraftComponent::onSimulatorStatusChanged(int status) { - ISimulator::SimulatorStatus s = static_cast(status); + auto s = static_cast(status); Q_UNUSED(s); if (!this->hasValidContexts()) { return; } if (sGui->getIContextNetwork()->isConnected()) diff --git a/src/gui/components/radarcomponent.cpp b/src/gui/components/radarcomponent.cpp index 08b76381fa..975f2b9d12 100644 --- a/src/gui/components/radarcomponent.cpp +++ b/src/gui/components/radarcomponent.cpp @@ -87,11 +87,11 @@ namespace swift::gui::components { QPen pen(Qt::white, 1); pen.setCosmetic(true); - QGraphicsLineItem *lix = new QGraphicsLineItem { QLineF(-5.0, 0.0, 5.0, 0.0), &m_center }; + auto *lix = new QGraphicsLineItem { QLineF(-5.0, 0.0, 5.0, 0.0), &m_center }; lix->setFlags(QGraphicsItem::ItemIgnoresTransformations); lix->setPen(pen); - QGraphicsLineItem *liy = new QGraphicsLineItem(QLineF(0.0, -5.0, 0.0, 5.0), &m_center); + auto *liy = new QGraphicsLineItem(QLineF(0.0, -5.0, 0.0, 5.0), &m_center); liy->setFlags(QGraphicsItem::ItemIgnoresTransformations); liy->setPen(pen); } @@ -104,8 +104,7 @@ namespace swift::gui::components // Macro graticule, drawn as full line at every 10 nm for (int range = 10; range <= 100; range += 10) { - QGraphicsEllipseItem *circle = - new QGraphicsEllipseItem(-range, -range, 2.0 * range, 2.0 * range, &m_macroGraticule); + auto *circle = new QGraphicsEllipseItem(-range, -range, 2.0 * range, 2.0 * range, &m_macroGraticule); circle->setPen(pen); } pen = QPen(Qt::gray, 1, Qt::DashLine); @@ -114,7 +113,7 @@ namespace swift::gui::components // Micro graticule, drawn as dash line at every 2.5 nm for (qreal range = 1; range <= 3; ++range) { - QGraphicsEllipseItem *circle = + auto *circle = new QGraphicsEllipseItem(-range * 2.5, -range * 2.5, 5.0 * range, 5.0 * range, &m_microGraticule); circle->setPen(pen); } @@ -128,7 +127,7 @@ namespace swift::gui::components for (int angle = 0; angle < 360; angle += 30) { const QLineF line({ 0.0, 0.0 }, polarPoint(1000.0, qDegreesToRadians(static_cast(angle)))); - QGraphicsLineItem *li = new QGraphicsLineItem(line, &m_radials); + auto *li = new QGraphicsLineItem(line, &m_radials); li->setFlags(QGraphicsItem::ItemIgnoresTransformations); li->setPen(pen); } @@ -153,13 +152,13 @@ namespace swift::gui::components QPointF position(polarPoint(distanceNM, bearingRad)); - QGraphicsEllipseItem *dot = new QGraphicsEllipseItem(-2.0, -2.0, 4.0, 4.0, &m_radarTargets); + auto *dot = new QGraphicsEllipseItem(-2.0, -2.0, 4.0, 4.0, &m_radarTargets); dot->setPos(position); dot->setPen(m_radarTargetPen); dot->setBrush(m_radarTargetPen.color()); dot->setFlags(QGraphicsItem::ItemIgnoresTransformations); - QGraphicsTextItem *tag = new QGraphicsTextItem(&m_radarTargets); + auto *tag = new QGraphicsTextItem(&m_radarTargets); QString tagText; if (ui->cb_Callsign->isChecked()) { tagText += sa.getCallsignAsString() % u"\n"; } if (ui->cb_Altitude->isChecked()) @@ -184,7 +183,7 @@ namespace swift::gui::components const double headingRad = sa.getHeading().value(CAngleUnit::rad()); QPen pen(Qt::green, 1); pen.setCosmetic(true); - QGraphicsLineItem *li = + auto *li = new QGraphicsLineItem(QLineF({ 0.0, 0.0 }, polarPoint(5.0, headingRad)), &m_radarTargets); li->setPos(position); li->setPen(pen); diff --git a/src/gui/components/rawfsdmessagescomponent.cpp b/src/gui/components/rawfsdmessagescomponent.cpp index b1eb77f8e8..fbd02fddff 100644 --- a/src/gui/components/rawfsdmessagescomponent.cpp +++ b/src/gui/components/rawfsdmessagescomponent.cpp @@ -198,8 +198,7 @@ namespace swift::gui::components void CRawFsdMessagesComponent::changeFileWritingMode() { - const CRawFsdMessageSettings::FileWriteMode mode = - ui->cb_FileWritingMode->currentData().value(); + const auto mode = ui->cb_FileWritingMode->currentData().value(); m_setting.setProperty(vatsim::CRawFsdMessageSettings::IndexFileWriteMode, CVariant::fromValue(mode)); } diff --git a/src/gui/components/settingshotkeycomponent.cpp b/src/gui/components/settingshotkeycomponent.cpp index e0a2e83b7a..92f2630728 100644 --- a/src/gui/components/settingshotkeycomponent.cpp +++ b/src/gui/components/settingshotkeycomponent.cpp @@ -93,8 +93,7 @@ namespace swift::gui::components const QModelIndex indexHotkey = model->index(index.row(), 0, QModelIndex()); Q_ASSERT_X(indexHotkey.data(CActionHotkeyListModel::ActionHotkeyRole).canConvert(), Q_FUNC_INFO, "No action hotkey"); - const CActionHotkey actionHotkey = - indexHotkey.data(CActionHotkeyListModel::ActionHotkeyRole).value(); + const auto actionHotkey = indexHotkey.data(CActionHotkeyListModel::ActionHotkeyRole).value(); const CActionHotkey selectedActionHotkey = CHotkeyDialog::getActionHotkey(actionHotkey, getAllIdentifiers(), this); if (selectedActionHotkey.isValid() && checkAndConfirmConflicts(selectedActionHotkey, { actionHotkey })) @@ -115,8 +114,7 @@ namespace swift::gui::components const QModelIndexList indexes = ui->tv_Hotkeys->selectionModel()->selectedRows(); for (const auto &index : indexes) { - const CActionHotkey actionHotkey = - index.data(CActionHotkeyListModel::ActionHotkeyRole).value(); + const auto actionHotkey = index.data(CActionHotkeyListModel::ActionHotkeyRole).value(); removeHotkeyFromSettings(actionHotkey); m_model.removeRows(index.row(), 1, QModelIndex()); } @@ -213,7 +211,7 @@ namespace swift::gui::components { if (keyDown) { - QMessageBox *msgBox = new QMessageBox(this); + auto *msgBox = new QMessageBox(this); msgBox->setAttribute(Qt::WA_DeleteOnClose); msgBox->setStandardButtons(QMessageBox::Ok); msgBox->setWindowTitle("Test"); diff --git a/src/gui/components/settingssimulatorcomponent.cpp b/src/gui/components/settingssimulatorcomponent.cpp index 4c87ccb36c..6d04a9580e 100644 --- a/src/gui/components/settingssimulatorcomponent.cpp +++ b/src/gui/components/settingssimulatorcomponent.cpp @@ -377,7 +377,7 @@ namespace swift::gui::components const CSimulatorPluginInfo selected = simDrivers.findByIdentifier(identifier); const QString configId = m_plugins->getPluginConfigId(selected.getIdentifier()); - IPluginConfig *config = m_plugins->getPluginById(configId); + auto *config = m_plugins->getPluginById(configId); SWIFT_VERIFY_X(config, Q_FUNC_INFO, "Missing config"); if (!config) { return; } diff --git a/src/gui/components/settingstextmessagestyle.cpp b/src/gui/components/settingstextmessagestyle.cpp index fddadb1272..47d839cbbf 100644 --- a/src/gui/components/settingstextmessagestyle.cpp +++ b/src/gui/components/settingstextmessagestyle.cpp @@ -54,7 +54,7 @@ namespace swift::gui::components m_fontSettingsDialog->setWithColorSelection(false); } - const QDialog::DialogCode r = static_cast(m_fontSettingsDialog->exec()); + const auto r = static_cast(m_fontSettingsDialog->exec()); if (r == QDialog::Accepted) { const QStringList familySizeStyle = this->getFamilySizeStyle(); @@ -72,7 +72,7 @@ namespace swift::gui::components } m_textEditDialog->textEdit()->setPlainText(m_style); - const QDialog::DialogCode r = static_cast(m_textEditDialog->exec()); + const auto r = static_cast(m_textEditDialog->exec()); if (r == QDialog::Accepted) { m_style = m_textEditDialog->textEdit()->toPlainText(); diff --git a/src/gui/components/simulatorcomponent.cpp b/src/gui/components/simulatorcomponent.cpp index aa0b0d6e3a..332d3c158a 100644 --- a/src/gui/components/simulatorcomponent.cpp +++ b/src/gui/components/simulatorcomponent.cpp @@ -214,7 +214,7 @@ namespace swift::gui::components void CSimulatorComponent::onSimulatorStatusChanged(int status) { - ISimulator::SimulatorStatus simStatus = static_cast(status); + auto simStatus = static_cast(status); this->clear(); // clean up, will be refreshed if (simStatus.testFlag(ISimulator::Connected)) { diff --git a/src/gui/components/statusmessagesdetail.cpp b/src/gui/components/statusmessagesdetail.cpp index 53abba683b..355decb534 100644 --- a/src/gui/components/statusmessagesdetail.cpp +++ b/src/gui/components/statusmessagesdetail.cpp @@ -121,7 +121,7 @@ namespace swift::gui::components void CStatusMessagesDetail::CMessageMenu::customMenu(CMenuActions &menuActions) { - CStatusMessagesDetail *messagesDetail = qobject_cast(this->parent()); + auto *messagesDetail = qobject_cast(this->parent()); Q_ASSERT_X(messagesDetail, Q_FUNC_INFO, "Missing parent"); const bool v = messagesDetail->ui->form_StatusMessage->isVisible(); diff --git a/src/gui/components/textmessagecomponent.cpp b/src/gui/components/textmessagecomponent.cpp index b9914cbd5c..87c24172c2 100644 --- a/src/gui/components/textmessagecomponent.cpp +++ b/src/gui/components/textmessagecomponent.cpp @@ -477,12 +477,12 @@ namespace swift::gui::components const QString tabName = callsign.asString(); const QString style = this->getStyleSheet(); const bool supervisor = callsign.isSupervisorCallsign(); - QWidget *newTabWidget = new QWidget(this); + auto *newTabWidget = new QWidget(this); newTabWidget->setObjectName(u"Tab widget " % tabName); newTabWidget->setProperty("callsign", callsign.asString()); - QPushButton *closeButton = new QPushButton("Close", newTabWidget); - QVBoxLayout *layout = new QVBoxLayout(newTabWidget); - CTextMessageTextEdit *textEdit = new CTextMessageTextEdit(newTabWidget); + auto *closeButton = new QPushButton("Close", newTabWidget); + auto *layout = new QVBoxLayout(newTabWidget); + auto *textEdit = new CTextMessageTextEdit(newTabWidget); textEdit->setObjectName("tep_" + tabName); int marginLeft, marginRight, marginTop, marginBottom; ui->tb_TextMessagesAll->layout()->getContentsMargins(&marginLeft, &marginTop, &marginRight, &marginBottom); @@ -495,7 +495,7 @@ namespace swift::gui::components textEdit->setStyleSheetForContent(style); const int index = ui->tw_TextMessages->addTab(newTabWidget, this->getCallsignAndRealName(callsign)); - QToolButton *closeButtonInTab = new QToolButton(newTabWidget); + auto *closeButtonInTab = new QToolButton(newTabWidget); closeButtonInTab->setText("[X]"); closeButtonInTab->setProperty("supervisormsg", supervisor); QTabBar *bar = ui->tw_TextMessages->tabBar(); @@ -570,7 +570,7 @@ namespace swift::gui::components const QWidget *tab = this->findTextMessageTabByCallsign(cs); if (!tab) { tab = this->addNewTextMessageTab(cs); } Q_ASSERT_X(tab, Q_FUNC_INFO, "Missing tab"); - CTextMessageTextEdit *textEdit = tab->findChild(); + auto *textEdit = tab->findChild(); SWIFT_VERIFY_X(textEdit, Q_FUNC_INFO, "Missing text edit"); if (!textEdit) { return; } // do not crash, though this situation should not happen textEdit->insertTextMessage(textMessage); diff --git a/src/gui/dockwidget.cpp b/src/gui/dockwidget.cpp index 610c82f283..1bd3568e21 100644 --- a/src/gui/dockwidget.cpp +++ b/src/gui/dockwidget.cpp @@ -520,7 +520,7 @@ namespace swift::gui } // Inner widget is supposed to be a QFrame / promoted QFrame - QFrame *innerWidget = qobject_cast( + auto *innerWidget = qobject_cast( outerWidget->layout()->itemAt(0)->widget()); // the inner widget containing the layout Q_ASSERT_X(innerWidget, "CDockWidget::initStatusBar", "No inner widget"); if (!innerWidget) @@ -535,7 +535,7 @@ namespace swift::gui m_statusBar.initStatusBar(); // layout - QVBoxLayout *vLayout = qobject_cast(innerWidget->layout()); + auto *vLayout = qobject_cast(innerWidget->layout()); Q_ASSERT_X(vLayout, "CDockWidget::initStatusBar", "No outer widget layout"); if (!vLayout) { @@ -546,7 +546,7 @@ namespace swift::gui // adjust stretching of the original widget. It was the only widget so far // and should occupy maximum space - QWidget *compWidget = innerWidget->findChild(QString(), Qt::FindDirectChildrenOnly); + auto *compWidget = innerWidget->findChild(QString(), Qt::FindDirectChildrenOnly); Q_ASSERT(compWidget); if (!compWidget) { return; } QSizePolicy sizePolicy = compWidget->sizePolicy(); diff --git a/src/gui/dockwidgetinfoarea.cpp b/src/gui/dockwidgetinfoarea.cpp index 6aa5dbfbce..7e06e4b86a 100644 --- a/src/gui/dockwidgetinfoarea.cpp +++ b/src/gui/dockwidgetinfoarea.cpp @@ -22,14 +22,14 @@ namespace swift::gui const CInfoArea *CDockWidgetInfoArea::getParentInfoArea() const { - const CInfoArea *ia = qobject_cast(this->parent()); + const auto *ia = qobject_cast(this->parent()); Q_ASSERT(ia); return ia; } CInfoArea *CDockWidgetInfoArea::getParentInfoArea() { - CInfoArea *ia = qobject_cast(this->parent()); + auto *ia = qobject_cast(this->parent()); Q_ASSERT(ia); return ia; } @@ -105,7 +105,7 @@ namespace swift::gui Q_ASSERT(w); // CEnableForDockWidgetInfoArea is no QObject, so we use dynamic_cast - CEnableForDockWidgetInfoArea *dwc = dynamic_cast(w); + auto *dwc = dynamic_cast(w); if (dwc) { widgetsWithDockWidgetInfoAreaComponent.append(dwc); } } QList nestedInfoAreas = this->findNestedInfoAreas(); diff --git a/src/gui/editors/aircrafticaoform.cpp b/src/gui/editors/aircrafticaoform.cpp index 64c69a1d29..d84eb56927 100644 --- a/src/gui/editors/aircrafticaoform.cpp +++ b/src/gui/editors/aircrafticaoform.cpp @@ -90,7 +90,7 @@ namespace swift::gui::editors CVariant jsonVariant; jsonVariant.convertFromJson(json::jsonObjectFromString(json)); if (!jsonVariant.canConvert()) { return; } - const CAircraftIcaoCodeList icaos = jsonVariant.value(); + const auto icaos = jsonVariant.value(); if (!icaos.isEmpty()) { this->setValue(icaos.front()); } } catch (const CJsonException &ex) @@ -196,7 +196,7 @@ namespace swift::gui::editors if (variantDropped.canConvert()) { icao = variantDropped.value(); } else if (variantDropped.canConvert()) { - const CAircraftIcaoCodeList icaoList(variantDropped.value()); + const auto icaoList(variantDropped.value()); if (icaoList.isEmpty()) { return; } icao = icaoList.front(); } diff --git a/src/gui/editors/airlineicaoform.cpp b/src/gui/editors/airlineicaoform.cpp index 30cd3f4999..83c73651c7 100644 --- a/src/gui/editors/airlineicaoform.cpp +++ b/src/gui/editors/airlineicaoform.cpp @@ -161,7 +161,7 @@ namespace swift::gui::editors CVariant jsonVariant; jsonVariant.convertFromJson(json::jsonObjectFromString(json)); if (!jsonVariant.canConvert()) { return; } - const CAirlineIcaoCodeList icaos = jsonVariant.value(); + const auto icaos = jsonVariant.value(); if (!icaos.isEmpty()) { this->setValue(icaos.front()); } } catch (const CJsonException &ex) @@ -176,7 +176,7 @@ namespace swift::gui::editors if (variantDropped.canConvert()) { icao = variantDropped.value(); } else if (variantDropped.canConvert()) { - const CAirlineIcaoCodeList icaoList(variantDropped.value()); + const auto icaoList(variantDropped.value()); if (icaoList.isEmpty()) { return; } icao = icaoList.front(); } diff --git a/src/gui/editors/distributorform.cpp b/src/gui/editors/distributorform.cpp index dcceed0dd5..6abb1220ba 100644 --- a/src/gui/editors/distributorform.cpp +++ b/src/gui/editors/distributorform.cpp @@ -115,7 +115,7 @@ namespace swift::gui::editors if (variantDropped.canConvert()) { distributor = variantDropped.value(); } else if (variantDropped.canConvert()) { - const CDistributorList icaoList(variantDropped.value()); + const auto icaoList(variantDropped.value()); if (icaoList.isEmpty()) { return; } distributor = icaoList.front(); } diff --git a/src/gui/editors/liveryform.cpp b/src/gui/editors/liveryform.cpp index 274a187b37..133ca4103b 100644 --- a/src/gui/editors/liveryform.cpp +++ b/src/gui/editors/liveryform.cpp @@ -117,7 +117,7 @@ namespace swift::gui::editors CVariant jsonVariant; jsonVariant.convertFromJson(json::jsonObjectFromString(json)); if (!jsonVariant.canConvert()) { return; } - const CLiveryList liveries = jsonVariant.value(); + const auto liveries = jsonVariant.value(); if (!liveries.isEmpty()) { this->setValue(liveries.front()); } } catch (const CJsonException &ex) @@ -193,7 +193,7 @@ namespace swift::gui::editors if (variantDropped.canConvert()) { livery = variantDropped.value(); } else if (variantDropped.canConvert()) { - CLiveryList liveryList(variantDropped.value()); + auto liveryList(variantDropped.value()); if (liveryList.isEmpty()) { return; } livery = liveryList.front(); } @@ -229,7 +229,7 @@ namespace swift::gui::editors m_colorSearch = new CDbLiveryColorSearchDialog(this); m_colorSearch->setModal(true); } - const QDialog::DialogCode c = static_cast(m_colorSearch->exec()); + const auto c = static_cast(m_colorSearch->exec()); if (c == QDialog::Rejected) { return; } const CLivery found = m_colorSearch->getLivery(); if (found.isLoadedFromDb()) { this->setValue(found); } diff --git a/src/gui/editors/modelmappingform.cpp b/src/gui/editors/modelmappingform.cpp index cbf3c87d23..d9f62362bf 100644 --- a/src/gui/editors/modelmappingform.cpp +++ b/src/gui/editors/modelmappingform.cpp @@ -32,7 +32,7 @@ namespace swift::gui::editors ui->le_Id->setReadOnly(true); ui->le_Parts->setPlaceholderText("Allowed: " + CAircraftModel::supportedParts()); ui->lai_Id->set(CIcons::appMappings16(), "Id:"); - CUpperCaseValidator *uc = new CUpperCaseValidator(0, 5, ui->le_Parts); + auto *uc = new CUpperCaseValidator(0, 5, ui->le_Parts); uc->setAllowedCharacters(CAircraftModel::supportedParts()); ui->le_Parts->setValidator(uc); diff --git a/src/gui/editors/modelmappingmodifyform.cpp b/src/gui/editors/modelmappingmodifyform.cpp index 1862c50f0a..947163b90e 100644 --- a/src/gui/editors/modelmappingmodifyform.cpp +++ b/src/gui/editors/modelmappingmodifyform.cpp @@ -32,8 +32,7 @@ namespace swift::gui::editors ui->le_Parts->setPlaceholderText("Parts " + CAircraftModel::supportedParts()); this->userChanged(); - CUpperCaseValidator *ucv = - new CUpperCaseValidator(true, 0, CAircraftModel::supportedParts().size(), ui->le_Parts); + auto *ucv = new CUpperCaseValidator(true, 0, CAircraftModel::supportedParts().size(), ui->le_Parts); ucv->setAllowedCharacters(CAircraftModel::supportedParts()); ui->le_Parts->setValidator(ucv); diff --git a/src/gui/editors/serverform.cpp b/src/gui/editors/serverform.cpp index 7dc2b617ca..fe35a15dae 100644 --- a/src/gui/editors/serverform.cpp +++ b/src/gui/editors/serverform.cpp @@ -96,7 +96,7 @@ namespace swift::gui::editors ui->cb_ServerType->clear(); for (const int type : CServer::allServerTypes()) { - const CServer::ServerType st = static_cast(type); + const auto st = static_cast(type); ui->cb_ServerType->insertItem(c++, CServer::serverTypeToString(st), QVariant::fromValue(type)); } } diff --git a/src/gui/enableforframelesswindow.cpp b/src/gui/enableforframelesswindow.cpp index dd7ac80bb4..a74fafd918 100644 --- a/src/gui/enableforframelesswindow.cpp +++ b/src/gui/enableforframelesswindow.cpp @@ -292,7 +292,7 @@ namespace swift::gui Qt::QueuedConnection); } - QHBoxLayout *menuBarLayout = new QHBoxLayout; + auto *menuBarLayout = new QHBoxLayout; menuBarLayout->setObjectName("hl_MenuBar"); menuBarLayout->addWidget(menuBar, 0, Qt::AlignTop | Qt::AlignLeft); menuBarLayout->addWidget(m_framelessCloseButton, 0, Qt::AlignTop | Qt::AlignRight); diff --git a/src/gui/eventfilter.cpp b/src/gui/eventfilter.cpp index a0858ac2f2..9a9f2e938a 100644 --- a/src/gui/eventfilter.cpp +++ b/src/gui/eventfilter.cpp @@ -14,13 +14,13 @@ namespace swift::gui { if (event->type() == QEvent::KeyPress) { - if (QKeyEvent *e = dynamic_cast(event)) + if (auto *e = dynamic_cast(event)) { // If QKeyEvent::text() returns an empty QString then let normal // processing proceed as it may be a control (e.g. cursor movement) // key. Otherwise convert the text to upper case and insert it at // the current cursor position. - QPlainTextEdit *pte = qobject_cast(object); + auto *pte = qobject_cast(object); if (!pte) { return false; } if (pte->isReadOnly()) { return false; } diff --git a/src/gui/filters/aircraftmodelfilterbar.cpp b/src/gui/filters/aircraftmodelfilterbar.cpp index bc9d36e658..0346b188df 100644 --- a/src/gui/filters/aircraftmodelfilterbar.cpp +++ b/src/gui/filters/aircraftmodelfilterbar.cpp @@ -41,7 +41,7 @@ namespace swift::gui::filters ui->comp_DistributorSelector->withDistributorDescription(false); this->setButtonsAndCount(ui->filter_Buttons); - CUpperCaseValidator *ucv = new CUpperCaseValidator(this); + auto *ucv = new CUpperCaseValidator(this); ui->le_AircraftIcao->setValidator(ucv); ui->le_AirlineIcao->setValidator(ucv); ui->le_ModelString->setValidator(ucv); diff --git a/src/gui/filters/countryfilterbar.cpp b/src/gui/filters/countryfilterbar.cpp index b679e80afa..bcadce0683 100644 --- a/src/gui/filters/countryfilterbar.cpp +++ b/src/gui/filters/countryfilterbar.cpp @@ -25,7 +25,7 @@ namespace swift::gui::filters connect(ui->le_IsoCode, &QLineEdit::returnPressed, this, &CFilterWidget::triggerFilter); connect(ui->le_Name, &QLineEdit::returnPressed, this, &CFilterWidget::triggerFilter); - CUpperCaseValidator *ucv = new CUpperCaseValidator(this); + auto *ucv = new CUpperCaseValidator(this); ui->le_IsoCode->setValidator(ucv); // reset form diff --git a/src/gui/guiactionbind.cpp b/src/gui/guiactionbind.cpp index 71a7d74c70..9b33536852 100644 --- a/src/gui/guiactionbind.cpp +++ b/src/gui/guiactionbind.cpp @@ -40,7 +40,7 @@ namespace swift::gui if (action->menu()) { CGuiActionBindHandler::bindMenu(action->menu(), pathNew); } const bool hasIcon = !action->icon().isNull(); - CGuiActionBindHandler *bindHandler = new CGuiActionBindHandler(action); + auto *bindHandler = new CGuiActionBindHandler(action); // MS 2019-10-08 [AFV integration] CActionBind constructor needs an icon index, not a QPixmap // CActionBinding actionBinding(CActionBinding::create(pathNew, hasIcon ? // action->icon().pixmap(CIcons::empty16().size()) : CIcons::empty16(), bindHandler, @@ -63,7 +63,7 @@ namespace swift::gui absoluteName ? path : CGuiActionBindHandler::appendPath(path, button->text()).remove('&'); // remove E&xit key codes - CGuiActionBindHandler *bindHandler = new CGuiActionBindHandler(button); + auto *bindHandler = new CGuiActionBindHandler(button); const bool hasIcon = !button->icon().isNull(); // MS 2019-10-08 [AFV integration] CActionBind constructor needs an icon index, not a QPixmap // CActionBinding actionBinding(CActionBinding::create(pathNew, hasIcon ? diff --git a/src/gui/guiutility.cpp b/src/gui/guiutility.cpp index 402d8e7da6..2072c2bfe6 100644 --- a/src/gui/guiutility.cpp +++ b/src/gui/guiutility.cpp @@ -58,7 +58,7 @@ namespace swift::gui for (QWidget *w : tlw) { // best choice is to check on frameless window - CEnableForFramelessWindow *mw = dynamic_cast(w); + auto *mw = dynamic_cast(w); if (!mw) { continue; } if (mw->isMainApplicationWindow()) { return mw; } } @@ -76,7 +76,7 @@ namespace swift::gui const QWidgetList tlw = CGuiUtility::topLevelApplicationWidgetsWithName(); for (QWidget *w : tlw) { - QMainWindow *qmw = qobject_cast(w); + auto *qmw = qobject_cast(w); if (!qmw) { continue; } if (!qmw->parentWidget()) { return qmw; } } @@ -562,7 +562,7 @@ namespace swift::gui do { widget = widget->parentWidget(); if (!widget) { return nullptr; } - QTabWidget *tw = qobject_cast(widget); + auto *tw = qobject_cast(widget); if (tw) { return tw; } level++; } @@ -671,14 +671,14 @@ namespace swift::gui bool CGuiUtility::isQMainWindow(const QWidget *widget) { if (!widget) { return false; } - const QMainWindow *mw = qobject_cast(widget); + const auto *mw = qobject_cast(widget); return mw; } bool CGuiUtility::isDialog(const QWidget *widget) { if (!widget) { return false; } - const QDialog *mw = qobject_cast(widget); + const auto *mw = qobject_cast(widget); return mw; } @@ -698,9 +698,9 @@ namespace swift::gui { // http://stackoverflow.com/questions/19087822/how-to-make-qt-widgets-fade-in-or-fade-out# Q_ASSERT(widget); - QGraphicsOpacityEffect *effect = new QGraphicsOpacityEffect(widget); + auto *effect = new QGraphicsOpacityEffect(widget); widget->setGraphicsEffect(effect); - QPropertyAnimation *a = new QPropertyAnimation(effect, "opacity"); + auto *a = new QPropertyAnimation(effect, "opacity"); a->setDuration(durationMs); a->setStartValue(startValue); a->setEndValue(endValue); @@ -713,9 +713,9 @@ namespace swift::gui double endValue) { Q_ASSERT(widget); - QGraphicsOpacityEffect *effect = new QGraphicsOpacityEffect(widget); + auto *effect = new QGraphicsOpacityEffect(widget); widget->setGraphicsEffect(effect); - QPropertyAnimation *a = new QPropertyAnimation(effect, "opacity"); + auto *a = new QPropertyAnimation(effect, "opacity"); a->setDuration(durationMs); a->setStartValue(startValue); a->setEndValue(endValue); diff --git a/src/gui/guiutility.h b/src/gui/guiutility.h index 16e54d0450..5cb585dfe7 100644 --- a/src/gui/guiutility.h +++ b/src/gui/guiutility.h @@ -136,7 +136,7 @@ namespace swift::gui static OverlayWidget *nextOverlayMessageWidget(QWidget *widget, int maxLevels = 10) { if (!widget || maxLevels < 1) { return nullptr; } - OverlayWidget *o = qobject_cast(widget); + auto *o = qobject_cast(widget); if (o) { return o; } int cl = 0; QWidget *cw = widget->parentWidget(); diff --git a/src/gui/infoarea.cpp b/src/gui/infoarea.cpp index 30ebfad768..51d83c958f 100644 --- a/src/gui/infoarea.cpp +++ b/src/gui/infoarea.cpp @@ -97,7 +97,7 @@ namespace swift::gui menu->addAction(CIcons::floatOne16(), QStringLiteral("Dock / float '%1'").arg(this->windowTitle()), this, &CInfoArea::toggleFloatingWholeInfoArea); - QAction *lockTabBarMenuAction = new QAction(menu); + auto *lockTabBarMenuAction = new QAction(menu); lockTabBarMenuAction->setObjectName(this->objectName().append("LockTabBar")); lockTabBarMenuAction->setIconText("Lock tab bar"); lockTabBarMenuAction->setIcon(CIcons::lockClosed16()); @@ -107,17 +107,17 @@ namespace swift::gui connect(lockTabBarMenuAction, &QAction::toggled, this, &CInfoArea::toggleTabBarLocked); menu->addSeparator(); - QMenu *subMenuToggleFloat = new QMenu("Toggle Float/Dock", menu); - QMenu *subMenuDisplay = new QMenu("Display", menu); - QMenu *subMenuRestore = new QMenu("Restore from settings", menu); - QMenu *subMenuResetPositions = new QMenu("Reset position", menu); + auto *subMenuToggleFloat = new QMenu("Toggle Float/Dock", menu); + auto *subMenuDisplay = new QMenu("Display", menu); + auto *subMenuRestore = new QMenu("Restore from settings", menu); + auto *subMenuResetPositions = new QMenu("Reset position", menu); subMenuRestore->setIcon(CIcons::load16()); subMenuResetPositions->setIcon(CIcons::refresh16()); subMenuRestore->addActions(this->getInfoAreaRestoreActions(subMenuRestore)); subMenuDisplay->addActions(this->getInfoAreaSelectActions(false, subMenuDisplay)); subMenuResetPositions->addActions(this->getInfoAreaResetPositionActions(subMenuResetPositions)); - QSignalMapper *signalMapperToggleFloating = new QSignalMapper(menu); + auto *signalMapperToggleFloating = new QSignalMapper(menu); bool c = false; // check connections for (int i = 0; i < m_dockWidgetInfoAreas.size(); i++) @@ -125,7 +125,7 @@ namespace swift::gui const CDockWidgetInfoArea *dw = m_dockWidgetInfoAreas.at(i); const QString t = dw->windowTitleBackup(); const QPixmap pm = this->indexToPixmap(i); - QAction *toggleFloatingMenuAction = new QAction(menu); + auto *toggleFloatingMenuAction = new QAction(menu); toggleFloatingMenuAction->setObjectName(QString(t).append("ToggleFloatingAction")); toggleFloatingMenuAction->setIconText(t); toggleFloatingMenuAction->setIcon(pm); @@ -151,7 +151,7 @@ namespace swift::gui // where and how to display tab bar menu->addSeparator(); - QAction *showMenuText = new QAction(menu); + auto *showMenuText = new QAction(menu); showMenuText->setObjectName("ShowDockedWidgetTextAction"); showMenuText->setIconText("Show tab text"); showMenuText->setIcon(CIcons::headingOne16()); @@ -161,7 +161,7 @@ namespace swift::gui connect(showMenuText, &QAction::toggled, this, &CInfoArea::showTabTexts); // auto adjust floating widgets - QAction *showTabbar = new QAction(menu); + auto *showTabbar = new QAction(menu); showTabbar->setObjectName("ShowTabBar"); showTabbar->setIconText("Show tab bar"); showTabbar->setIcon(CIcons::dockBottom16()); @@ -223,7 +223,7 @@ namespace swift::gui const QPixmap pm = this->indexToPixmap(i); const QString wt(dockWidgetInfoArea->windowTitleBackup()); static const QString keys("123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"); - QAction *action = new QAction(QIcon(pm), wt, parent); + auto *action = new QAction(QIcon(pm), wt, parent); action->setData(i); action->setObjectName(this->objectName().append(":getInfoAreaSelectActions:").append(wt)); if (withShortcut && i < keys.length()) @@ -250,7 +250,7 @@ namespace swift::gui { const QPixmap pm = this->indexToPixmap(i); const QString wt(dockWidgetInfoArea->windowTitleBackup()); - QAction *action = new QAction(QIcon(pm), wt, parent); + auto *action = new QAction(QIcon(pm), wt, parent); action->setData(i); action->setObjectName(this->objectName().append(":getInfoAreaResetPositionActions:").append(wt)); connect(action, &QAction::triggered, this, &CInfoArea::resetPositionByAction); @@ -269,7 +269,7 @@ namespace swift::gui { const QPixmap pm = this->indexToPixmap(i); const QString wt(dockWidgetInfoArea->windowTitleBackup()); - QAction *action = new QAction(QIcon(pm), wt, parent); + auto *action = new QAction(QIcon(pm), wt, parent); action->setData(i); action->setObjectName(this->objectName().append(":getInfoAreaToggleFloatingActions:").append(wt)); connect(action, &QAction::triggered, this, &CInfoArea::toggleAreaFloatingByAction, Qt::QueuedConnection); @@ -288,7 +288,7 @@ namespace swift::gui { const QPixmap pm = this->indexToPixmap(i); const QString wt(dockWidgetInfoArea->windowTitleBackup()); - QAction *action = new QAction(QIcon(pm), wt, parent); + auto *action = new QAction(QIcon(pm), wt, parent); action->setData(i); action->setObjectName(this->objectName().append(":getInfoAreaRestoreActions:").append(wt)); connect(action, &QAction::triggered, this, &CInfoArea::restoreDockWidgetInfoArea); @@ -416,7 +416,7 @@ namespace swift::gui void CInfoArea::selectAreaByAction() { const QObject *sender = QObject::sender(); - const QAction *action = qobject_cast(sender); + const auto *action = qobject_cast(sender); SWIFT_VERIFY(action); if (!action) { return; } const int index = action->data().toInt(); @@ -426,7 +426,7 @@ namespace swift::gui void CInfoArea::resetPositionByAction() { const QObject *sender = QObject::sender(); - const QAction *action = qobject_cast(sender); + const auto *action = qobject_cast(sender); SWIFT_VERIFY(action); if (!action) { return; } const int index = action->data().toInt(); @@ -436,7 +436,7 @@ namespace swift::gui void CInfoArea::toggleAreaFloatingByAction() { const QObject *sender = QObject::sender(); - const QAction *action = qobject_cast(sender); + const auto *action = qobject_cast(sender); SWIFT_VERIFY(action); if (!action) { return; } const int index = action->data().toInt(); @@ -446,7 +446,7 @@ namespace swift::gui void CInfoArea::restoreDockWidgetInfoArea() { const QObject *sender = QObject::sender(); - const QAction *action = qobject_cast(sender); + const auto *action = qobject_cast(sender); SWIFT_VERIFY(action); if (!action) { return; } const int index = action->data().toInt(); @@ -503,7 +503,7 @@ namespace swift::gui { for (CDockWidgetInfoArea *dw : std::as_const(m_dockWidgetInfoAreas)) { - Qt::DockWidgetAreas newAreas = static_cast(area); + auto newAreas = static_cast(area); Qt::DockWidgetAreas oldAreas = dw->allowedAreas(); if (oldAreas == newAreas) { continue; } dw->setAllowedAreas(newAreas); diff --git a/src/gui/menus/aircraftmodelmenus.cpp b/src/gui/menus/aircraftmodelmenus.cpp index da1440d8a3..066792992b 100644 --- a/src/gui/menus/aircraftmodelmenus.cpp +++ b/src/gui/menus/aircraftmodelmenus.cpp @@ -36,7 +36,7 @@ namespace swift::gui::menus CAircraftModelView *IAircraftModelViewMenu::modelView() const { - CAircraftModelView *mv = qobject_cast(parent()); + auto *mv = qobject_cast(parent()); Q_ASSERT_X(mv, Q_FUNC_INFO, "no view"); return mv; } diff --git a/src/gui/models/actionmodel.cpp b/src/gui/models/actionmodel.cpp index 8aa0574597..73f2c7d6d1 100644 --- a/src/gui/models/actionmodel.cpp +++ b/src/gui/models/actionmodel.cpp @@ -69,7 +69,7 @@ namespace swift::gui::models { if (!index.isValid()) { return {}; } - CActionItem *childItem = static_cast(index.internalPointer()); + auto *childItem = static_cast(index.internalPointer()); CActionItem *parentItem = childItem->getParentItem(); if (parentItem == m_rootItem.data()) { return {}; } diff --git a/src/gui/models/aircraftcategorytreemodel.cpp b/src/gui/models/aircraftcategorytreemodel.cpp index a0e15bacf0..6731fc7921 100644 --- a/src/gui/models/aircraftcategorytreemodel.cpp +++ b/src/gui/models/aircraftcategorytreemodel.cpp @@ -50,8 +50,8 @@ namespace swift::gui::models QList categoryRow; // ownership of QStandardItem is taken by model - QStandardItem *si = new QStandardItem(category.isAssignable() ? CIcons::paperPlane16() : CIcons::folder16(), - category.getLevelAndName()); + auto *si = new QStandardItem(category.isAssignable() ? CIcons::paperPlane16() : CIcons::folder16(), + category.getLevelAndName()); si->setEditable(false); categoryRow.push_back(si); diff --git a/src/gui/models/atcstationlistmodel.cpp b/src/gui/models/atcstationlistmodel.cpp index 65261ed9ad..563ebd188e 100644 --- a/src/gui/models/atcstationlistmodel.cpp +++ b/src/gui/models/atcstationlistmodel.cpp @@ -83,7 +83,7 @@ namespace swift::gui::models CAtcStationTreeModel *CAtcStationListModel::toAtcTreeModel() const { - CAtcStationTreeModel *tm = new CAtcStationTreeModel(QObject::parent()); + auto *tm = new CAtcStationTreeModel(QObject::parent()); tm->setColumns(m_columns); tm->updateContainer(this->container()); return tm; diff --git a/src/gui/models/atcstationtreemodel.cpp b/src/gui/models/atcstationtreemodel.cpp index 0f11978d0f..c8b8e5616d 100644 --- a/src/gui/models/atcstationtreemodel.cpp +++ b/src/gui/models/atcstationtreemodel.cpp @@ -49,8 +49,7 @@ namespace swift::gui::models for (const QString &suffix : std::as_const(m_suffixes)) { // ownership of QStandardItem is taken by model - QStandardItem *typeFolderFirstColumn = - new QStandardItem(CCallsign::atcSuffixToIcon(suffix).toQIcon(), suffix); + auto *typeFolderFirstColumn = new QStandardItem(CCallsign::atcSuffixToIcon(suffix).toQIcon(), suffix); typeFolderFirstColumn->setEditable(false); this->invisibleRootItem()->appendRow(typeFolderFirstColumn); diff --git a/src/gui/models/columnformatters.cpp b/src/gui/models/columnformatters.cpp index 6c2e5a8c18..77f5f367ea 100644 --- a/src/gui/models/columnformatters.cpp +++ b/src/gui/models/columnformatters.cpp @@ -48,7 +48,7 @@ namespace swift::gui::models CVariant CDefaultFormatter::decorationRole(const CVariant &dataCVariant) const { // direct return if type is already correct - const QMetaType::Type type = static_cast(dataCVariant.type()); + const auto type = static_cast(dataCVariant.type()); if (type == QMetaType::QPixmap) { return dataCVariant; } if (type == QMetaType::QIcon) { return dataCVariant; } @@ -56,14 +56,14 @@ namespace swift::gui::models // convert to pixmap if (type == QMetaType::QImage) { - const QImage img = dataCVariant.value(); + const auto img = dataCVariant.value(); return CVariant::from(QPixmap::fromImage(img)); } // Our CIcon class if (dataCVariant.canConvert()) { - const CIcon i = dataCVariant.value(); + const auto i = dataCVariant.value(); return CVariant::from(i.toPixmap()); } @@ -96,7 +96,7 @@ namespace swift::gui::models CVariant CDefaultFormatter::data(int role, const CVariant &inputData) const { if (!this->supportsRole(role)) { return CVariant(); } - const Qt::ItemDataRole roleEnum = static_cast(role); + const auto roleEnum = static_cast(role); // always supported if (roleEnum == Qt::TextAlignmentRole) return { alignmentRole() }; @@ -149,7 +149,7 @@ namespace swift::gui::models if (dataCVariant.isNull()) { return {}; } if (dataCVariant.canConvert()) { - const CIcon icon = dataCVariant.value(); + const auto icon = dataCVariant.value(); return icon.getDescriptiveText(); } return emptyStringVariant(); @@ -163,7 +163,7 @@ namespace swift::gui::models QPixmap pm; if (dataCVariant.canConvert()) { - const CIcon icon = dataCVariant.value(); + const auto icon = dataCVariant.value(); pm = icon.toPixmap(); } @@ -199,17 +199,17 @@ namespace swift::gui::models if (dateTime.isNull()) return {}; if (static_cast(dateTime.type()) == QMetaType::QDateTime) { - const QDateTime dt = dateTime.value(); + const auto dt = dateTime.value(); return dt.toString(m_formatString); } else if (static_cast(dateTime.type()) == QMetaType::QDate) { - const QDate d = dateTime.value(); + const auto d = dateTime.value(); return d.toString(m_formatString); } else if (static_cast(dateTime.type()) == QMetaType::QTime) { - const QTime t = dateTime.value(); + const auto t = dateTime.value(); return t.toString(m_formatString); } else if (dateTime.isIntegral()) @@ -229,7 +229,7 @@ namespace swift::gui::models if (dataCVariant.canConvert()) { // special treatment for some cases - const CLength l = dataCVariant.value(); + const auto l = dataCVariant.value(); const bool valid = !l.isNull() && (l.isPositiveWithEpsilonConsidered() || l.isZeroEpsilonConsidered()); return valid ? CPhysiqalQuantiyFormatter::displayRole(dataCVariant) : emptyStringVariant(); } @@ -245,7 +245,7 @@ namespace swift::gui::models if (dataCVariant.canConvert()) { // special treatment for some cases - const CFrequency f = dataCVariant.value(); + const auto f = dataCVariant.value(); if (CComSystem::isValidComFrequency(f)) { return CPhysiqalQuantiyFormatter::displayRole(dataCVariant); } return emptyStringVariant(); } @@ -259,7 +259,7 @@ namespace swift::gui::models CVariant CSpeedKtsFormatter::displayRole(const CVariant &dataCVariant) const { // special treatment for some cases - const CSpeed s = dataCVariant.value(); + const auto s = dataCVariant.value(); if (!s.isNull() && (s.isPositiveWithEpsilonConsidered() || s.isZeroEpsilonConsidered())) { return CPhysiqalQuantiyFormatter::displayRole(dataCVariant); @@ -376,7 +376,7 @@ namespace swift::gui::models CVariant CAltitudeFormatter::displayRole(const CVariant &altitude) const { - CAltitude alt(altitude.to()); + auto alt(altitude.to()); if (m_flightLevel) { alt.toFlightLevel(); } else { alt.switchUnit(m_unit); } return alt.toQString(m_useI18n); @@ -395,7 +395,7 @@ namespace swift::gui::models CVariant CColorFormatter::decorationRole(const CVariant &dataCVariant) const { - const CRgbColor rgbColor(dataCVariant.to()); + const auto rgbColor(dataCVariant.to()); if (!rgbColor.isValid()) { return emptyPixmapVariant(); } return CVariant::fromValue(rgbColor.toPixmap()); } @@ -403,7 +403,7 @@ namespace swift::gui::models CVariant CColorFormatter::tooltipRole(const CVariant &dataCVariant) const { static const CVariant empty(CVariant::fromValue(QPixmap())); - const CRgbColor rgbColor(dataCVariant.to()); + const auto rgbColor(dataCVariant.to()); if (!rgbColor.isValid()) { return emptyStringVariant(); } return rgbColor.hex(true); } diff --git a/src/gui/models/listmodelbase.cpp b/src/gui/models/listmodelbase.cpp index 6805bbc0b8..13fe194116 100644 --- a/src/gui/models/listmodelbase.cpp +++ b/src/gui/models/listmodelbase.cpp @@ -58,7 +58,7 @@ namespace swift::gui::models { if (action == Qt::MoveAction) { - const ContainerType container(valueVariant.value()); + const auto container(valueVariant.value()); if (container.isEmpty()) { return false; } const int position = parent.row(); this->moveItems(container, position); @@ -111,7 +111,7 @@ namespace swift::gui::models template bool CListModelBase::setData(const QModelIndex &index, const QVariant &value, int role) { - Qt::ItemDataRole dataRole = static_cast(role); + auto dataRole = static_cast(role); if (!(dataRole == Qt::UserRole || dataRole == Qt::EditRole)) { return false; } // check / init @@ -542,7 +542,7 @@ namespace swift::gui::models template QMimeData *CListModelBase::mimeData(const QModelIndexList &indexes) const { - QMimeData *mimeData = new QMimeData(); + auto *mimeData = new QMimeData(); if (indexes.isEmpty()) { return mimeData; } ContainerType container; diff --git a/src/gui/models/simulatedaircraftlistmodel.cpp b/src/gui/models/simulatedaircraftlistmodel.cpp index 6f6cf1a652..d1ea105cfa 100644 --- a/src/gui/models/simulatedaircraftlistmodel.cpp +++ b/src/gui/models/simulatedaircraftlistmodel.cpp @@ -71,7 +71,7 @@ namespace swift::gui::models "icao", "icao and livery info", { CSimulatedAircraft::IndexCombinedIcaoLiveryStringNetworkModel })); // icon column for airline - CPixmapFormatter *pmf = new CPixmapFormatter(); + auto *pmf = new CPixmapFormatter(); pmf->setMaxHeight(25); pmf->setMaxWidth(100); CColumn col("airline", diff --git a/src/gui/overlaymessages.cpp b/src/gui/overlaymessages.cpp index 220c251651..a9202ef4b2 100644 --- a/src/gui/overlaymessages.cpp +++ b/src/gui/overlaymessages.cpp @@ -513,7 +513,7 @@ namespace swift::gui void COverlayMessages::addShadow(QColor color) { - QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this); + auto *shadow = new QGraphicsDropShadowEffect(this); color.setAlpha(96); shadow->setColor(color); this->setGraphicsEffect(shadow); diff --git a/src/gui/pluginselector.cpp b/src/gui/pluginselector.cpp index d4e304d03e..e3146129b4 100644 --- a/src/gui/pluginselector.cpp +++ b/src/gui/pluginselector.cpp @@ -21,7 +21,7 @@ namespace swift::gui { setObjectName("CPluginSelector"); - QVBoxLayout *layout = new QVBoxLayout; + auto *layout = new QVBoxLayout; setLayout(layout); connect(m_configButtonMapper, &QSignalMapper::mappedString, this, &CPluginSelector::pluginConfigRequested); @@ -33,12 +33,12 @@ namespace swift::gui SWIFT_VERIFY_X(!identifier.isEmpty(), Q_FUNC_INFO, "Missing identifier"); if (identifier.isEmpty()) { return; } - QWidget *pw = new QWidget; - QHBoxLayout *layout = new QHBoxLayout; + auto *pw = new QWidget; + auto *layout = new QHBoxLayout; layout->setContentsMargins(0, 0, 0, 0); pw->setLayout(layout); - QCheckBox *cb = new QCheckBox(name); + auto *cb = new QCheckBox(name); cb->setObjectName(identifier); cb->setProperty("pluginIdentifier", identifier); connect(cb, &QCheckBox::checkStateChanged, this, &CPluginSelector::handlePluginStateChange); @@ -49,7 +49,7 @@ namespace swift::gui if (hasConfig) { - QPushButton *config = new QPushButton(swift::misc::CIcons::wrench16(), ""); + auto *config = new QPushButton(swift::misc::CIcons::wrench16(), ""); config->setToolTip("Plugin configuration"); m_configButtonMapper->setMapping(config, identifier); connect(config, &QPushButton::clicked, m_configButtonMapper, qOverload<>(&QSignalMapper::map)); @@ -64,14 +64,14 @@ namespace swift::gui void CPluginSelector::setEnabled(const QString &identifier, bool enabled) { - QCheckBox *cb = findChild(identifier); + auto *cb = findChild(identifier); Q_ASSERT(cb); cb->setChecked(enabled); } void CPluginSelector::handlePluginStateChange() { - QCheckBox *cb = qobject_cast(sender()); + auto *cb = qobject_cast(sender()); Q_ASSERT(cb); bool enabled = cb->checkState() != Qt::Unchecked; diff --git a/src/gui/settings/dockwidgetsettings.cpp b/src/gui/settings/dockwidgetsettings.cpp index 17fbb86beb..3cbf3468b6 100644 --- a/src/gui/settings/dockwidgetsettings.cpp +++ b/src/gui/settings/dockwidgetsettings.cpp @@ -89,7 +89,7 @@ namespace swift::gui::settings QVariant CDockWidgetSettings::propertyByIndex(CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexFloatingMargins: return QVariant::fromValue(m_floatingMargins); @@ -109,7 +109,7 @@ namespace swift::gui::settings return; } - ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexFloatingMargins: m_floatingMargins = variant.toString(); break; diff --git a/src/gui/settings/guisettings.cpp b/src/gui/settings/guisettings.cpp index dbeabc6e64..50b99f9f18 100644 --- a/src/gui/settings/guisettings.cpp +++ b/src/gui/settings/guisettings.cpp @@ -45,7 +45,7 @@ namespace swift::gui::settings QVariant CGeneralGuiSettings::propertyByIndex(swift::misc::CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexWidgetStyle: return QVariant::fromValue(this->m_widgetStyle); @@ -61,7 +61,7 @@ namespace swift::gui::settings (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexWidgetStyle: this->setWidgetStyle(variant.toString()); break; diff --git a/src/gui/settings/navigatorsettings.cpp b/src/gui/settings/navigatorsettings.cpp index 66336db37c..c94eb407d5 100644 --- a/src/gui/settings/navigatorsettings.cpp +++ b/src/gui/settings/navigatorsettings.cpp @@ -49,7 +49,7 @@ namespace swift::gui::settings QVariant CNavigatorSettings::propertyByIndex(CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexMargins: return QVariant::fromValue(this->m_margins); @@ -67,7 +67,7 @@ namespace swift::gui::settings return; } - ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexMargins: this->m_margins = variant.toString(); break; diff --git a/src/gui/settings/textmessagesettings.cpp b/src/gui/settings/textmessagesettings.cpp index 2941994390..f2df03c7f4 100644 --- a/src/gui/settings/textmessagesettings.cpp +++ b/src/gui/settings/textmessagesettings.cpp @@ -78,7 +78,7 @@ namespace swift::gui::settings QVariant CTextMessageSettings::propertyByIndex(CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexPopupAllMessages: return QVariant::fromValue(this->getPopupAllMessages()); @@ -100,7 +100,7 @@ namespace swift::gui::settings (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexPopupAllMessages: this->setPopupAllMessages(variant.toBool()); break; diff --git a/src/gui/settings/viewupdatesettings.cpp b/src/gui/settings/viewupdatesettings.cpp index 965bdea979..b6b74e4a2d 100644 --- a/src/gui/settings/viewupdatesettings.cpp +++ b/src/gui/settings/viewupdatesettings.cpp @@ -47,7 +47,7 @@ namespace swift::gui::settings QVariant CViewUpdateSettings::propertyByIndex(CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexAircraft: return QVariant::fromValue(this->m_updateAircraft); @@ -66,7 +66,7 @@ namespace swift::gui::settings return; } - ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexAircraft: this->m_updateAircraft = variant.value(); break; diff --git a/src/gui/stylesheetutility.cpp b/src/gui/stylesheetutility.cpp index 6287587f6f..5da6b0b6e7 100644 --- a/src/gui/stylesheetutility.cpp +++ b/src/gui/stylesheetutility.cpp @@ -415,7 +415,7 @@ namespace swift::gui // usedWidget->style()->drawPrimitive(element, &opt, &p, usedWidget); // 2) With viewport based widgets viewport has to be used // see http://stackoverflow.com/questions/37952348/enable-own-widget-for-stylesheet - QAbstractScrollArea *sa = qobject_cast(usedWidget); + auto *sa = qobject_cast(usedWidget); QStylePainter p(sa ? sa->viewport() : usedWidget); if (!p.isActive()) { return false; } diff --git a/src/gui/views/aircraftcategorytreeview.cpp b/src/gui/views/aircraftcategorytreeview.cpp index a0988fba06..94dcff112b 100644 --- a/src/gui/views/aircraftcategorytreeview.cpp +++ b/src/gui/views/aircraftcategorytreeview.cpp @@ -89,8 +89,8 @@ namespace swift::gui::views if (!this->categoryModel()) { return; } if (this->categoryModel()->container().isEmpty()) { return; } - QMenu *menu = new QMenu(this); // menu - QAction *resize = new QAction(CIcons::resize16(), "Resize", this); + auto *menu = new QMenu(this); // menu + auto *resize = new QAction(CIcons::resize16(), "Resize", this); connect(resize, &QAction::triggered, this, &CAircraftCategoryTreeView::fullResizeToContentsImpl); menu->addAction(resize); diff --git a/src/gui/views/aircraftmodelvalidationdialog.cpp b/src/gui/views/aircraftmodelvalidationdialog.cpp index fcfafcd8fa..7be61238e3 100644 --- a/src/gui/views/aircraftmodelvalidationdialog.cpp +++ b/src/gui/views/aircraftmodelvalidationdialog.cpp @@ -24,7 +24,7 @@ namespace swift::gui::views ui->setupUi(this); this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); - QPushButton *validateButton = new QPushButton("Validate", ui->bb_ValidationDialog); + auto *validateButton = new QPushButton("Validate", ui->bb_ValidationDialog); ui->bb_ValidationDialog->addButton(validateButton, QDialogButtonBox::ActionRole); connect(validateButton, &QPushButton::released, this, &CAircraftModelValidationDialog::validate, Qt::QueuedConnection); diff --git a/src/gui/views/aircraftmodelview.cpp b/src/gui/views/aircraftmodelview.cpp index 531220f4e7..69a3506aee 100644 --- a/src/gui/views/aircraftmodelview.cpp +++ b/src/gui/views/aircraftmodelview.cpp @@ -49,7 +49,7 @@ namespace swift::gui::views this->setSettingsDirectoryIndex(CDirectories::IndexDirLastModelJsonOrDefault); // shortcut - QShortcut *stashShortcut = new QShortcut(CShortcut::keyStash(), this); + auto *stashShortcut = new QShortcut(CShortcut::keyStash(), this); stashShortcut->setContext(Qt::WidgetShortcut); connect(stashShortcut, &QShortcut::activated, this, &CAircraftModelView::requestedStash); @@ -222,7 +222,7 @@ namespace swift::gui::views { if (valueVariant.canConvert()) { - const CAircraftModel model = valueVariant.value(); + const auto model = valueVariant.value(); if (!model.hasModelString()) { return; } const CAircraftModelList models({ model }); this->derivedModel()->replaceOrAddByModelString(models); @@ -230,7 +230,7 @@ namespace swift::gui::views } else if (valueVariant.canConvert()) { - const CAircraftModelList models(valueVariant.value()); + const auto models(valueVariant.value()); if (models.isEmpty()) { return; } this->derivedModel()->replaceOrAddByModelString(models); return; @@ -240,13 +240,13 @@ namespace swift::gui::views if (!this->hasSelection()) { return; } if (valueVariant.canConvert()) { - const CAircraftIcaoCode icao = valueVariant.value(); + const auto icao = valueVariant.value(); if (icao.validate().hasErrorMessages()) { return; } this->applyToSelected(icao); } else if (valueVariant.canConvert()) { - const CAircraftIcaoCodeList icaos(valueVariant.value()); + const auto icaos(valueVariant.value()); if (icaos.size() != 1) { return; } const CAircraftIcaoCode icao = icaos.front(); if (icao.validate().hasErrorMessages()) { return; } @@ -254,13 +254,13 @@ namespace swift::gui::views } else if (valueVariant.canConvert()) { - const CLivery livery = valueVariant.value(); + const auto livery = valueVariant.value(); if (livery.validate().hasErrorMessages()) { return; } this->applyToSelected(livery); } else if (valueVariant.canConvert()) { - const CLiveryList liveries(valueVariant.value()); + const auto liveries(valueVariant.value()); if (liveries.size() != 1) { return; } const CLivery livery = liveries.front(); if (livery.validate().hasErrorMessages()) { return; } @@ -268,13 +268,13 @@ namespace swift::gui::views } else if (valueVariant.canConvert()) { - const CDistributor distributor = valueVariant.value(); + const auto distributor = valueVariant.value(); if (distributor.validate().hasErrorMessages()) { return; } this->applyToSelected(distributor); } else if (valueVariant.canConvert()) { - const CDistributorList distributors(valueVariant.value()); + const auto distributors(valueVariant.value()); if (distributors.size() != 1) { return; } const CDistributor distributor = distributors.front(); if (distributor.validate().hasErrorMessages()) { return; } @@ -282,14 +282,14 @@ namespace swift::gui::views } else if (valueVariant.canConvert()) { - const CAirlineIcaoCode airline = valueVariant.value(); + const auto airline = valueVariant.value(); if (airline.validate().hasErrorMessages()) { return; } emit requestHandlingOfStashDrop( airline); // I need to convert to stanard livery, which I can`t do here } else if (valueVariant.canConvert()) { - const CAirlineIcaoCodeList airlines(valueVariant.value()); + const auto airlines(valueVariant.value()); if (airlines.size() != 1) { return; } const CAirlineIcaoCode airline = airlines.front(); if (airline.validate().hasErrorMessages()) { return; } diff --git a/src/gui/views/atcstationtreeview.cpp b/src/gui/views/atcstationtreeview.cpp index 0932e921ca..680051fc09 100644 --- a/src/gui/views/atcstationtreeview.cpp +++ b/src/gui/views/atcstationtreeview.cpp @@ -116,12 +116,12 @@ namespace swift::gui::views if (!this->stationModel()) { return; } if (this->stationModel()->container().isEmpty()) { return; } - QMenu *menu = new QMenu(this); // menu + auto *menu = new QMenu(this); // menu - QAction *com1 = new QAction(CIcons::appCockpit16(), "Tune in COM1", this); - QAction *com2 = new QAction(CIcons::appCockpit16(), "Tune in COM2", this); - QAction *text = new QAction(CIcons::appTextMessages16(), "Show text messages", this); - QAction *resize = new QAction(CIcons::resize16(), "Resize", this); + auto *com1 = new QAction(CIcons::appCockpit16(), "Tune in COM1", this); + auto *com2 = new QAction(CIcons::appCockpit16(), "Tune in COM2", this); + auto *text = new QAction(CIcons::appTextMessages16(), "Show text messages", this); + auto *resize = new QAction(CIcons::resize16(), "Resize", this); connect(com1, &QAction::triggered, this, &CAtcStationTreeView::tuneInAtcCom1); connect(com2, &QAction::triggered, this, &CAtcStationTreeView::tuneInAtcCom2); diff --git a/src/gui/views/checkboxdelegate.cpp b/src/gui/views/checkboxdelegate.cpp index 4e9b3c63d6..3608f266cb 100644 --- a/src/gui/views/checkboxdelegate.cpp +++ b/src/gui/views/checkboxdelegate.cpp @@ -32,7 +32,7 @@ namespace swift::gui::views { Q_UNUSED(index); Q_UNUSED(option); - QCheckBox *cb = new QCheckBox(parent); + auto *cb = new QCheckBox(parent); if (!m_iconCheckedUrl.isEmpty() && !m_iconUncheckedUrl.isEmpty()) { const QString style = CStyleSheetUtility::styleForIconCheckBox(m_iconCheckedUrl, m_iconUncheckedUrl); @@ -45,13 +45,13 @@ namespace swift::gui::views void CCheckBoxDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const { const bool v = index.model()->data(index, Qt::UserRole).toBool(); - QCheckBox *cb = qobject_cast(editor); + auto *cb = qobject_cast(editor); cb->setChecked(v); } void CCheckBoxDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const { - QCheckBox *cb = qobject_cast(editor); + auto *cb = qobject_cast(editor); const bool v = cb->isChecked(); model->setData(index, QVariant(v), Qt::EditRole); } diff --git a/src/gui/views/viewbase.cpp b/src/gui/views/viewbase.cpp index a6ecb85e82..29dd3ffe05 100644 --- a/src/gui/views/viewbase.cpp +++ b/src/gui/views/viewbase.cpp @@ -619,7 +619,7 @@ namespace swift::gui::views template int CViewBase::performUpdateContainer(const swift::misc::CVariant &variant, bool sort, bool resize) { - ContainerType c(variant.to()); + auto c(variant.to()); return this->updateContainer(c, sort, resize); } @@ -844,7 +844,7 @@ namespace swift::gui::views template bool CViewBase::filterDialogFinished(int status) { - const QDialog::DialogCode statusCode = static_cast(status); + const auto statusCode = static_cast(status); return filterWidgetChangedFilter(statusCode == QDialog::Accepted); } @@ -857,8 +857,7 @@ namespace swift::gui::views else { // takes the filter and triggers the filtering - IModelFilterProvider *provider = - dynamic_cast *>(m_filterWidget); + auto *provider = dynamic_cast *>(m_filterWidget); Q_ASSERT_X(provider, Q_FUNC_INFO, "Filter widget does not provide interface"); if (!provider) { return false; } std::unique_ptr> f(provider->createModelFilter()); diff --git a/src/gui/views/viewbasenontemplate.cpp b/src/gui/views/viewbasenontemplate.cpp index 48203cce95..39f9d79ff6 100644 --- a/src/gui/views/viewbasenontemplate.cpp +++ b/src/gui/views/viewbasenontemplate.cpp @@ -51,37 +51,37 @@ namespace swift::gui::views this->setTextElideMode(Qt::ElideNone); // shortcuts - QShortcut *filter = new QShortcut(CShortcut::keyDisplayFilter(), this); + auto *filter = new QShortcut(CShortcut::keyDisplayFilter(), this); bool s = connect(filter, &QShortcut::activated, this, &CViewBaseNonTemplate::displayFilterDialog); Q_ASSERT_X(s, Q_FUNC_INFO, "Shortcut"); filter->setObjectName("Filter shortcut for " + this->objectName()); filter->setContext(Qt::WidgetShortcut); - QShortcut *clearSelection = new QShortcut(CShortcut::keyClearSelection(), this); + auto *clearSelection = new QShortcut(CShortcut::keyClearSelection(), this); s = connect(clearSelection, &QShortcut::activated, this, &CViewBaseNonTemplate::clearSelection); Q_ASSERT_X(s, Q_FUNC_INFO, "Shortcut"); clearSelection->setObjectName("Clear selection shortcut for " + this->objectName()); clearSelection->setContext(Qt::WidgetShortcut); - QShortcut *saveJson = new QShortcut(CShortcut::keySaveViews(), this); + auto *saveJson = new QShortcut(CShortcut::keySaveViews(), this); s = connect(saveJson, &QShortcut::activated, this, &CViewBaseNonTemplate::saveJsonAction); Q_ASSERT_X(s, Q_FUNC_INFO, "Shortcut"); saveJson->setObjectName("Save JSON for " + this->objectName()); saveJson->setContext(Qt::WidgetShortcut); - QShortcut *deleteRow = new QShortcut(CShortcut::keyDelete(), this); + auto *deleteRow = new QShortcut(CShortcut::keyDelete(), this); s = connect(deleteRow, &QShortcut::activated, this, &CViewBaseNonTemplate::removeSelectedRowsChecked); Q_ASSERT_X(s, Q_FUNC_INFO, "Shortcut"); deleteRow->setObjectName("Remove selected rows for " + this->objectName()); deleteRow->setContext(Qt::WidgetShortcut); - QShortcut *copy = new QShortcut(CShortcut::keyCopy(), this); + auto *copy = new QShortcut(CShortcut::keyCopy(), this); s = connect(copy, &QShortcut::activated, this, &CViewBaseNonTemplate::copy); Q_ASSERT_X(s, Q_FUNC_INFO, "Shortcut"); copy->setObjectName("Copy selection shortcut for " + this->objectName()); copy->setContext(Qt::WidgetShortcut); - QShortcut *resize = new QShortcut(CShortcut::keyResizeView(), this); + auto *resize = new QShortcut(CShortcut::keyResizeView(), this); s = connect(resize, &QShortcut::activated, this, &CViewBaseNonTemplate::fullResizeToContents); Q_ASSERT_X(s, Q_FUNC_INFO, "Shortcut"); resize->setObjectName("Resize view shortcut for " + this->objectName()); @@ -866,7 +866,7 @@ namespace swift::gui::views void CViewBaseNonTemplate::toggleAutoDisplay() { - const QAction *a = qobject_cast(QObject::sender()); + const auto *a = qobject_cast(QObject::sender()); if (!a) { return; } Q_ASSERT_X(a->isCheckable(), Q_FUNC_INFO, "object not checkable"); m_displayAutomatically = a->isChecked(); diff --git a/src/gui/views/viewdbobjects.cpp b/src/gui/views/viewdbobjects.cpp index 674104df1d..8fe2b82466 100644 --- a/src/gui/views/viewdbobjects.cpp +++ b/src/gui/views/viewdbobjects.cpp @@ -143,20 +143,20 @@ namespace swift::gui::views if (!m_menuActions[0]) { m_frame = new QFrame(this); - QHBoxLayout *layout = new QHBoxLayout(m_frame); + auto *layout = new QHBoxLayout(m_frame); layout->setContentsMargins(2, 2, 2, 2); m_frame->setLayout(layout); m_leOrder = new QLineEdit(m_frame); - QLabel *icon = new QLabel(m_frame); + auto *icon = new QLabel(m_frame); icon->setPixmap(menu.getPixmap()); layout->addWidget(icon); - QLabel *label = new QLabel(m_frame); + auto *label = new QLabel(m_frame); label->setText("Order:"); layout->addWidget(label); layout->addWidget(m_leOrder); m_validator = new QIntValidator(0, maxOrder, this); m_leOrder->setValidator(m_validator); - QWidgetAction *orderAction = new QWidgetAction(this); + auto *orderAction = new QWidgetAction(this); orderAction->setDefaultWidget(m_frame); QObject::connect(m_leOrder, &QLineEdit::returnPressed, this, &COrderableViewWithDbObjects::orderToLineEdit); @@ -214,7 +214,7 @@ namespace swift::gui::views void COrderableViewWithDbObjects::orderToLineEdit() { if (this->isEmpty()) { return; } - QLineEdit *le = qobject_cast(QObject::sender()); + auto *le = qobject_cast(QObject::sender()); if (!le || le->text().isEmpty()) { return; } const int order = le->text().toInt(); this->moveSelectedItems(order); diff --git a/src/input/linux/joysticklinux.cpp b/src/input/linux/joysticklinux.cpp index 4aa5a3b0a5..224140bf13 100644 --- a/src/input/linux/joysticklinux.cpp +++ b/src/input/linux/joysticklinux.cpp @@ -42,7 +42,7 @@ namespace swift::input /* Forward */ struct js_event event; while (m_fd->read(reinterpret_cast(&event), sizeof(event)) == sizeof(event)) {} - QSocketNotifier *notifier = new QSocketNotifier(m_fd->handle(), QSocketNotifier::Read, m_fd); + auto notifier = new QSocketNotifier(m_fd->handle(), QSocketNotifier::Read, m_fd); connect(notifier, &QSocketNotifier::activated, this, &CJoystickDevice::processInput); m_name = QString(deviceName); } @@ -101,10 +101,10 @@ namespace swift::input void CJoystickLinux::addJoystickDevice(const QString &path) { - QFile *fd = new QFile(path); + auto fd = new QFile(path); if (fd->open(QIODevice::ReadOnly)) { - CJoystickDevice *joystickDevice = new CJoystickDevice(path, fd, this); + auto joystickDevice = new CJoystickDevice(path, fd, this); connect(joystickDevice, &CJoystickDevice::buttonChanged, this, &CJoystickLinux::joystickButtonChanged); m_joystickDevices.push_back(joystickDevice); } diff --git a/src/input/linux/keyboardlinux.cpp b/src/input/linux/keyboardlinux.cpp index bc6badd0e2..9a341f2eb9 100644 --- a/src/input/linux/keyboardlinux.cpp +++ b/src/input/linux/keyboardlinux.cpp @@ -159,7 +159,7 @@ namespace swift::input { struct input_event eventInput; - QFile *fileInput = qobject_cast(sender()->parent()); + auto fileInput = qobject_cast(sender()->parent()); if (!fileInput) return; bool found = false; diff --git a/src/misc/applicationinfo.cpp b/src/misc/applicationinfo.cpp index d41607b5ad..ee71700f99 100644 --- a/src/misc/applicationinfo.cpp +++ b/src/misc/applicationinfo.cpp @@ -96,7 +96,7 @@ namespace swift::misc QVariant CApplicationInfo::propertyByIndex(CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexApplication: return QVariant::fromValue(m_app); @@ -121,7 +121,7 @@ namespace swift::misc (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexApplication: this->setApplication(static_cast(variant.toInt())); break; @@ -142,7 +142,7 @@ namespace swift::misc int CApplicationInfo::comparePropertyByIndex(CPropertyIndexRef index, const CApplicationInfo &compareValue) const { if (index.isMyself()) { return this->getExecutablePath().compare(compareValue.getExecutablePath()); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexApplicationDataPath: diff --git a/src/misc/aviation/aircraftcategory.cpp b/src/misc/aviation/aircraftcategory.cpp index cf8a252bdd..2f445b03bc 100644 --- a/src/misc/aviation/aircraftcategory.cpp +++ b/src/misc/aviation/aircraftcategory.cpp @@ -142,7 +142,7 @@ namespace swift::misc::aviation { return IDatastoreObjectWithIntegerKey::propertyByIndex(index); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexName: return QVariant::fromValue(m_name); @@ -168,7 +168,7 @@ namespace swift::misc::aviation IDatastoreObjectWithIntegerKey::setPropertyByIndex(index, variant); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexName: this->setName(variant.value()); break; @@ -185,7 +185,7 @@ namespace swift::misc::aviation { return IDatastoreObjectWithIntegerKey::comparePropertyByIndex(index, compareValue); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexName: return m_name.compare(compareValue.getName(), Qt::CaseInsensitive); diff --git a/src/misc/aviation/aircrafticaocode.cpp b/src/misc/aviation/aircrafticaocode.cpp index 3dbe252fbb..0ba3621b46 100644 --- a/src/misc/aviation/aircrafticaocode.cpp +++ b/src/misc/aviation/aircrafticaocode.cpp @@ -651,7 +651,7 @@ namespace swift::misc::aviation { return IDatastoreObjectWithIntegerKey::propertyByIndex(index); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexAircraftDesignator: return QVariant::fromValue(m_designator); @@ -687,7 +687,7 @@ namespace swift::misc::aviation IDatastoreObjectWithIntegerKey::setPropertyByIndex(index, variant); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexAircraftDesignator: this->setDesignator(variant.value()); break; @@ -714,7 +714,7 @@ namespace swift::misc::aviation { return IDatastoreObjectWithIntegerKey::comparePropertyByIndex(index, compareValue); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexAircraftDesignator: return m_designator.compare(compareValue.getDesignator(), Qt::CaseInsensitive); diff --git a/src/misc/aviation/aircraftlights.cpp b/src/misc/aviation/aircraftlights.cpp index cab9cd0a3b..0c822e3fcc 100644 --- a/src/misc/aviation/aircraftlights.cpp +++ b/src/misc/aviation/aircraftlights.cpp @@ -47,7 +47,7 @@ namespace swift::misc::aviation { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexIsNull: return QVariant::fromValue(this->isNull()); @@ -71,7 +71,7 @@ namespace swift::misc::aviation return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexIsNull: m_isNull = variant.toBool(); break; @@ -89,7 +89,7 @@ namespace swift::misc::aviation int CAircraftLights::comparePropertyByIndex(CPropertyIndexRef index, const CAircraftLights &compareValue) const { - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexIsNull: return Compare::compare(m_isNull, compareValue.isNull()); diff --git a/src/misc/aviation/aircraftparts.cpp b/src/misc/aviation/aircraftparts.cpp index 9f2b367c7d..d778493aeb 100644 --- a/src/misc/aviation/aircraftparts.cpp +++ b/src/misc/aviation/aircraftparts.cpp @@ -103,7 +103,7 @@ namespace swift::misc::aviation return ITimestampWithOffsetBased::propertyByIndex(index); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexEngines: return QVariant::fromValue(m_engines); @@ -130,7 +130,7 @@ namespace swift::misc::aviation return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexEngines: m_engines = variant.value(); break; @@ -154,7 +154,7 @@ namespace swift::misc::aviation return ITimestampWithOffsetBased::comparePropertyByIndex(index, compareValue); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexEngines: return Compare::compare(this->getEnginesCount(), compareValue.getEnginesCount()); diff --git a/src/misc/aviation/aircraftsituation.cpp b/src/misc/aviation/aircraftsituation.cpp index 8d81272481..66d8d5571b 100644 --- a/src/misc/aviation/aircraftsituation.cpp +++ b/src/misc/aviation/aircraftsituation.cpp @@ -273,7 +273,7 @@ namespace swift::misc::aviation } if (ICoordinateGeodetic::canHandleIndex(index)) { return ICoordinateGeodetic::propertyByIndex(index); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexPosition: return m_position.propertyByIndex(index.copyFrontRemoved()); @@ -313,7 +313,7 @@ namespace swift::misc::aviation return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexPosition: m_position.setPropertyByIndex(index.copyFrontRemoved(), variant); break; @@ -346,7 +346,7 @@ namespace swift::misc::aviation { return ICoordinateGeodetic::comparePropertyByIndex(index, compareValue); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexPosition: diff --git a/src/misc/aviation/aircraftsituationchange.cpp b/src/misc/aviation/aircraftsituationchange.cpp index 5d0173ef00..939157c4ab 100644 --- a/src/misc/aviation/aircraftsituationchange.cpp +++ b/src/misc/aviation/aircraftsituationchange.cpp @@ -262,7 +262,7 @@ namespace swift::misc::aviation return ITimestampWithOffsetBased::propertyByIndex(index); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexCallsign: return m_correspondingCallsign.propertyByIndex(index.copyFrontRemoved()); @@ -297,7 +297,7 @@ namespace swift::misc::aviation return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexCallsign: m_correspondingCallsign.setPropertyByIndex(index.copyFrontRemoved(), variant); break; @@ -331,7 +331,7 @@ namespace swift::misc::aviation return ITimestampWithOffsetBased::comparePropertyByIndex(index, compareValue); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexCallsign: diff --git a/src/misc/aviation/airlineicaocode.cpp b/src/misc/aviation/airlineicaocode.cpp index d54db5f9f3..6baa9dc50b 100644 --- a/src/misc/aviation/airlineicaocode.cpp +++ b/src/misc/aviation/airlineicaocode.cpp @@ -177,7 +177,7 @@ namespace swift::misc::aviation { return IDatastoreObjectWithIntegerKey::propertyByIndex(index); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexAirlineDesignator: return QVariant::fromValue(m_designator); @@ -209,7 +209,7 @@ namespace swift::misc::aviation IDatastoreObjectWithIntegerKey::setPropertyByIndex(index, variant); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexAirlineDesignator: this->setDesignator(variant.value()); break; @@ -234,7 +234,7 @@ namespace swift::misc::aviation { return IDatastoreObjectWithIntegerKey::comparePropertyByIndex(index, compareValue); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexAirlineDesignator: return m_designator.compare(compareValue.getDesignator()); diff --git a/src/misc/aviation/airport.cpp b/src/misc/aviation/airport.cpp index 48856b5b1f..64354960d7 100644 --- a/src/misc/aviation/airport.cpp +++ b/src/misc/aviation/airport.cpp @@ -93,7 +93,7 @@ namespace swift::misc::aviation QVariant CAirport::propertyByIndex(swift::misc::CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexIcao: return m_icao.propertyByIndex(index.copyFrontRemoved()); @@ -116,7 +116,7 @@ namespace swift::misc::aviation (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexIcao: m_icao.setPropertyByIndex(index.copyFrontRemoved(), variant); break; @@ -140,7 +140,7 @@ namespace swift::misc::aviation { return m_icao.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getIcao()); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexIcao: return m_icao.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getIcao()); diff --git a/src/misc/aviation/altitude.cpp b/src/misc/aviation/altitude.cpp index 855d4e3d98..6768ba7801 100644 --- a/src/misc/aviation/altitude.cpp +++ b/src/misc/aviation/altitude.cpp @@ -181,7 +181,7 @@ namespace swift::misc::aviation rd = AboveGround; } - const CLength l = CPqString::parse(v, mode); + const auto l = CPqString::parse(v, mode); *this = CAltitude(l, rd); } diff --git a/src/misc/aviation/atcstation.cpp b/src/misc/aviation/atcstation.cpp index b505148e06..19d8b0520c 100644 --- a/src/misc/aviation/atcstation.cpp +++ b/src/misc/aviation/atcstation.cpp @@ -179,7 +179,7 @@ namespace swift::misc::aviation QVariant CAtcStation::propertyByIndex(CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexLogoffTime: return QVariant::fromValue(m_logoffTimeUtc); @@ -211,7 +211,7 @@ namespace swift::misc::aviation (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexLogoffTime: this->setLogoffTimeUtc(variant.value()); break; @@ -248,7 +248,7 @@ namespace swift::misc::aviation { return this->getCallsign().comparePropertyByIndex(CPropertyIndexRef::empty(), compareValue.getCallsign()); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexLogoffTime: return Compare::compare(this->getLogoffTimeUtc(), compareValue.getLogoffTimeUtc()); diff --git a/src/misc/aviation/callsign.cpp b/src/misc/aviation/callsign.cpp index 3da88aae89..d882a66086 100644 --- a/src/misc/aviation/callsign.cpp +++ b/src/misc/aviation/callsign.cpp @@ -310,7 +310,7 @@ namespace swift::misc::aviation QVariant CCallsign::propertyByIndex(CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexCallsignString: return QVariant(this->asString()); @@ -328,7 +328,7 @@ namespace swift::misc::aviation (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexCallsignString: m_callsign = unifyCallsign(variant.toString()); break; @@ -341,7 +341,7 @@ namespace swift::misc::aviation int CCallsign::comparePropertyByIndex(CPropertyIndexRef index, const CCallsign &compareValue) const { if (index.isMyself()) { return m_callsign.compare(compareValue.m_callsign, Qt::CaseInsensitive); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexCallsignString: return m_callsign.compare(compareValue.m_callsign, Qt::CaseInsensitive); diff --git a/src/misc/aviation/flightplan.cpp b/src/misc/aviation/flightplan.cpp index 38363449e0..afada2ad89 100644 --- a/src/misc/aviation/flightplan.cpp +++ b/src/misc/aviation/flightplan.cpp @@ -263,7 +263,7 @@ namespace swift::misc::aviation if (index.isMyself()) { return QVariant::fromValue(*this); } if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::propertyByIndex(index); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexAlternateAirportIcao: return m_alternateAirportIcao.propertyByIndex(index.copyFrontRemoved()); @@ -288,7 +288,7 @@ namespace swift::misc::aviation return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexAlternateAirportIcao: @@ -616,7 +616,7 @@ namespace swift::misc::aviation variant.convertFromJson(jsonObject); if (variant.canConvert()) { - const CFlightPlan fp = variant.value(); + const auto fp = variant.value(); return fp; } else diff --git a/src/misc/aviation/informationmessage.cpp b/src/misc/aviation/informationmessage.cpp index e1f1737551..450d74f5ad 100644 --- a/src/misc/aviation/informationmessage.cpp +++ b/src/misc/aviation/informationmessage.cpp @@ -58,7 +58,7 @@ namespace swift::misc::aviation { if (index.isMyself()) { return QVariant::fromValue(*this); } if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::propertyByIndex(index); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexType: return QVariant::fromValue(m_type); @@ -80,7 +80,7 @@ namespace swift::misc::aviation ITimestampBased::setPropertyByIndex(index, variant); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexType: m_type = static_cast(variant.toInt()); break; @@ -103,7 +103,7 @@ namespace swift::misc::aviation { return ITimestampBased::comparePropertyByIndex(index, compareValue); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexMessage: return m_message.compare(compareValue.m_message, Qt::CaseInsensitive); diff --git a/src/misc/aviation/livery.cpp b/src/misc/aviation/livery.cpp index 1ec7683daa..a8e3d51df6 100644 --- a/src/misc/aviation/livery.cpp +++ b/src/misc/aviation/livery.cpp @@ -340,7 +340,7 @@ namespace swift::misc::aviation { return IDatastoreObjectWithIntegerKey::propertyByIndex(index); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexAirlineIcaoCode: return m_airline.propertyByIndex(index.copyFrontRemoved()); @@ -365,7 +365,7 @@ namespace swift::misc::aviation IDatastoreObjectWithIntegerKey::setPropertyByIndex(index, variant); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexDescription: m_description = variant.toString(); break; @@ -385,7 +385,7 @@ namespace swift::misc::aviation { return IDatastoreObjectWithIntegerKey::comparePropertyByIndex(index, compareValue); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexDescription: return m_description.compare(compareValue.getDescription(), Qt::CaseInsensitive); diff --git a/src/misc/aviation/modulator.cpp b/src/misc/aviation/modulator.cpp index d73595d435..ca863df6ad 100644 --- a/src/misc/aviation/modulator.cpp +++ b/src/misc/aviation/modulator.cpp @@ -112,7 +112,7 @@ namespace swift::misc::aviation QVariant CModulator::propertyByIndex(CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*derived()); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexActiveFrequency: return this->getFrequencyActive().propertyByIndex(index.copyFrontRemoved()); @@ -133,7 +133,7 @@ namespace swift::misc::aviation Q_ASSERT_X(false, Q_FUNC_INFO, "Wrong index to base template"); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexActiveFrequency: m_frequencyActive.setPropertyByIndex(index.copyFrontRemoved(), variant); break; @@ -153,7 +153,7 @@ namespace swift::misc::aviation { return m_frequencyActive.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.m_frequencyActive); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexActiveFrequency: diff --git a/src/misc/aviation/ongroundinfo.cpp b/src/misc/aviation/ongroundinfo.cpp index 615accf8f5..b9f1d50eee 100644 --- a/src/misc/aviation/ongroundinfo.cpp +++ b/src/misc/aviation/ongroundinfo.cpp @@ -132,7 +132,7 @@ namespace swift::misc::aviation { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexOnGroundFactor: return QVariant::fromValue(m_onGroundFactor); @@ -149,7 +149,7 @@ namespace swift::misc::aviation return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexOnGroundFactor: m_onGroundFactor = variant.toDouble(); break; diff --git a/src/misc/aviation/simbriefdata.cpp b/src/misc/aviation/simbriefdata.cpp index 6ff0c4aa93..e6167b04cf 100644 --- a/src/misc/aviation/simbriefdata.cpp +++ b/src/misc/aviation/simbriefdata.cpp @@ -33,7 +33,7 @@ namespace swift::misc::aviation QVariant CSimBriefData::propertyByIndex(CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexUrl: return QVariant::fromValue(m_url); @@ -49,7 +49,7 @@ namespace swift::misc::aviation (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexUrl: m_url = variant.toString(); break; diff --git a/src/misc/aviation/transponder.cpp b/src/misc/aviation/transponder.cpp index f2328f812f..972c2e74e9 100644 --- a/src/misc/aviation/transponder.cpp +++ b/src/misc/aviation/transponder.cpp @@ -207,7 +207,7 @@ namespace swift::misc::aviation QVariant CTransponder::propertyByIndex(CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexMode: return QVariant::fromValue(this->getTransponderMode()); @@ -231,7 +231,7 @@ namespace swift::misc::aviation (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexMode: m_transponderMode = variant.toInt(); break; diff --git a/src/misc/country.cpp b/src/misc/country.cpp index 9878ea9a86..26ee959838 100644 --- a/src/misc/country.cpp +++ b/src/misc/country.cpp @@ -106,7 +106,7 @@ namespace swift::misc QVariant CCountry::propertyByIndex(swift::misc::CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexIsoCode: return QVariant::fromValue(m_dbKey); @@ -130,7 +130,7 @@ namespace swift::misc (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexIsoCode: this->setIsoCode(variant.toString()); break; @@ -154,7 +154,7 @@ namespace swift::misc { return IDatastoreObjectWithStringKey::comparePropertyByIndex(index, compareValue); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexIsoCode: return getIsoCode().compare(compareValue.getIsoCode(), Qt::CaseInsensitive); diff --git a/src/misc/db/artifact.cpp b/src/misc/db/artifact.cpp index ba31aede98..eb2c5e83ac 100644 --- a/src/misc/db/artifact.cpp +++ b/src/misc/db/artifact.cpp @@ -94,7 +94,7 @@ namespace swift::misc::db return IDatastoreObjectWithIntegerKey::propertyByIndex(index); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexName: return QVariant::fromValue(m_name); @@ -123,7 +123,7 @@ namespace swift::misc::db return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexName: this->setName(variant.toString()); break; diff --git a/src/misc/db/datastore.cpp b/src/misc/db/datastore.cpp index 2c8a7d2683..045b2a5f8c 100644 --- a/src/misc/db/datastore.cpp +++ b/src/misc/db/datastore.cpp @@ -94,7 +94,7 @@ namespace swift::misc::db QVariant IDatastoreObjectWithIntegerKey::propertyByIndex(CPropertyIndexRef index) const { if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::propertyByIndex(index); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexDbIntegerKey: return QVariant::fromValue(m_dbKey); @@ -114,7 +114,7 @@ namespace swift::misc::db ITimestampBased::setPropertyByIndex(index, variant); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexDbIntegerKey: m_dbKey = variant.toInt(); break; @@ -131,7 +131,7 @@ namespace swift::misc::db { return ITimestampBased::comparePropertyByIndex(index, compareValue); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexDbKeyAsString: // fall thru @@ -194,7 +194,7 @@ namespace swift::misc::db QVariant IDatastoreObjectWithStringKey::propertyByIndex(CPropertyIndexRef index) const { if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::propertyByIndex(index); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexDbKeyAsString: // fall thru @@ -214,7 +214,7 @@ namespace swift::misc::db ITimestampBased::setPropertyByIndex(index, variant); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexDbStringKey: @@ -232,7 +232,7 @@ namespace swift::misc::db { return ITimestampBased::comparePropertyByIndex(index, compareValue); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexDbKeyAsString: // fall thru diff --git a/src/misc/db/dbinfo.cpp b/src/misc/db/dbinfo.cpp index e081f3a5d1..56d8c489b0 100644 --- a/src/misc/db/dbinfo.cpp +++ b/src/misc/db/dbinfo.cpp @@ -63,7 +63,7 @@ namespace swift::misc::db QVariant CDbInfo::propertyByIndex(swift::misc::CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexTableName: return QVariant::fromValue(m_tableName); @@ -83,7 +83,7 @@ namespace swift::misc::db (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexTableName: this->setTableName(variant.toString()); break; @@ -106,7 +106,7 @@ namespace swift::misc::db { return IDatastoreObjectWithIntegerKey::comparePropertyByIndex(index, compareValue); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexTableName: return this->getTableName().compare(compareValue.getTableName(), Qt::CaseInsensitive); diff --git a/src/misc/db/distribution.cpp b/src/misc/db/distribution.cpp index da31bda117..f67da4fa47 100644 --- a/src/misc/db/distribution.cpp +++ b/src/misc/db/distribution.cpp @@ -64,7 +64,7 @@ namespace swift::misc::db return IDatastoreObjectWithIntegerKey::propertyByIndex(index); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexChannel: return QVariant::fromValue(m_channel); @@ -88,7 +88,7 @@ namespace swift::misc::db return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexChannel: this->setChannel(variant.value()); break; diff --git a/src/misc/db/updateinfo.cpp b/src/misc/db/updateinfo.cpp index 911fd9a6c8..ef31cbece6 100644 --- a/src/misc/db/updateinfo.cpp +++ b/src/misc/db/updateinfo.cpp @@ -100,7 +100,7 @@ namespace swift::misc::db QVariant CUpdateInfo::propertyByIndex(CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexArtifactsPilotClient: return QVariant::fromValue(m_artifactsPilotClient); @@ -117,7 +117,7 @@ namespace swift::misc::db (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexArtifactsPilotClient: m_artifactsPilotClient = variant.value(); break; diff --git a/src/misc/directories.cpp b/src/misc/directories.cpp index 7a79eda306..cd90cc408d 100644 --- a/src/misc/directories.cpp +++ b/src/misc/directories.cpp @@ -62,7 +62,7 @@ namespace swift::misc QVariant CDirectories::propertyByIndex(swift::misc::CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexDirFlightPlan: return QVariant::fromValue(m_dirFlightPlan); @@ -86,7 +86,7 @@ namespace swift::misc (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexDirFlightPlan: this->setFlightPlanDirectory(variant.toString()); break; diff --git a/src/misc/geo/coordinategeodetic.cpp b/src/misc/geo/coordinategeodetic.cpp index 1b3597a2aa..400f465a82 100644 --- a/src/misc/geo/coordinategeodetic.cpp +++ b/src/misc/geo/coordinategeodetic.cpp @@ -138,7 +138,7 @@ namespace swift::misc::geo { if (!index.isMyself()) { - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexLatitude: return this->latitude().propertyByIndex(index.copyFrontRemoved()); @@ -162,7 +162,7 @@ namespace swift::misc::geo { if (!index.isMyself()) { - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexLatitude: @@ -284,7 +284,7 @@ namespace swift::misc::geo (*this) = variant.value(); return; } - const ICoordinateGeodetic::ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexGeodeticHeight: m_geodeticHeight.setPropertyByIndex(index.copyFrontRemoved(), variant); break; @@ -459,7 +459,7 @@ namespace swift::misc::geo if (ICoordinateGeodetic::canHandleIndex(index)) { return ICoordinateGeodetic::propertyByIndex(index); } if (!index.isMyself()) { - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexRelativeBearing: return this->getRelativeBearing().propertyByIndex(index.copyFrontRemoved()); @@ -477,7 +477,7 @@ namespace swift::misc::geo if (ICoordinateGeodetic::canHandleIndex(index)) { return; } if (!index.isMyself()) { - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexRelativeBearing: m_relativeBearing.setPropertyByIndex(index.copyFrontRemoved(), variant); break; @@ -500,7 +500,7 @@ namespace swift::misc::geo } if (!index.isMyself()) { - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexRelativeBearing: diff --git a/src/misc/geo/elevationplane.cpp b/src/misc/geo/elevationplane.cpp index 4871904a35..5717e4fc72 100644 --- a/src/misc/geo/elevationplane.cpp +++ b/src/misc/geo/elevationplane.cpp @@ -136,7 +136,7 @@ namespace swift::misc::geo QVariant CElevationPlane::propertyByIndex(swift::misc::CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexRadius: return m_radius.propertyByIndex(index.copyFrontRemoved()); @@ -152,7 +152,7 @@ namespace swift::misc::geo (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexRadius: m_radius.setPropertyByIndex(index.copyFrontRemoved(), variant); break; diff --git a/src/misc/identifier.cpp b/src/misc/identifier.cpp index d7bbd0b1ea..44272c441e 100644 --- a/src/misc/identifier.cpp +++ b/src/misc/identifier.cpp @@ -214,7 +214,7 @@ namespace swift::misc { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { @@ -235,7 +235,7 @@ namespace swift::misc { if (index.isMyself()) { return Compare::compare(m_processId, compareValue.m_processId); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { diff --git a/src/misc/input/actionhotkey.cpp b/src/misc/input/actionhotkey.cpp index 31170199d9..d10f0d2dfc 100644 --- a/src/misc/input/actionhotkey.cpp +++ b/src/misc/input/actionhotkey.cpp @@ -52,7 +52,7 @@ namespace swift::misc::input QVariant CActionHotkey::propertyByIndex(swift::misc::CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexIdentifier: return QVariant::fromValue(m_identifier); @@ -72,7 +72,7 @@ namespace swift::misc::input (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexAction: diff --git a/src/misc/input/joystickbutton.cpp b/src/misc/input/joystickbutton.cpp index 70722cea01..da84736f86 100644 --- a/src/misc/input/joystickbutton.cpp +++ b/src/misc/input/joystickbutton.cpp @@ -33,7 +33,7 @@ namespace swift::misc::input (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexDeviceName: this->setDeviceName(variant.value()); break; @@ -47,7 +47,7 @@ namespace swift::misc::input QVariant CJoystickButton::propertyByIndex(swift::misc::CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexDeviceName: return QVariant::fromValue(this->getDeviceName()); diff --git a/src/misc/input/keyboardkey.cpp b/src/misc/input/keyboardkey.cpp index 63f1f9b7a1..ea342da9bc 100644 --- a/src/misc/input/keyboardkey.cpp +++ b/src/misc/input/keyboardkey.cpp @@ -113,7 +113,7 @@ namespace swift::misc::input QVariant CKeyboardKey::propertyByIndex(swift::misc::CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexKey: return QVariant::fromValue(m_keyCode); @@ -133,7 +133,7 @@ namespace swift::misc::input (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexKey: diff --git a/src/misc/namevariantpair.cpp b/src/misc/namevariantpair.cpp index b57d4d4e8d..bc0bf6c46f 100644 --- a/src/misc/namevariantpair.cpp +++ b/src/misc/namevariantpair.cpp @@ -27,7 +27,7 @@ namespace swift::misc QVariant CNameVariantPair::propertyByIndex(swift::misc::CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexName: return QVariant(this->m_name); @@ -43,7 +43,7 @@ namespace swift::misc (*this) = variant.value(); return; } - ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); // special case, handle icon and allow to set it // doing this in the switch gives gcc warning as IndexIcon is no member of ColumnIndex @@ -51,7 +51,7 @@ namespace swift::misc { if (static_cast(variant.typeId()) == QMetaType::Int) { - CIcons::IconIndex iconIndex = variant.value(); + const auto iconIndex = variant.value(); this->m_icon = CIcon::iconByIndex(iconIndex); } else { this->m_icon = variant.value(); } diff --git a/src/misc/network/authenticateduser.cpp b/src/misc/network/authenticateduser.cpp index 95a9d6daf1..95ae12b027 100644 --- a/src/misc/network/authenticateduser.cpp +++ b/src/misc/network/authenticateduser.cpp @@ -109,7 +109,7 @@ namespace swift::misc::network { return IDatastoreObjectWithIntegerKey::propertyByIndex(index); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexVatsimId: return QVariant::fromValue(m_vatsimId); @@ -133,7 +133,7 @@ namespace swift::misc::network IDatastoreObjectWithIntegerKey::setPropertyByIndex(index, variant); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexVatsimId: this->setVatsimId(variant.toInt()); break; diff --git a/src/misc/network/client.cpp b/src/misc/network/client.cpp index e9b97d10af..2463cdda36 100644 --- a/src/misc/network/client.cpp +++ b/src/misc/network/client.cpp @@ -85,7 +85,7 @@ namespace swift::misc::network QVariant CClient::propertyByIndex(CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexCapabilities: return QVariant::fromValue(m_capabilities); @@ -110,7 +110,7 @@ namespace swift::misc::network (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexCapabilities: m_capabilities = variant.toInt(); break; diff --git a/src/misc/network/clientprovider.cpp b/src/misc/network/clientprovider.cpp index 666d483c45..d937a481db 100644 --- a/src/misc/network/clientprovider.cpp +++ b/src/misc/network/clientprovider.cpp @@ -206,7 +206,7 @@ namespace swift::misc::network CClientProviderDummy *CClientProviderDummy::instance() { - static CClientProviderDummy *dummy = new CClientProviderDummy(); + static auto dummy = new CClientProviderDummy(); return dummy; } } // namespace swift::misc::network diff --git a/src/misc/network/ecosystem.cpp b/src/misc/network/ecosystem.cpp index 23c3849901..771f9469a9 100644 --- a/src/misc/network/ecosystem.cpp +++ b/src/misc/network/ecosystem.cpp @@ -71,7 +71,7 @@ namespace swift::misc::network QVariant CEcosystem::propertyByIndex(swift::misc::CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexSystem: return QVariant::fromValue(m_system); @@ -87,7 +87,7 @@ namespace swift::misc::network (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexSystem: m_system = variant.toInt(); break; @@ -98,7 +98,7 @@ namespace swift::misc::network int CEcosystem::comparePropertyByIndex(CPropertyIndexRef index, const CEcosystem &compareValue) const { if (index.isMyself()) { return Compare::compare(m_system, compareValue.m_system); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexSystem: return Compare::compare(m_system, compareValue.m_system); diff --git a/src/misc/network/networkutils.cpp b/src/misc/network/networkutils.cpp index a9219deea2..e78b7ce80f 100644 --- a/src/misc/network/networkutils.cpp +++ b/src/misc/network/networkutils.cpp @@ -222,7 +222,7 @@ namespace swift::misc::network if (started.isValid() && started.canConvert()) { const qint64 now = QDateTime::currentMSecsSinceEpoch(); - const qint64 start = started.value(); + const auto start = started.value(); return (now - start); } return -1; diff --git a/src/misc/network/rawfsdmessage.cpp b/src/misc/network/rawfsdmessage.cpp index 8d0f728bc4..13cd2eba6e 100644 --- a/src/misc/network/rawfsdmessage.cpp +++ b/src/misc/network/rawfsdmessage.cpp @@ -66,7 +66,7 @@ namespace swift::misc::network if (index.isMyself()) { return QVariant::fromValue(*this); } if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::propertyByIndex(index); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexRawMessage: return QVariant::fromValue(m_rawMessage); @@ -87,7 +87,7 @@ namespace swift::misc::network return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexRawMessage: this->setRawMessage(variant.value()); break; diff --git a/src/misc/network/remotefile.cpp b/src/misc/network/remotefile.cpp index 9904405f1d..60450abfb0 100644 --- a/src/misc/network/remotefile.cpp +++ b/src/misc/network/remotefile.cpp @@ -70,7 +70,7 @@ namespace swift::misc::network { if (index.isMyself()) { return QVariant::fromValue(*this); } if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::propertyByIndex(index); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexName: return QVariant::fromValue(m_name); @@ -93,7 +93,7 @@ namespace swift::misc::network ITimestampBased::setPropertyByIndex(index, variant); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexName: this->setName(variant.value()); break; diff --git a/src/misc/network/role.cpp b/src/misc/network/role.cpp index ef87536dbb..1e092dbc3d 100644 --- a/src/misc/network/role.cpp +++ b/src/misc/network/role.cpp @@ -26,7 +26,7 @@ namespace swift::misc::network { return IDatastoreObjectWithIntegerKey::propertyByIndex(index); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexName: return QVariant::fromValue(m_name); @@ -48,7 +48,7 @@ namespace swift::misc::network IDatastoreObjectWithIntegerKey::setPropertyByIndex(index, variant); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexName: this->setName(variant.value()); break; diff --git a/src/misc/network/server.cpp b/src/misc/network/server.cpp index 3139ea36ea..3117f2570f 100644 --- a/src/misc/network/server.cpp +++ b/src/misc/network/server.cpp @@ -167,7 +167,7 @@ namespace swift::misc::network if (index.isMyself()) { return QVariant::fromValue(*this); } if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::propertyByIndex(index); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexAddress: return QVariant::fromValue(m_address); @@ -197,7 +197,7 @@ namespace swift::misc::network return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexAddress: this->setAddress(variant.value()); break; @@ -220,7 +220,7 @@ namespace swift::misc::network { return ITimestampBased::comparePropertyByIndex(index, compareValue); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexAddress: return this->getAddress().compare(compareValue.getAddress(), Qt::CaseInsensitive); diff --git a/src/misc/network/textmessage.cpp b/src/misc/network/textmessage.cpp index 4e075439b2..e906c6366b 100644 --- a/src/misc/network/textmessage.cpp +++ b/src/misc/network/textmessage.cpp @@ -287,7 +287,7 @@ namespace swift::misc::network if (index.isMyself()) { return QVariant::fromValue(*this); } if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::propertyByIndex(index); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexSenderCallsign: return m_senderCallsign.propertyByIndex(index.copyFrontRemoved()); @@ -311,7 +311,7 @@ namespace swift::misc::network return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexSenderCallsign: m_senderCallsign.setPropertyByIndex(index.copyFrontRemoved(), variant); break; @@ -327,7 +327,7 @@ namespace swift::misc::network { return ITimestampBased::comparePropertyByIndex(index, compareValue); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexSenderCallsign: diff --git a/src/misc/network/url.cpp b/src/misc/network/url.cpp index 393ed6ced1..7e209e653c 100644 --- a/src/misc/network/url.cpp +++ b/src/misc/network/url.cpp @@ -231,7 +231,7 @@ namespace swift::misc::network QVariant CUrl::propertyByIndex(CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexHost: return QVariant::fromValue(m_host); @@ -249,7 +249,7 @@ namespace swift::misc::network (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexHost: this->setHost(variant.value()); break; diff --git a/src/misc/network/urllog.cpp b/src/misc/network/urllog.cpp index 18e7aaf9e1..04ee8a3e82 100644 --- a/src/misc/network/urllog.cpp +++ b/src/misc/network/urllog.cpp @@ -34,7 +34,7 @@ namespace swift::misc::network if (index.isMyself()) { return QVariant::fromValue(*this); } if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::propertyByIndex(index); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexId: return QVariant::fromValue(m_id); @@ -59,7 +59,7 @@ namespace swift::misc::network return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexId: m_id = variant.toInt(); break; diff --git a/src/misc/network/user.cpp b/src/misc/network/user.cpp index 73fec72c50..041abb9c62 100644 --- a/src/misc/network/user.cpp +++ b/src/misc/network/user.cpp @@ -241,7 +241,7 @@ namespace swift::misc::network QVariant CUser::propertyByIndex(CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexEmail: return QVariant(m_email); @@ -263,7 +263,7 @@ namespace swift::misc::network (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexEmail: this->setEmail(variant.value()); break; @@ -281,7 +281,7 @@ namespace swift::misc::network int CUser::comparePropertyByIndex(CPropertyIndexRef index, const CUser &compareValue) const { if (index.isMyself()) { return this->getRealName().compare(compareValue.getRealName(), Qt::CaseInsensitive); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexEmail: return m_email.compare(compareValue.getEmail(), Qt::CaseInsensitive); diff --git a/src/misc/orderable.cpp b/src/misc/orderable.cpp index f94053ec2a..5d63967adf 100644 --- a/src/misc/orderable.cpp +++ b/src/misc/orderable.cpp @@ -41,7 +41,7 @@ namespace swift::misc { if (!index.isEmpty()) { - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexOrder: return QVariant::fromValue(this->m_order); @@ -58,7 +58,7 @@ namespace swift::misc { if (!index.isEmpty()) { - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexOrder: this->setOrder(variant.toInt()); return; diff --git a/src/misc/platform.cpp b/src/misc/platform.cpp index 5851272f54..20d5a7f060 100644 --- a/src/misc/platform.cpp +++ b/src/misc/platform.cpp @@ -71,7 +71,7 @@ namespace swift::misc QVariant CPlatform::propertyByIndex(swift::misc::CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexPlatform: return QVariant::fromValue(m_platform); @@ -86,7 +86,7 @@ namespace swift::misc (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexPlatform: this->setPlatform(static_cast(variant.toInt())); break; @@ -97,7 +97,7 @@ namespace swift::misc int CPlatform::comparePropertyByIndex(CPropertyIndexRef index, const CPlatform &compareValue) const { if (index.isMyself()) { return Compare::compare(m_platform, compareValue.m_platform); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexPlatform: return Compare::compare(m_platform, compareValue.m_platform); diff --git a/src/misc/pq/physicalquantity.cpp b/src/misc/pq/physicalquantity.cpp index 2a48d3dad3..4f27ae589b 100644 --- a/src/misc/pq/physicalquantity.cpp +++ b/src/misc/pq/physicalquantity.cpp @@ -492,7 +492,7 @@ namespace swift::misc::physical_quantities QVariant CPhysicalQuantity::propertyByIndex(CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*derived()); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexValue: return QVariant::fromValue(m_value); @@ -514,7 +514,7 @@ namespace swift::misc::physical_quantities (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexValue: m_value = variant.toDouble(); break; @@ -532,7 +532,7 @@ namespace swift::misc::physical_quantities int CPhysicalQuantity::comparePropertyByIndex(CPropertyIndexRef index, const PQ &pq) const { if (index.isMyself()) { return compareImpl(*derived(), pq); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexValue: return Compare::compare(m_value, pq.m_value); diff --git a/src/misc/provider.h b/src/misc/provider.h index 4aae20a016..8bb7a52978 100644 --- a/src/misc/provider.h +++ b/src/misc/provider.h @@ -59,7 +59,7 @@ namespace swift::misc if (m_provider == provider) { return; } if (m_provider) { m_lastProviderConnections.disconnectAll(); } m_provider = provider; // new provider - IProvider *iProvider = dynamic_cast(provider); + auto iProvider = dynamic_cast(provider); if (iProvider && iProvider->asQObject()) { QMetaObject::Connection con = QObject::connect(iProvider->asQObject(), &QObject::destroyed, diff --git a/src/misc/rgbcolor.cpp b/src/misc/rgbcolor.cpp index 2e69ab2220..603eb0b491 100644 --- a/src/misc/rgbcolor.cpp +++ b/src/misc/rgbcolor.cpp @@ -169,7 +169,7 @@ namespace swift::misc QVariant CRgbColor::propertyByIndex(swift::misc::CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexBlue: return QVariant::fromValue(blue()); @@ -187,7 +187,7 @@ namespace swift::misc (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexBlue: m_b = variant.toInt(); break; @@ -201,7 +201,7 @@ namespace swift::misc int CRgbColor::comparePropertyByIndex(CPropertyIndexRef index, const CRgbColor &compareValue) const { if (index.isMyself()) { return this->compare(compareValue); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexBlue: return Compare::compare(m_b, compareValue.m_b); diff --git a/src/misc/simulation/aircraftmatchersetup.cpp b/src/misc/simulation/aircraftmatchersetup.cpp index 69e8b31a28..e7a5d31244 100644 --- a/src/misc/simulation/aircraftmatchersetup.cpp +++ b/src/misc/simulation/aircraftmatchersetup.cpp @@ -96,7 +96,7 @@ namespace swift::misc::simulation QVariant CAircraftMatcherSetup::propertyByIndex(CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexMatchingAlgorithm: return QVariant::fromValue(m_algorithm); @@ -119,7 +119,7 @@ namespace swift::misc::simulation (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexMatchingAlgorithm: m_algorithm = variant.toInt(); break; diff --git a/src/misc/simulation/aircraftmodel.cpp b/src/misc/simulation/aircraftmodel.cpp index f63aa00c03..b0063ed9a7 100644 --- a/src/misc/simulation/aircraftmodel.cpp +++ b/src/misc/simulation/aircraftmodel.cpp @@ -248,7 +248,7 @@ namespace swift::misc::simulation } if (IOrderable::canHandleIndex(index)) { return IOrderable::propertyByIndex(index); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexModelString: return QVariant(m_modelString); @@ -296,7 +296,7 @@ namespace swift::misc::simulation return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexModelString: m_modelString = variant.toString(); break; @@ -347,7 +347,7 @@ namespace swift::misc::simulation } if (IOrderable::canHandleIndex(index)) { return IOrderable::comparePropertyByIndex(index, compareValue); } if (index.isMyself()) { return m_modelString.compare(compareValue.getModelString(), Qt::CaseInsensitive); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexModelString: return m_modelString.compare(compareValue.getModelString(), Qt::CaseInsensitive); diff --git a/src/misc/simulation/distributor.cpp b/src/misc/simulation/distributor.cpp index f60997b8e9..d0631dbd68 100644 --- a/src/misc/simulation/distributor.cpp +++ b/src/misc/simulation/distributor.cpp @@ -65,7 +65,7 @@ namespace swift::misc::simulation } if (IOrderable::canHandleIndex(index)) { return IOrderable::propertyByIndex(index); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexAlias1: return QVariant::fromValue(m_alias1); @@ -94,7 +94,7 @@ namespace swift::misc::simulation return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexAlias1: m_alias1 = variant.value(); break; @@ -113,7 +113,7 @@ namespace swift::misc::simulation } if (IOrderable::canHandleIndex(index)) { return IOrderable::comparePropertyByIndex(index, compareValue); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexAlias1: return m_alias1.compare(compareValue.m_alias1, Qt::CaseInsensitive); diff --git a/src/misc/simulation/fscommon/aircraftcfgentries.cpp b/src/misc/simulation/fscommon/aircraftcfgentries.cpp index 09fce8f2ad..feae23bf80 100644 --- a/src/misc/simulation/fscommon/aircraftcfgentries.cpp +++ b/src/misc/simulation/fscommon/aircraftcfgentries.cpp @@ -128,7 +128,7 @@ namespace swift::misc::simulation::fscommon { if (index.isMyself()) { return QVariant::fromValue(*this); } if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::propertyByIndex(index); } - ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexEntryIndex: return QVariant::fromValue(m_index); @@ -163,7 +163,7 @@ namespace swift::misc::simulation::fscommon ITimestampBased::setPropertyByIndex(index, variant); return; } - ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexEntryIndex: this->setIndex(variant.toInt()); break; diff --git a/src/misc/simulation/fscommon/bcdconversions.cpp b/src/misc/simulation/fscommon/bcdconversions.cpp index 904bb752b0..ca701f0388 100644 --- a/src/misc/simulation/fscommon/bcdconversions.cpp +++ b/src/misc/simulation/fscommon/bcdconversions.cpp @@ -22,7 +22,7 @@ namespace swift::misc::simulation::fscommon quint32 CBcdConversions::transponderCodeToBcd(const swift::misc::aviation::CTransponder &transponder) { // FSX documentation is wrong, we need to use kHz + 2 digits, not Hz - quint32 t = static_cast(transponder.getTransponderCode()); + auto t = static_cast(transponder.getTransponderCode()); t = dec2Bcd(t); return t; } diff --git a/src/misc/simulation/fscommon/vpilotmodelrule.cpp b/src/misc/simulation/fscommon/vpilotmodelrule.cpp index 51c98bdfdf..0f5340af50 100644 --- a/src/misc/simulation/fscommon/vpilotmodelrule.cpp +++ b/src/misc/simulation/fscommon/vpilotmodelrule.cpp @@ -48,7 +48,7 @@ namespace swift::misc::simulation::fscommon { if (index.isMyself()) { return QVariant::fromValue(*this); } if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::propertyByIndex(index); } - ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexModelName: return QVariant::fromValue(this->m_modelName); @@ -71,7 +71,7 @@ namespace swift::misc::simulation::fscommon ITimestampBased::setPropertyByIndex(index, variant); return; } - ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexModelName: this->setModelName(variant.value()); break; diff --git a/src/misc/simulation/interpolation/interpolationrenderingsetup.cpp b/src/misc/simulation/interpolation/interpolationrenderingsetup.cpp index 1c749d8280..51797bedb2 100644 --- a/src/misc/simulation/interpolation/interpolationrenderingsetup.cpp +++ b/src/misc/simulation/interpolation/interpolationrenderingsetup.cpp @@ -95,7 +95,7 @@ namespace swift::misc::simulation QVariant CInterpolationAndRenderingSetupBase::propertyByIndex(CPropertyIndexRef index) const { - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexLogInterpolation: return QVariant::fromValue(m_logInterpolation); @@ -115,7 +115,7 @@ namespace swift::misc::simulation void CInterpolationAndRenderingSetupBase::setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant) { - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexLogInterpolation: m_logInterpolation = variant.toBool(); return; @@ -272,7 +272,7 @@ namespace swift::misc::simulation QVariant CInterpolationAndRenderingSetupGlobal::propertyByIndex(CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexMaxRenderedAircraft: return QVariant::fromValue(m_maxRenderedAircraft); @@ -293,7 +293,7 @@ namespace swift::misc::simulation *this = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexMaxRenderedAircraft: m_maxRenderedAircraft = variant.toInt(); return; @@ -355,7 +355,7 @@ namespace swift::misc::simulation QVariant CInterpolationAndRenderingSetupPerCallsign::propertyByIndex(CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexCallsign: return m_callsign.propertyByIndex(index.copyFrontRemoved()); @@ -372,7 +372,7 @@ namespace swift::misc::simulation *this = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexCallsign: m_callsign.setPropertyByIndex(index.copyFrontRemoved(), variant); return; diff --git a/src/misc/simulation/interpolation/interpolatorspline.cpp b/src/misc/simulation/interpolation/interpolatorspline.cpp index ba037767c0..5bd7911f7d 100644 --- a/src/misc/simulation/interpolation/interpolatorspline.cpp +++ b/src/misc/simulation/interpolation/interpolatorspline.cpp @@ -42,7 +42,7 @@ namespace swift::misc::simulation // back substitution for (int i = N - 2; i >= 0; --i) { - const size_t it = static_cast(i); + const auto it = static_cast(i); d[it] -= c(it) * d[it + 1]; } return d; @@ -243,8 +243,8 @@ namespace swift::misc::simulation // we use different offset times for fast pos. updates // KB: is that correct with dt2, or would it be m_nextSampleTime - m_prevSampleTime // as long as the offset time is constant, it does not matter - const double dt1 = static_cast(m_currentTimeMsSinceEpoch - m_prevSampleAdjustedTime); - const double dt2 = static_cast(m_nextSampleAdjustedTime - m_prevSampleAdjustedTime); + const auto dt1 = static_cast(m_currentTimeMsSinceEpoch - m_prevSampleAdjustedTime); + const auto dt2 = static_cast(m_nextSampleAdjustedTime - m_prevSampleAdjustedTime); double timeFraction = dt1 / dt2; if (CBuildConfig::isLocalDeveloperDebugBuild()) diff --git a/src/misc/simulation/matchingstatisticsentry.cpp b/src/misc/simulation/matchingstatisticsentry.cpp index a9d0c58260..37c196b812 100644 --- a/src/misc/simulation/matchingstatisticsentry.cpp +++ b/src/misc/simulation/matchingstatisticsentry.cpp @@ -79,7 +79,7 @@ namespace swift::misc::simulation if (index.isMyself()) { return QVariant::fromValue(*this); } if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::propertyByIndex(index); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexSessionId: return QVariant::fromValue(m_sessionId); @@ -109,7 +109,7 @@ namespace swift::misc::simulation return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexSessionId: this->setSessionId(variant.value()); break; @@ -130,7 +130,7 @@ namespace swift::misc::simulation { return ITimestampBased::comparePropertyByIndex(index, compareValue); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexSessionId: return m_sessionId.compare(compareValue.m_sessionId, Qt::CaseInsensitive); diff --git a/src/misc/simulation/modelconverterx.cpp b/src/misc/simulation/modelconverterx.cpp index ebfdfb067b..21426ad3ed 100644 --- a/src/misc/simulation/modelconverterx.cpp +++ b/src/misc/simulation/modelconverterx.cpp @@ -46,7 +46,7 @@ namespace swift::misc::simulation else { old->deleteLater(); } } - QProcess *process = new QProcess(parent); + auto process = new QProcess(parent); const QString argument = QDir::toNativeSeparators(model.getFileName()); process->setProgram(modelConverterX); process->setArguments({ argument }); diff --git a/src/misc/simulation/ownaircraftproviderdummy.cpp b/src/misc/simulation/ownaircraftproviderdummy.cpp index 7dfb53cada..b2f397b6bf 100644 --- a/src/misc/simulation/ownaircraftproviderdummy.cpp +++ b/src/misc/simulation/ownaircraftproviderdummy.cpp @@ -140,7 +140,7 @@ namespace swift::misc::simulation COwnAircraftProviderDummy *COwnAircraftProviderDummy::instance() { - static COwnAircraftProviderDummy *dummy = new COwnAircraftProviderDummy(); + static auto dummy = new COwnAircraftProviderDummy(); return dummy; } } // namespace swift::misc::simulation diff --git a/src/misc/simulation/remoteaircraftproviderdummy.cpp b/src/misc/simulation/remoteaircraftproviderdummy.cpp index df6d61ae35..a879356150 100644 --- a/src/misc/simulation/remoteaircraftproviderdummy.cpp +++ b/src/misc/simulation/remoteaircraftproviderdummy.cpp @@ -13,7 +13,7 @@ namespace swift::misc::simulation { CRemoteAircraftProviderDummy *CRemoteAircraftProviderDummy::instance() { - static CRemoteAircraftProviderDummy *dummy = new CRemoteAircraftProviderDummy(); + static auto dummy = new CRemoteAircraftProviderDummy(); return dummy; } diff --git a/src/misc/simulation/settings/fgswiftbussettings.cpp b/src/misc/simulation/settings/fgswiftbussettings.cpp index 47886436d5..9c1098bb7e 100644 --- a/src/misc/simulation/settings/fgswiftbussettings.cpp +++ b/src/misc/simulation/settings/fgswiftbussettings.cpp @@ -10,7 +10,7 @@ namespace swift::misc::simulation::settings QVariant CFGSwiftBusSettings::propertyByIndex(swift::misc::CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexDBusServerAddress: return QVariant::fromValue(m_dBusServerAddress); @@ -27,7 +27,7 @@ namespace swift::misc::simulation::settings return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexDBusServerAddress: m_dBusServerAddress = variant.toString(); break; diff --git a/src/misc/simulation/settings/modelsettings.cpp b/src/misc/simulation/settings/modelsettings.cpp index 6c5844293a..397bdcfa46 100644 --- a/src/misc/simulation/settings/modelsettings.cpp +++ b/src/misc/simulation/settings/modelsettings.cpp @@ -20,7 +20,7 @@ namespace swift::misc::simulation::settings QVariant CModelSettings::propertyByIndex(CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexAllowExclude: return QVariant::fromValue(this->m_allowExcludeModels); @@ -35,7 +35,7 @@ namespace swift::misc::simulation::settings (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexAllowExclude: this->setAllowExcludedModels(variant.toBool()); break; diff --git a/src/misc/simulation/settings/simulatorsettings.cpp b/src/misc/simulation/settings/simulatorsettings.cpp index 896d80d5a9..5a1757663c 100644 --- a/src/misc/simulation/settings/simulatorsettings.cpp +++ b/src/misc/simulation/settings/simulatorsettings.cpp @@ -140,7 +140,7 @@ namespace swift::misc::simulation::settings QVariant CSimulatorSettings::propertyByIndex(CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexSimulatorDirectory: return QVariant::fromValue(m_simulatorDirectory); @@ -161,7 +161,7 @@ namespace swift::misc::simulation::settings (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexSimulatorDirectory: this->setSimulatorDirectory(variant.toString()); break; @@ -509,7 +509,7 @@ namespace swift::misc::simulation::settings QVariant CSimulatorMessagesSettings::propertyByIndex(CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexTechnicalLogSeverity: return QVariant::fromValue(m_technicalLogLevel); @@ -526,7 +526,7 @@ namespace swift::misc::simulation::settings (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexTechnicalLogSeverity: diff --git a/src/misc/simulation/settings/swiftpluginsettings.cpp b/src/misc/simulation/settings/swiftpluginsettings.cpp index 1a9508ad8f..e28b4bfde3 100644 --- a/src/misc/simulation/settings/swiftpluginsettings.cpp +++ b/src/misc/simulation/settings/swiftpluginsettings.cpp @@ -28,7 +28,7 @@ namespace swift::misc::simulation::settings QVariant CSwiftPluginSettings::propertyByIndex(CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexEmulatedSimulator: return this->m_emulatedSimulator.propertyByIndex(index.copyFrontRemoved()); @@ -46,7 +46,7 @@ namespace swift::misc::simulation::settings (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexEmulatedSimulator: diff --git a/src/misc/simulation/settings/xswiftbussettings.cpp b/src/misc/simulation/settings/xswiftbussettings.cpp index 976f810387..73c1ec5858 100644 --- a/src/misc/simulation/settings/xswiftbussettings.cpp +++ b/src/misc/simulation/settings/xswiftbussettings.cpp @@ -17,7 +17,7 @@ namespace swift::misc::simulation::settings { if (index.isMyself()) { return QVariant::fromValue(*this); } if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::propertyByIndex(index); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexMaxPlanes: return QVariant::fromValue(m_maxPlanes); @@ -42,7 +42,7 @@ namespace swift::misc::simulation::settings } if (ITimestampBased::canHandleIndex(index)) { ITimestampBased::setPropertyByIndex(index, variant); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexMaxPlanes: m_maxPlanes = variant.toInt(); break; diff --git a/src/misc/simulation/simulatedaircraft.cpp b/src/misc/simulation/simulatedaircraft.cpp index a689eadd22..53c5e52b25 100644 --- a/src/misc/simulation/simulatedaircraft.cpp +++ b/src/misc/simulation/simulatedaircraft.cpp @@ -321,7 +321,7 @@ namespace swift::misc::simulation QVariant CSimulatedAircraft::propertyByIndex(swift::misc::CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexModel: return this->getModel().propertyByIndex(index.copyFrontRemoved()); @@ -362,7 +362,7 @@ namespace swift::misc::simulation (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexCallsign: m_callsign.setPropertyByIndex(index.copyFrontRemoved(), variant); break; @@ -401,7 +401,7 @@ namespace swift::misc::simulation { return m_callsign.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getCallsign()); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexCallsign: diff --git a/src/misc/simulation/simulatorinternals.cpp b/src/misc/simulation/simulatorinternals.cpp index 310cfd9235..57fc251bf5 100644 --- a/src/misc/simulation/simulatorinternals.cpp +++ b/src/misc/simulation/simulatorinternals.cpp @@ -62,7 +62,7 @@ namespace swift::misc::simulation QVariant CSimulatorInternals::propertyByIndex(swift::misc::CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexData: return QVariant::fromValue(m_data); @@ -77,7 +77,7 @@ namespace swift::misc::simulation (*this) = variant.value(); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexData: m_data = variant.value(); break; diff --git a/src/misc/statusmessage.cpp b/src/misc/statusmessage.cpp index b7eb924d77..f1eb9edd9d 100644 --- a/src/misc/statusmessage.cpp +++ b/src/misc/statusmessage.cpp @@ -397,7 +397,7 @@ namespace swift::misc if (index.isMyself()) { return QVariant::fromValue(*this); } if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::propertyByIndex(index); } if (IOrderable::canHandleIndex(index)) { return IOrderable::propertyByIndex(index); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexMessage: return QVariant::fromValue(this->getMessage()); @@ -427,7 +427,7 @@ namespace swift::misc IOrderable::setPropertyByIndex(index, variant); return; } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexMessage: @@ -448,7 +448,7 @@ namespace swift::misc return ITimestampBased::comparePropertyByIndex(index, compareValue); } if (IOrderable::canHandleIndex(index)) { return IOrderable::comparePropertyByIndex(index, compareValue); } - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexMessageAsHtml: diff --git a/src/misc/test/testservice.cpp b/src/misc/test/testservice.cpp index 606b7c800d..08cc9e061c 100644 --- a/src/misc/test/testservice.cpp +++ b/src/misc/test/testservice.cpp @@ -56,7 +56,7 @@ namespace swift::misc::test CTestService *CTestService::registerTestService(QDBusConnection &connection, bool verbose, QObject *parent) { - CTestService *pTestService = new CTestService( + const auto pTestService = new CTestService( verbose, parent); // just a QObject with signals / slots and Q_CLASSINFO("D-Bus Interface", some service name) if (!connection.registerService(CTestService::InterfaceName())) diff --git a/src/misc/timestampbased.cpp b/src/misc/timestampbased.cpp index 3af490ee58..eaf5ed9d99 100644 --- a/src/misc/timestampbased.cpp +++ b/src/misc/timestampbased.cpp @@ -154,7 +154,7 @@ namespace swift::misc { if (!index.isEmpty()) { - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexUtcTimestamp: return QVariant::fromValue(this->getUtcTimestamp()); @@ -178,7 +178,7 @@ namespace swift::misc { if (!index.isEmpty()) { - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexUtcTimestamp: this->setUtcTimestamp(variant.toDateTime()); return; @@ -271,7 +271,7 @@ namespace swift::misc if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::propertyByIndex(index); } if (!index.isEmpty()) { - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexOffsetMs: @@ -303,7 +303,7 @@ namespace swift::misc } if (!index.isEmpty()) { - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexOffsetMs: @@ -329,7 +329,7 @@ namespace swift::misc } if (!index.isEmpty()) { - const ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexOffsetWithUnit: diff --git a/src/misc/variant.cpp b/src/misc/variant.cpp index 4a7eee0112..fdf6bb3c99 100644 --- a/src/misc/variant.cpp +++ b/src/misc/variant.cpp @@ -533,7 +533,7 @@ namespace swift::misc // complex, user type // it has to be made sure, that the cast works - const QDBusArgument arg = variant.value(); + const auto arg = variant.value(); constexpr int userType = static_cast(QMetaType::User); if (localUserType.id() < userType) { diff --git a/src/misc/weather/presentweather.cpp b/src/misc/weather/presentweather.cpp index aca47a5138..17086b38a1 100644 --- a/src/misc/weather/presentweather.cpp +++ b/src/misc/weather/presentweather.cpp @@ -24,7 +24,7 @@ namespace swift::misc::weather QVariant CPresentWeather::propertyByIndex(swift::misc::CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexIntensity: return QVariant::fromValue(m_intensity); @@ -41,7 +41,7 @@ namespace swift::misc::weather (*this) = variant.value(); return; } - ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexIntensity: setIntensity(variant.value()); break; diff --git a/src/misc/weather/windlayer.cpp b/src/misc/weather/windlayer.cpp index 464af8637c..75d5ead3ed 100644 --- a/src/misc/weather/windlayer.cpp +++ b/src/misc/weather/windlayer.cpp @@ -22,7 +22,7 @@ namespace swift::misc::weather QVariant CWindLayer::propertyByIndex(swift::misc::CPropertyIndexRef index) const { if (index.isMyself()) { return QVariant::fromValue(*this); } - ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexLevel: return QVariant::fromValue(m_level); @@ -41,7 +41,7 @@ namespace swift::misc::weather (*this) = variant.value(); return; } - ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexLevel: setLevel(variant.value()); break; diff --git a/src/plugins/simulator/flightgearconfig/simulatorflightgearconfig.cpp b/src/plugins/simulator/flightgearconfig/simulatorflightgearconfig.cpp index 87137822c1..6e9998c1e0 100644 --- a/src/plugins/simulator/flightgearconfig/simulatorflightgearconfig.cpp +++ b/src/plugins/simulator/flightgearconfig/simulatorflightgearconfig.cpp @@ -13,7 +13,7 @@ namespace swift::simplugin::flightgear swift::gui::CPluginConfigWindow *CSimulatorFlightgearConfig::createConfigWindow(QWidget *parent) { - CSimulatorFlightgearConfigWindow *w = new CSimulatorFlightgearConfigWindow(parent); + auto w = new CSimulatorFlightgearConfigWindow(parent); return w; } } // namespace swift::simplugin::flightgear diff --git a/src/plugins/simulator/plugincommon/simulatorplugincommon.cpp b/src/plugins/simulator/plugincommon/simulatorplugincommon.cpp index 815f72b92f..b4133006dd 100644 --- a/src/plugins/simulator/plugincommon/simulatorplugincommon.cpp +++ b/src/plugins/simulator/plugincommon/simulatorplugincommon.cpp @@ -45,7 +45,7 @@ namespace swift::simplugin::common if (!m_interpolationDisplayDialog) { QWidget *parentWidget = sGui ? sGui->mainApplicationWidget() : nullptr; - CInterpolationLogDisplayDialog *dialog = new CInterpolationLogDisplayDialog(this, nullptr, parentWidget); + auto *dialog = new CInterpolationLogDisplayDialog(this, nullptr, parentWidget); m_interpolationDisplayDialog = dialog; m_interpolationDisplayDialog->setModal(false); } diff --git a/src/plugins/simulator/xplaneconfig/simulatorxplaneconfig.cpp b/src/plugins/simulator/xplaneconfig/simulatorxplaneconfig.cpp index d120088eee..c5d4661d3c 100644 --- a/src/plugins/simulator/xplaneconfig/simulatorxplaneconfig.cpp +++ b/src/plugins/simulator/xplaneconfig/simulatorxplaneconfig.cpp @@ -16,7 +16,7 @@ namespace swift::simplugin::xplane swift::gui::CPluginConfigWindow *CSimulatorXPlaneConfig::createConfigWindow(QWidget *parent) { - CSimulatorXPlaneConfigWindow *w = new CSimulatorXPlaneConfigWindow(parent); + auto *w = new CSimulatorXPlaneConfigWindow(parent); return w; } } // namespace swift::simplugin::xplane diff --git a/src/sound/notificationplayer.cpp b/src/sound/notificationplayer.cpp index 511be0f1b0..bc7862f04c 100644 --- a/src/sound/notificationplayer.cpp +++ b/src/sound/notificationplayer.cpp @@ -91,7 +91,7 @@ namespace swift::sound // new effect // QString fn = url.toLocalFile(); - QSoundEffect *effect = new QSoundEffect(this); + auto effect = new QSoundEffect(this); effect->setSource(url); effect->setLoopCount(1); effect->setMuted(false); diff --git a/src/sound/sampleprovider/pinknoisegenerator.cpp b/src/sound/sampleprovider/pinknoisegenerator.cpp index afe24813c3..1b004765ec 100644 --- a/src/sound/sampleprovider/pinknoisegenerator.cpp +++ b/src/sound/sampleprovider/pinknoisegenerator.cpp @@ -26,7 +26,7 @@ namespace swift::sound::sample_provider double pink = m_pinkNoiseBuffer[0] + m_pinkNoiseBuffer[1] + m_pinkNoiseBuffer[2] + m_pinkNoiseBuffer[3] + m_pinkNoiseBuffer[4] + m_pinkNoiseBuffer[5] + m_pinkNoiseBuffer[6] + white * 0.5362; m_pinkNoiseBuffer[6] = white * 0.115926; - const float sampleValue = static_cast(m_gain * (pink / 5)); + const auto sampleValue = static_cast(m_gain * (pink / 5)); samples[sampleCount] = sampleValue; } return c; diff --git a/src/sound/threadedtonepairplayer.cpp b/src/sound/threadedtonepairplayer.cpp index f61d31ac29..d86e4923da 100644 --- a/src/sound/threadedtonepairplayer.cpp +++ b/src/sound/threadedtonepairplayer.cpp @@ -134,7 +134,7 @@ namespace swift::sound qint64 bytesPerTonePair = m_audioFormat.sampleRate() * bytesForAllChannels * tonePair.getDurationMs().count() / 1000; bufferData.resize(static_cast(bytesPerTonePair)); - unsigned char *bufferPointer = reinterpret_cast(bufferData.data()); + auto bufferPointer = reinterpret_cast(bufferData.data()); qint64 last0AmplitudeSample = bytesPerTonePair; // last sample when amplitude was 0 int sampleIndexPerTonePair = 0; @@ -201,7 +201,7 @@ namespace swift::sound { Q_ASSERT(this->m_audioFormat.sampleFormat() == QAudioFormat::Int16); static_assert(Q_BYTE_ORDER == Q_LITTLE_ENDIAN); - const qint16 value = static_cast(amplitude * 32767); + const auto value = static_cast(amplitude * 32767); #if Q_BYTE_ORDER == Q_BIG_ENDIAN qToBigEndian(value, bufferPointer); diff --git a/src/sound/wav/wavfile.cpp b/src/sound/wav/wavfile.cpp index 7035895e3b..19624d8643 100644 --- a/src/sound/wav/wavfile.cpp +++ b/src/sound/wav/wavfile.cpp @@ -109,7 +109,7 @@ namespace swift::sound::wav if (memcmp(&dataHeader.descriptor.id, "data", 4) == 0) { - const qint32 dataLength = qFromLittleEndian(dataHeader.descriptor.size); + const auto dataLength = qFromLittleEndian(dataHeader.descriptor.size); m_audioData = read(dataLength); if (m_audioData.size() != dataLength) { diff --git a/src/swiftguistandard/swiftguistd.cpp b/src/swiftguistandard/swiftguistd.cpp index f644c95327..78a0781b3e 100644 --- a/src/swiftguistandard/swiftguistd.cpp +++ b/src/swiftguistandard/swiftguistd.cpp @@ -184,7 +184,7 @@ QAction *SwiftGuiStd::getWindowMinimizeAction(QObject *parent) { const QIcon i(CIcons::changeIconBackgroundColor(this->style()->standardIcon(QStyle::SP_TitleBarMinButton), Qt::white, QSize(16, 16))); - QAction *a = new QAction(i, "Window minimized", parent); + auto a = new QAction(i, "Window minimized", parent); connect(a, &QAction::triggered, this, &SwiftGuiStd::showMinimized); return a; } @@ -193,7 +193,7 @@ QAction *SwiftGuiStd::getWindowNormalAction(QObject *parent) { const QIcon i(CIcons::changeIconBackgroundColor(this->style()->standardIcon(QStyle::SP_TitleBarNormalButton), Qt::white, QSize(16, 16))); - QAction *a = new QAction(i, "Window normal", parent); + auto a = new QAction(i, "Window normal", parent); connect(a, &QAction::triggered, this, &SwiftGuiStd::showNormal); return a; } @@ -202,7 +202,7 @@ QAction *SwiftGuiStd::getToggleWindowVisibilityAction(QObject *parent) { const QIcon i(CIcons::changeIconBackgroundColor(this->style()->standardIcon(QStyle::SP_TitleBarShadeButton), Qt::white, QSize(16, 16))); - QAction *a = new QAction(i, "Toogle main window visibility", parent); + auto a = new QAction(i, "Toogle main window visibility", parent); connect(a, &QAction::triggered, this, &SwiftGuiStd::toggleWindowVisibility); return a; } @@ -211,7 +211,7 @@ QAction *SwiftGuiStd::getToggleStayOnTopAction(QObject *parent) { const QIcon i(CIcons::changeIconBackgroundColor(this->style()->standardIcon(QStyle::SP_TitleBarUnshadeButton), Qt::white, QSize(16, 16))); - QAction *a = new QAction(i, "Toogle main window on top", parent); + auto a = new QAction(i, "Toogle main window on top", parent); connect(a, &QAction::triggered, this, &SwiftGuiStd::toggleWindowStayOnTop); return a; } diff --git a/tests/core/fsd/testfsdclient/testfsdclient.cpp b/tests/core/fsd/testfsdclient/testfsdclient.cpp index 53885d2f5c..35cf4d4ccb 100644 --- a/tests/core/fsd/testfsdclient/testfsdclient.cpp +++ b/tests/core/fsd/testfsdclient/testfsdclient.cpp @@ -194,7 +194,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); - CTextMessageList messages = arguments.at(0).value(); + auto messages = arguments.at(0).value(); QCOMPARE(messages.size(), 1); CTextMessage message = messages.front(); QCOMPARE(message.getMessage(), "Hey how are you doing?"); @@ -216,7 +216,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); - CTextMessageList receivedMessages = arguments.at(0).value(); + auto receivedMessages = arguments.at(0).value(); QCOMPARE(receivedMessages.size(), 1); CTextMessage message = receivedMessages.front(); QCOMPARE(message.getMessage(), text); @@ -247,7 +247,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE(fsdMessage.getRawMessage(), "FSD Sent=>$CQABCD:EDLW_TWR:ATIS"); } @@ -293,8 +293,8 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 2); - const CAircraftSituation situation = arguments.at(0).value(); - const CTransponder transponder = arguments.at(1).value(); + const auto situation = arguments.at(0).value(); + const auto transponder = arguments.at(1).value(); QCOMPARE(situation.getCallsign().asString(), "ABCD"); QCOMPARE(transponder.getTransponderMode(), CTransponder::ModeC); @@ -390,7 +390,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 2); - CClient::Capabilities caps = arguments.at(1).value(); + auto caps = arguments.at(1).value(); QVERIFY(caps.testFlag(CClient::FsdWithAircraftConfig)); } @@ -433,7 +433,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE(fsdMessage.getRawMessage(), "FSD Sent=>#APABCD:SERVER:1234567:123456:1:101:16:Test User"); } @@ -447,7 +447,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE(fsdMessage.getRawMessage(), "FSD Sent=>#AAABCD:SERVER:Test User:1234567:123456:5:101"); } @@ -460,7 +460,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE(fsdMessage.getRawMessage(), "FSD Sent=>#DPABCD:1234567"); } @@ -473,7 +473,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE(fsdMessage.getRawMessage(), "FSD Sent=>#DAABCD:1234567"); } @@ -503,7 +503,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 2); const QList arguments = spy.takeLast(); QCOMPARE(arguments.size(), 1); - const CRawFsdMessage fsdMessage = arguments.at(0).value(); + const auto fsdMessage = arguments.at(0).value(); const QString fsdRawMessage = fsdMessage.getRawMessage(); // PilotRating::Student @@ -536,7 +536,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 2); QList arguments = spy.takeLast(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); // changed after we changed to PB inversion to *-1 // now also Pilot rating to Student @@ -570,7 +570,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 2); QList arguments = spy.takeLast(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); // changed after we changed to PB inversion to *-1 // pilot rating now STUDENT @@ -585,7 +585,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE(fsdMessage.getRawMessage(), "FSD Sent=>%ABCD:99998:0:300:1:48.11028:8.56972:0"); } @@ -597,7 +597,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QVERIFY(fsdMessage.getRawMessage().contains("FSD Sent=>$PIABCD:SERVER:")); } @@ -609,7 +609,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE(fsdMessage.getRawMessage(), "FSD Sent=>$POABCD:SERVER:123456789"); } @@ -621,7 +621,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE(fsdMessage.getRawMessage(), "FSD Sent=>$CRABCD:ZZZZ_TWR:RN:Test User::1"); } @@ -633,7 +633,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE(fsdMessage.getRawMessage(), "FSD Sent=>$CRABCD:ZZZZ_TWR:CAPS:ATCINFO=1:MODELDESC=1:ACCONFIG=1"); } @@ -645,7 +645,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE(fsdMessage.getRawMessage(), "FSD Sent=>$CQABCD:ZZZZ_TWR:RN"); } @@ -657,7 +657,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE(fsdMessage.getRawMessage(), "FSD Sent=>$CQABCD:SERVER:ATC:EDDM_TWR"); } @@ -669,7 +669,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE(fsdMessage.getRawMessage(), "FSD Sent=>$CQABCD:DLH123:ACC:{\"request\":\"full\"}"); } @@ -681,7 +681,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE(fsdMessage.getRawMessage(), "FSD Sent=>#TMABCD:ZZZZ_TWR:hey dude!"); } @@ -693,7 +693,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE(fsdMessage.getRawMessage(), "FSD Sent=>#TMABCD:*S:Please help!!!"); } @@ -706,7 +706,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE(fsdMessage.getRawMessage(), "FSD Sent=>#TMABCD:@24050:hey dude!"); } @@ -719,7 +719,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE(fsdMessage.getRawMessage(), "FSD Sent=>#TMABCD:@24050&@35725:hey dude!"); } @@ -741,7 +741,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE( fsdMessage.getRawMessage(), "FSD Sent=>$FPABCD:SERVER:V:H/B744/L:420:EGLL:1530:1535:FL350:KORD:8:15:9:30:NONE:UNIT TEST:EGLL.KORD"); @@ -768,7 +768,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE( fsdMessage.getRawMessage(), "FSD Sent=>$FPABCD:SERVER:V:B748/H-SDE3FGHIM1M2RWXY/LB1:420:EGLL:1530:1535:FL350:KORD:8:15:9:30:NONE:UNIT " @@ -783,7 +783,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE(fsdMessage.getRawMessage(), "FSD Sent=>#SBABCD:XYZ:PIR"); } @@ -795,7 +795,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE(fsdMessage.getRawMessage(), "FSD Sent=>#SBABCD:XYZ:PI:GEN:EQUIPMENT=B744:AIRLINE=BAW"); } @@ -807,7 +807,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE(fsdMessage.getRawMessage(), "FSD Sent=>#SBABCD:XYZ:PI:GEN:EQUIPMENT=B744:AIRLINE=BAW:LIVERY=UNION"); } @@ -819,7 +819,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE(fsdMessage.getRawMessage(), "FSD Sent=>#SBABCD:XYZ:PI:GEN:EQUIPMENT=B744"); } @@ -831,19 +831,19 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE(fsdMessage.getRawMessage(), "FSD Sent=>#SBABCD:XYZ:PI:GEN:LIVERY=UNION"); } void CTestFSDClient::testSendAircraftConfiguration() { QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage); - m_client->sendAircraftConfiguration("XYZ", "{\"request\":\"full\"}"); + m_client->sendAircraftConfiguration("XYZ", R"({"request":"full"})"); QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE(fsdMessage.getRawMessage(), "FSD Sent=>$CQABCD:XYZ:ACC:{\"request\":\"full\"}"); } @@ -860,7 +860,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE(fsdMessage.getRawMessage(), "FSD Sent=>$CQABCD:@94836:ACC:{\"config\":{\"gear_down\":true}}"); } @@ -872,7 +872,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 2); QList arguments = spy.takeAt(1); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE(fsdMessage.getRawMessage(), "FSD Sent=>$CRABCD:EDMM_CTR:C?:123.000"); } @@ -884,7 +884,7 @@ namespace SwiftFsdTest QCOMPARE(spy.count(), 2); QList arguments = spy.takeAt(1); QCOMPARE(arguments.size(), 1); - CRawFsdMessage fsdMessage = arguments.at(0).value(); + auto fsdMessage = arguments.at(0).value(); QCOMPARE(fsdMessage.getRawMessage(), "FSD Sent=>#SBABCD:EDMM_CTR:PI:GEN:EQUIPMENT=B737:AIRLINE=BER"); } diff --git a/tests/misc/pq/testphysicalquantities/testphysicalquantities.cpp b/tests/misc/pq/testphysicalquantities/testphysicalquantities.cpp index d69a5913e1..d32ffcc1dc 100644 --- a/tests/misc/pq/testphysicalquantities/testphysicalquantities.cpp +++ b/tests/misc/pq/testphysicalquantities/testphysicalquantities.cpp @@ -285,13 +285,13 @@ namespace MiscTest void CTestPhysicalQuantities::memoryTests() { - CLength *c = new CLength(100, CLengthUnit::m()); + auto c = new CLength(100, CLengthUnit::m()); c->switchUnit(CLengthUnit::NM()); QVERIFY2(c->getUnit() == CLengthUnit::NM() && CLengthUnit::defaultUnit() == CLengthUnit::m(), "Testing distance units failed"); delete c; - CAngle *a = new CAngle(100, CAngleUnit::rad()); + auto a = new CAngle(100, CAngleUnit::rad()); a->switchUnit(CAngleUnit::deg()); QVERIFY2(a->getUnit() == CAngleUnit::deg() && CAngleUnit::defaultUnit() == CAngleUnit::deg(), "Testing angle units failed"); @@ -307,13 +307,13 @@ namespace MiscTest QVERIFY2(CMass(33.45, CMassUnit::kg()) == CMass("33.45000 kg"), "CMass"); // parsing via variant - CSpeed parsedPq1 = CPqString::parseToVariant("100.123 km/h").value(); + auto parsedPq1 = CPqString::parseToVariant("100.123 km/h").value(); QVERIFY2(CSpeed(100.123, CSpeedUnit::km_h()) == parsedPq1, "Parsed speed via variant"); - CLength parsedPq2 = CPqString::parseToVariant("-33.123ft").value(); + auto parsedPq2 = CPqString::parseToVariant("-33.123ft").value(); QVERIFY2(CLength(-33.123, CLengthUnit::ft()) == parsedPq2, "Parsed length via variant"); - CFrequency parsedPq3 = CPqString::parse("122.8MHz"); + auto parsedPq3 = CPqString::parse("122.8MHz"); QVERIFY2(CFrequency(122.8, CFrequencyUnit::MHz()) == parsedPq3, "Parsed frequency via variant"); } diff --git a/tests/misc/testpropertyindex/testpropertyindex.cpp b/tests/misc/testpropertyindex/testpropertyindex.cpp index a94d384e9c..3d987f1c84 100644 --- a/tests/misc/testpropertyindex/testpropertyindex.cpp +++ b/tests/misc/testpropertyindex/testpropertyindex.cpp @@ -42,7 +42,7 @@ namespace MiscTest aircraft.setCallsign("DEIHL"); aircraft.setCom1ActiveFrequency(f); CVariant vf = aircraft.propertyByIndex(i); - const CFrequency pf = vf.value(); + const auto pf = vf.value(); QVERIFY2(pf == f, "Frequencies should have same value"); } diff --git a/tests/misc/testslot/testslot.cpp b/tests/misc/testslot/testslot.cpp index b8a66182cc..bfd23f61d5 100644 --- a/tests/misc/testslot/testslot.cpp +++ b/tests/misc/testslot/testslot.cpp @@ -27,7 +27,7 @@ namespace MiscTest void CTestSlot::slotBasics() { - QObject *obj = new QObject(this); + auto obj = new QObject(this); CSlot slot1 = { obj, [&](const QString &name) { obj->setObjectName(name); } }; QVERIFY2(slot1, "Slot has valid object and function - can be called."); diff --git a/tests/misc/testvalueobject.h b/tests/misc/testvalueobject.h index 02e4d20867..ac84aed429 100644 --- a/tests/misc/testvalueobject.h +++ b/tests/misc/testvalueobject.h @@ -62,7 +62,7 @@ namespace swift::misc CVariant propertyByIndex(const swift::misc::CPropertyIndex &index) const { if (index.isMyself()) { return CVariant::from(*this); } - ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexDescription: return CVariant::fromValue(this->m_description); @@ -79,7 +79,7 @@ namespace swift::misc (*this) = variant.to(); return; } - ColumnIndex i = index.frontCasted(); + const auto i = index.frontCasted(); switch (i) { case IndexDescription: this->setDescription(variant.value()); break; diff --git a/tests/misc/testvariantandmap/testvariantandmap.cpp b/tests/misc/testvariantandmap/testvariantandmap.cpp index be59422c52..a8b460149c 100644 --- a/tests/misc/testvariantandmap/testvariantandmap.cpp +++ b/tests/misc/testvariantandmap/testvariantandmap.cpp @@ -129,7 +129,7 @@ namespace MiscTest CVariant variant = CVariant::from(ints); QVERIFY2(variant.canConvert(), "Variant containing list can convert to CVariantList"); QVERIFY2(variant.convert(qMetaTypeId()), "Variant containing list can convert to CVariantList"); - const CVariantList variantInts = variant.to(); + const auto variantInts = variant.to(); QVERIFY2(ints.size() == variantInts.size(), "Variant list has same size as original list"); QVERIFY2(ints[0] == variantInts[0].to(), "Variant list has same element"); QVERIFY2(variant.canConvert>(), "Variant containing can convert back"); @@ -139,7 +139,7 @@ namespace MiscTest variant = CVariant::from(list); QVERIFY2(variant.canConvert(), "Variant containing list can convert to CVariantList"); QVERIFY2(variant.convert(qMetaTypeId()), "Variant containing list can convert to CVariantList"); - CVariantList variantList = variant.to(); + auto variantList = variant.to(); QVERIFY2(list.size() == variantList.size(), "Variant list has same size as original list"); QVERIFY2(list[0] == variantList[0].to(), "Variant list has same element"); QVERIFY2(variant.canConvert(), "Variant containing can convert back"); From 8f946b77d5f624446e1ee957942fdbd32aaf5dc1 Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Thu, 9 Oct 2025 22:59:25 +0200 Subject: [PATCH 08/21] refactor: Fix clang-tidy modernize-use-override --- .clang-tidy | 1 + src/core/actionbind.cpp | 5 - src/core/actionbind.h | 2 +- src/core/afv/audio/input.h | 6 +- src/core/afv/model/atcstationmodel.cpp | 2 - src/core/afv/model/atcstationmodel.h | 2 +- src/core/aircraftmatcher.h | 6 +- src/core/airspacemonitor.h | 4 +- src/core/context/contextapplicationempty.h | 33 ++- src/core/context/contextapplicationimpl.h | 33 ++- src/core/context/contextapplicationproxy.h | 35 ++- src/core/context/contextaudioproxy.h | 20 +- src/core/context/contextnetwork.h | 4 +- src/core/context/contextnetworkempty.h | 145 +++++----- src/core/context/contextnetworkimpl.h | 267 +++++++++--------- src/core/context/contextnetworkproxy.h | 150 +++++----- src/core/context/contextownaircraft.h | 4 +- src/core/context/contextownaircraftempty.h | 49 ++-- src/core/context/contextownaircraftimpl.cpp | 2 - src/core/context/contextownaircraftimpl.h | 74 +++-- src/core/context/contextownaircraftproxy.h | 54 ++-- src/core/context/contextsimulator.h | 2 +- src/core/context/contextsimulatorempty.h | 104 ++++--- src/core/context/contextsimulatorimpl.h | 110 ++++---- src/core/context/contextsimulatorproxy.h | 110 ++++---- src/core/corefacade.h | 2 +- src/core/data/launchersetup.h | 2 +- src/core/data/networksetup.cpp | 2 - src/core/data/networksetup.h | 4 +- src/core/db/airportdatareader.h | 34 ++- src/core/db/databasereader.h | 2 +- src/core/db/icaodatareader.h | 38 ++- src/core/db/infodatareader.h | 38 ++- src/core/db/modeldatareader.h | 42 ++- src/core/fsd/clientresponse.cpp | 2 - src/core/fsd/clientresponse.h | 2 +- src/core/fsd/euroscopesimdata.cpp | 2 - src/core/fsd/euroscopesimdata.h | 2 +- src/core/fsd/flightplan.cpp | 2 - src/core/fsd/flightplan.h | 2 +- src/core/fsd/messagebase.h | 2 +- src/core/fsd/revbclientparts.cpp | 2 - src/core/fsd/revbclientparts.h | 2 +- src/core/fsd/servererror.cpp | 2 - src/core/fsd/servererror.h | 2 +- src/core/pluginmanagersimulator.h | 6 +- src/core/progress.h | 2 +- src/core/vatsim/vatsimdatafilereader.h | 2 +- src/core/vatsim/vatsimmetarreader.h | 2 +- src/core/vatsim/vatsimsettings.cpp | 4 - src/core/vatsim/vatsimsettings.h | 4 +- src/core/webdataservices.h | 2 +- src/core/webdataservicesms.h | 2 +- src/gui/components/aboutdialog.cpp | 2 +- src/gui/components/aboutdialog.h | 2 +- src/gui/components/abouthtmlcomponent.cpp | 2 +- src/gui/components/abouthtmlcomponent.h | 2 +- .../aircraftcombinedtypeselector.cpp | 2 +- .../components/aircraftcombinedtypeselector.h | 2 +- src/gui/components/aircraftcomponent.cpp | 2 +- src/gui/components/aircraftcomponent.h | 4 +- .../aircraftmodelsetvalidationdialog.cpp | 2 +- .../aircraftmodelsetvalidationdialog.h | 2 +- .../aircraftmodelstringcompleter.cpp | 2 +- .../components/aircraftmodelstringcompleter.h | 2 +- .../aircraftmodelvalidationcomponent.cpp | 2 +- .../aircraftmodelvalidationcomponent.h | 2 +- src/gui/components/aircraftpartscomponent.cpp | 5 +- src/gui/components/aircraftpartscomponent.h | 2 +- src/gui/components/aircraftpartshistory.cpp | 2 +- src/gui/components/aircraftpartshistory.h | 2 +- src/gui/components/airportcompleter.cpp | 2 +- src/gui/components/airportcompleter.h | 2 +- src/gui/components/airportdialog.cpp | 2 +- src/gui/components/airportdialog.h | 2 +- src/gui/components/airportsmallcompleter.cpp | 2 +- src/gui/components/airportsmallcompleter.h | 2 +- src/gui/components/altitudedialog.cpp | 2 +- src/gui/components/altitudedialog.h | 2 +- src/gui/components/applicationclosedialog.cpp | 2 +- src/gui/components/applicationclosedialog.h | 2 +- src/gui/components/atcbuttoncomponent.cpp | 2 +- src/gui/components/atcbuttoncomponent.h | 2 +- src/gui/components/atcstationcomponent.cpp | 2 +- src/gui/components/atcstationcomponent.h | 4 +- .../audioadvanceddistributedcomponent.cpp | 2 +- .../audioadvanceddistributedcomponent.h | 2 +- .../audioadvanceddistributeddialog.cpp | 2 +- .../audioadvanceddistributeddialog.h | 2 +- .../audiodevicevolumesetupcomponent.cpp | 2 +- .../audiodevicevolumesetupcomponent.h | 2 +- .../components/audionotificationcomponent.cpp | 2 +- src/gui/components/autopublishcomponent.cpp | 2 +- src/gui/components/autopublishcomponent.h | 2 +- src/gui/components/autopublishdialog.cpp | 2 +- src/gui/components/autopublishdialog.h | 2 +- src/gui/components/callsigncompleter.cpp | 2 +- src/gui/components/callsigncompleter.h | 2 +- src/gui/components/cgsourceselector.cpp | 2 +- src/gui/components/cgsourceselector.h | 2 +- src/gui/components/cockpitcomaudiodialog.cpp | 2 +- src/gui/components/cockpitcomaudiodialog.h | 2 +- src/gui/components/cockpitcomcomponent.cpp | 2 +- src/gui/components/cockpitcomcomponent.h | 4 +- src/gui/components/cockpitcomponent.cpp | 2 +- src/gui/components/cockpitcomponent.h | 6 +- .../cockpitcomtransmissioncomponent.cpp | 5 +- .../cockpitcomtransmissioncomponent.h | 2 +- .../components/cockpitinfoareacomponent.cpp | 2 +- src/gui/components/cockpitinfoareacomponent.h | 6 +- src/gui/components/colorselector.cpp | 2 +- src/gui/components/colorselector.h | 10 +- .../components/configsimulatorcomponent.cpp | 2 +- src/gui/components/configsimulatorcomponent.h | 6 +- src/gui/components/configurationwizard.cpp | 2 +- src/gui/components/configurationwizard.h | 2 +- src/gui/components/coordinatedialog.cpp | 2 +- src/gui/components/coordinatedialog.h | 2 +- ...ymodelsfromotherswiftversionscomponent.cpp | 2 +- ...opymodelsfromotherswiftversionscomponent.h | 6 +- ...copymodelsfromotherswiftversionsdialog.cpp | 2 +- .../copymodelsfromotherswiftversionsdialog.h | 2 +- .../copysettingsandcachescomponent.cpp | 2 +- .../copysettingsandcachescomponent.h | 6 +- src/gui/components/coreinfoareacomponent.cpp | 2 +- src/gui/components/coreinfoareacomponent.h | 6 +- src/gui/components/coresettingsdialog.cpp | 2 +- src/gui/components/coresettingsdialog.h | 2 +- src/gui/components/corestatuscomponent.cpp | 2 +- src/gui/components/corestatuscomponent.h | 2 +- src/gui/components/countryselector.cpp | 2 +- src/gui/components/countryselector.h | 2 +- src/gui/components/datainfoareacomponent.cpp | 2 +- src/gui/components/datainfoareacomponent.h | 6 +- .../components/datamaininfoareacomponent.cpp | 2 +- .../components/datamaininfoareacomponent.h | 6 +- src/gui/components/datasettingscomponent.cpp | 2 +- src/gui/components/datasettingscomponent.h | 2 +- .../dbaircraftcategorycomponent.cpp | 2 +- .../components/dbaircraftcategorycomponent.h | 2 +- .../components/dbaircrafticaocomponent.cpp | 2 +- src/gui/components/dbaircrafticaocomponent.h | 2 +- .../dbaircrafticaoselectorcomponent.cpp | 2 +- .../dbaircrafticaoselectorcomponent.h | 10 +- src/gui/components/dbairlineicaocomponent.cpp | 2 +- src/gui/components/dbairlineicaocomponent.h | 2 +- .../components/dbairlineicaoselectorbase.cpp | 2 +- .../components/dbairlineicaoselectorbase.h | 10 +- .../dbairlineicaoselectorcomponent.cpp | 2 +- .../dbairlineicaoselectorcomponent.h | 10 +- .../dbairlinenameselectorcomponent.cpp | 5 +- .../dbairlinenameselectorcomponent.h | 10 +- .../dbautosimulatorstashingcomponent.cpp | 2 +- .../dbautosimulatorstashingcomponent.h | 8 +- .../components/dbautostashingcomponent.cpp | 2 +- src/gui/components/dbautostashingcomponent.h | 8 +- src/gui/components/dbcountrycomponent.cpp | 2 +- src/gui/components/dbcountrycomponent.h | 2 +- .../components/dbcountryselectorcomponent.cpp | 2 +- .../components/dbcountryselectorcomponent.h | 8 +- src/gui/components/dbdistributorcomponent.cpp | 2 +- src/gui/components/dbdistributorcomponent.h | 2 +- .../dbdistributorselectorcomponent.cpp | 5 +- .../dbdistributorselectorcomponent.h | 10 +- src/gui/components/dbliverycolorsearch.cpp | 2 +- src/gui/components/dbliverycolorsearch.h | 2 +- .../components/dbliverycolorsearchdialog.cpp | 2 +- .../components/dbliverycolorsearchdialog.h | 2 +- src/gui/components/dbliverycomponent.cpp | 2 +- src/gui/components/dbliverycomponent.h | 2 +- .../components/dbliveryselectorcomponent.cpp | 5 +- .../components/dbliveryselectorcomponent.h | 10 +- src/gui/components/dbloaddatadialog.cpp | 2 +- src/gui/components/dbloaddatadialog.h | 2 +- .../components/dbloadoverviewcomponent.cpp | 2 +- src/gui/components/dbloadoverviewcomponent.h | 4 +- src/gui/components/dblogincomponent.cpp | 2 +- src/gui/components/dblogincomponent.h | 2 +- src/gui/components/dbmappingcomponent.h | 14 +- src/gui/components/dbmappingcomponentaware.h | 2 +- src/gui/components/dbmodelcomponent.cpp | 5 +- src/gui/components/dbmodelcomponent.h | 2 +- .../components/dbmodelmappingmodifydialog.cpp | 5 +- .../components/dbmodelmappingmodifydialog.h | 2 +- .../components/dbmodelworkbenchcomponent.cpp | 5 +- .../components/dbmodelworkbenchcomponent.h | 14 +- src/gui/components/dbownmodelscomponent.cpp | 5 +- src/gui/components/dbownmodelscomponent.h | 16 +- src/gui/components/dbownmodelsdialog.cpp | 2 +- src/gui/components/dbownmodelsdialog.h | 2 +- src/gui/components/dbownmodelsetcomponent.cpp | 5 +- src/gui/components/dbownmodelsetcomponent.h | 12 +- src/gui/components/dbownmodelsetdialog.cpp | 2 +- src/gui/components/dbownmodelsetdialog.h | 2 +- .../components/dbownmodelsetformdialog.cpp | 5 +- src/gui/components/dbownmodelsetformdialog.h | 4 +- src/gui/components/dbquickmappingwizard.cpp | 2 +- .../components/dbreducemodelduplicates.cpp | 2 +- src/gui/components/dbreducemodelduplicates.h | 4 +- src/gui/components/dbstashcomponent.cpp | 2 +- src/gui/components/dbstashcomponent.h | 2 +- .../components/dbusserveraddressselector.cpp | 2 +- .../components/dbusserveraddressselector.h | 2 +- .../distributorpreferencescomponent.cpp | 2 +- .../distributorpreferencescomponent.h | 2 +- src/gui/components/downloadcomponent.cpp | 2 +- src/gui/components/downloadcomponent.h | 2 +- src/gui/components/downloaddialog.cpp | 2 +- src/gui/components/downloaddialog.h | 4 +- src/gui/components/firstmodelsetcomponent.cpp | 2 +- src/gui/components/firstmodelsetcomponent.h | 4 +- src/gui/components/firstmodelsetdialog.cpp | 2 +- src/gui/components/firstmodelsetdialog.h | 2 +- src/gui/components/flightplancomponent.cpp | 2 +- src/gui/components/flightplancomponent.h | 2 +- src/gui/components/hotkeydialog.cpp | 2 +- src/gui/components/hotkeydialog.h | 4 +- src/gui/components/infobarstatuscomponent.cpp | 2 +- src/gui/components/infobarstatuscomponent.h | 4 +- .../infobarwebreadersstatuscomponent.cpp | 2 +- .../infobarwebreadersstatuscomponent.h | 6 +- .../infobarwebreadersstatussmallcomponent.cpp | 2 +- .../infobarwebreadersstatussmallcomponent.h | 2 +- .../components/initialdataloadcomponent.cpp | 2 +- src/gui/components/initialdataloadcomponent.h | 6 +- .../installfsxterrainprobecomponent.cpp | 2 +- .../installfsxterrainprobecomponent.h | 2 +- .../installsimulatorspecificwizardpage.h | 2 +- .../components/installxswiftbuscomponent.cpp | 2 +- .../components/installxswiftbuscomponent.h | 4 +- src/gui/components/installxswiftbusdialog.cpp | 2 +- src/gui/components/installxswiftbusdialog.h | 2 +- src/gui/components/internalscomponent.cpp | 2 +- src/gui/components/internalscomponent.h | 4 +- src/gui/components/interpolationcomponent.cpp | 2 +- src/gui/components/interpolationcomponent.h | 2 +- .../components/interpolationlogdisplay.cpp | 5 +- src/gui/components/interpolationlogdisplay.h | 2 +- .../interpolationlogdisplaydialog.h | 2 +- .../interpolationsetupcomponent.cpp | 2 +- .../components/interpolationsetupcomponent.h | 2 +- src/gui/components/legalinfocomponent.cpp | 2 +- src/gui/components/legalinfocomponent.h | 4 +- src/gui/components/logcomponent.cpp | 2 +- src/gui/components/logcomponent.h | 2 +- src/gui/components/logincomponent.cpp | 2 +- src/gui/components/logincomponent.h | 2 +- src/gui/components/maininfoareacomponent.cpp | 2 +- src/gui/components/maininfoareacomponent.h | 6 +- .../components/mainkeypadareacomponent.cpp | 2 +- src/gui/components/mainkeypadareacomponent.h | 2 +- src/gui/components/mappingcomponent.cpp | 2 +- src/gui/components/mappingcomponent.h | 2 +- src/gui/components/marginsinput.cpp | 2 +- src/gui/components/marginsinput.h | 2 +- .../matchingstatisticscomponent.cpp | 2 +- .../components/matchingstatisticscomponent.h | 2 +- src/gui/components/modelbrowsercomponent.cpp | 5 +- src/gui/components/modelbrowsercomponent.h | 2 +- src/gui/components/modelbrowserdialog.cpp | 5 +- src/gui/components/modelbrowserdialog.h | 4 +- .../modelconverterxsetupcomponent.cpp | 2 +- .../modelconverterxsetupcomponent.h | 2 +- src/gui/components/modelmatchercomponent.cpp | 2 +- src/gui/components/modelmatchercomponent.h | 2 +- .../components/modelmatcherlogcomponent.cpp | 2 +- src/gui/components/modelmatcherlogcomponent.h | 2 +- src/gui/components/modelmatcherlogenable.cpp | 2 +- src/gui/components/modelmatcherlogenable.h | 2 +- src/gui/components/modelmodeselector.cpp | 5 +- src/gui/components/modelmodeselector.h | 2 +- src/gui/components/navigatordialog.cpp | 2 +- src/gui/components/navigatordialog.h | 18 +- .../networkaircraftvaluescomponent.cpp | 5 +- .../networkaircraftvaluescomponent.h | 2 +- .../components/networkdetailscomponent.cpp | 2 +- src/gui/components/networkdetailscomponent.h | 2 +- .../otherswiftversionscomponent.cpp | 2 +- .../components/otherswiftversionscomponent.h | 2 +- .../components/otherswiftversionsdialog.cpp | 2 +- src/gui/components/otherswiftversionsdialog.h | 2 +- src/gui/components/ownaircraftcomponent.cpp | 2 +- src/gui/components/ownaircraftcomponent.h | 2 +- src/gui/components/radarcomponent.cpp | 2 +- src/gui/components/radarcomponent.h | 4 +- .../components/rawfsdmessagescomponent.cpp | 2 +- src/gui/components/rawfsdmessagescomponent.h | 2 +- src/gui/components/rawfsdmessagesdialog.cpp | 2 +- src/gui/components/rawfsdmessagesdialog.h | 2 +- src/gui/components/registercomponent.cpp | 2 +- src/gui/components/registercomponent.h | 2 +- src/gui/components/remoteaircraftselector.cpp | 2 +- src/gui/components/remoteaircraftselector.h | 4 +- src/gui/components/selcalcodeselector.cpp | 2 +- src/gui/components/selcalcodeselector.h | 2 +- .../components/settingsadvancedcomponent.cpp | 2 +- .../components/settingsadvancedcomponent.h | 2 +- src/gui/components/settingsfontcomponent.cpp | 2 +- src/gui/components/settingsfontcomponent.h | 2 +- src/gui/components/settingsfontdialog.cpp | 2 +- src/gui/components/settingsfontdialog.h | 2 +- src/gui/components/settingsguicomponent.cpp | 2 +- src/gui/components/settingsguicomponent.h | 2 +- .../components/settingshotkeycomponent.cpp | 2 +- src/gui/components/settingshotkeycomponent.h | 6 +- .../components/settingsmatchingcomponent.cpp | 2 +- .../components/settingsmatchingcomponent.h | 2 +- src/gui/components/settingsmatchingdialog.cpp | 2 +- src/gui/components/settingsmatchingdialog.h | 2 +- src/gui/components/settingsmodelcomponent.cpp | 2 +- src/gui/components/settingsmodelcomponent.h | 2 +- .../components/settingsnetworkcomponent.cpp | 2 +- src/gui/components/settingsnetworkcomponent.h | 2 +- .../settingsnetworkserverscomponent.cpp | 2 +- .../settingsnetworkserverscomponent.h | 2 +- .../settingssimulatorbasicscomponent.cpp | 2 +- .../settingssimulatorbasicscomponent.h | 2 +- .../components/settingssimulatorcomponent.cpp | 2 +- .../components/settingssimulatorcomponent.h | 2 +- .../settingssimulatormessagescomponent.cpp | 2 +- .../settingssimulatormessagescomponent.h | 2 +- src/gui/components/settingsswiftplugin.cpp | 2 +- src/gui/components/settingsswiftplugin.h | 2 +- .../settingstextmessageinlinecomponent.cpp | 2 +- .../settingstextmessageinlinecomponent.h | 2 +- .../components/settingstextmessagestyle.cpp | 2 +- src/gui/components/settingstextmessagestyle.h | 2 +- .../settingsvatsimreaderscomponent.cpp | 2 +- .../settingsvatsimreaderscomponent.h | 2 +- .../components/settingsviewupdatetimes.cpp | 2 +- src/gui/components/settingsviewupdatetimes.h | 2 +- .../components/settingsxswiftbuscomponent.cpp | 2 +- .../components/settingsxswiftbuscomponent.h | 2 +- src/gui/components/setuploadingdialog.cpp | 2 +- src/gui/components/setuploadingdialog.h | 2 +- src/gui/components/simbriefdownloaddialog.cpp | 2 +- src/gui/components/simbriefdownloaddialog.h | 4 +- src/gui/components/simulatorcomponent.cpp | 2 +- src/gui/components/simulatorcomponent.h | 2 +- src/gui/components/simulatorselector.cpp | 2 +- src/gui/components/simulatorselector.h | 2 +- src/gui/components/statusmessageform.cpp | 2 +- src/gui/components/statusmessageform.h | 2 +- src/gui/components/statusmessageformsmall.cpp | 2 +- src/gui/components/statusmessageformsmall.h | 2 +- src/gui/components/statusmessagesdetail.cpp | 2 +- src/gui/components/statusmessagesdetail.h | 4 +- src/gui/components/stringlistdialog.cpp | 2 +- src/gui/components/stringlistdialog.h | 2 +- src/gui/components/texteditdialog.cpp | 2 +- src/gui/components/texteditdialog.h | 2 +- src/gui/components/textmessagecomponent.cpp | 2 +- src/gui/components/textmessagecomponent.h | 4 +- src/gui/components/transpondercodespinbox.h | 2 +- .../components/transpondermodecomponent.cpp | 2 +- src/gui/components/transpondermodecomponent.h | 2 +- src/gui/components/updateinfocomponent.cpp | 2 +- src/gui/components/updateinfocomponent.h | 2 +- src/gui/components/updateinfodialog.cpp | 2 +- src/gui/components/updateinfodialog.h | 4 +- src/gui/components/usercomponent.cpp | 2 +- src/gui/components/usercomponent.h | 2 +- src/gui/dockwidget.h | 12 +- src/gui/dockwidgetinfoarea.h | 4 +- src/gui/dockwidgetinfobar.h | 6 +- src/gui/dropbase.cpp | 4 - src/gui/dropbase.h | 4 +- src/gui/dropsite.h | 8 +- src/gui/ecosystemcombobox.h | 2 +- src/gui/editors/aircrafticaoform.cpp | 2 +- src/gui/editors/aircrafticaoform.h | 10 +- src/gui/editors/aircraftmodelform.cpp | 2 +- src/gui/editors/aircraftmodelform.h | 8 +- src/gui/editors/aircraftpartsform.cpp | 2 +- src/gui/editors/aircraftpartsform.h | 8 +- src/gui/editors/airlineicaoform.cpp | 2 +- src/gui/editors/airlineicaoform.h | 10 +- src/gui/editors/cockpitcomform.cpp | 2 +- src/gui/editors/cockpitcomform.h | 8 +- src/gui/editors/coordinateform.cpp | 2 +- src/gui/editors/coordinateform.h | 6 +- src/gui/editors/distributorform.cpp | 2 +- src/gui/editors/distributorform.h | 10 +- src/gui/editors/form.cpp | 4 +- src/gui/editors/form.h | 4 +- src/gui/editors/fsdsetupform.h | 6 +- src/gui/editors/interpolationsetupform.cpp | 2 +- src/gui/editors/interpolationsetupform.h | 6 +- src/gui/editors/liveryform.cpp | 2 +- src/gui/editors/liveryform.h | 10 +- src/gui/editors/matchingform.cpp | 2 +- src/gui/editors/matchingform.h | 6 +- src/gui/editors/modelmappingform.cpp | 2 +- src/gui/editors/modelmappingform.h | 10 +- src/gui/editors/modelmappingmodifyform.cpp | 5 +- src/gui/editors/modelmappingmodifyform.h | 6 +- src/gui/editors/ownmodelsetform.cpp | 5 +- src/gui/editors/ownmodelsetform.h | 4 +- src/gui/editors/pbhsform.cpp | 2 +- src/gui/editors/pbhsform.h | 4 +- src/gui/editors/pilotform.cpp | 2 +- src/gui/editors/pilotform.h | 6 +- src/gui/editors/relativeaircraftposition.cpp | 2 +- src/gui/editors/relativeaircraftposition.h | 4 +- src/gui/editors/serverform.cpp | 2 +- src/gui/editors/serverform.h | 6 +- src/gui/editors/situationform.cpp | 2 +- src/gui/editors/situationform.h | 8 +- src/gui/editors/validationindicator.cpp | 2 +- src/gui/editors/validationindicator.h | 2 +- src/gui/enablefordockwidgetinfoarea.h | 2 +- src/gui/enableforframelesswindow.h | 2 +- src/gui/filters/aircrafticaofilterbar.cpp | 2 +- src/gui/filters/aircrafticaofilterbar.h | 4 +- src/gui/filters/aircraftmodelfilterbar.cpp | 2 +- src/gui/filters/aircraftmodelfilterbar.h | 8 +- src/gui/filters/aircraftmodelfilterdialog.cpp | 2 +- src/gui/filters/aircraftmodelfilterdialog.h | 4 +- src/gui/filters/airlineicaofilterbar.cpp | 2 +- src/gui/filters/airlineicaofilterbar.h | 8 +- src/gui/filters/countryfilterbar.cpp | 2 +- src/gui/filters/countryfilterbar.h | 9 +- src/gui/filters/distributorfilterbar.cpp | 2 +- src/gui/filters/distributorfilterbar.h | 8 +- src/gui/filters/filterbarbuttons.cpp | 2 +- src/gui/filters/filterbarbuttons.h | 2 +- src/gui/filters/filterdialog.cpp | 2 - src/gui/filters/filterdialog.h | 2 +- src/gui/filters/filterwidget.cpp | 2 +- src/gui/filters/filterwidget.h | 2 +- src/gui/filters/liveryfilterbar.cpp | 2 +- src/gui/filters/liveryfilterbar.h | 8 +- src/gui/filters/statusmessagefilterbar.cpp | 4 +- src/gui/filters/statusmessagefilterbar.h | 8 +- src/gui/filters/statusmessagefilterdialog.cpp | 2 +- src/gui/filters/statusmessagefilterdialog.h | 4 +- src/gui/guiactionbind.cpp | 2 - src/gui/guiactionbind.h | 2 +- src/gui/infoarea.cpp | 2 - src/gui/infoarea.h | 8 +- src/gui/labelandicon.cpp | 2 +- src/gui/labelandicon.h | 2 +- src/gui/led.h | 6 +- src/gui/levelmeter.cpp | 2 +- src/gui/levelmeter.h | 2 +- src/gui/lineedithistory.h | 4 +- src/gui/loadindicator.h | 10 +- src/gui/mainwindowaccess.cpp | 5 +- src/gui/mainwindowaccess.h | 2 +- src/gui/managedstatusbar.h | 2 +- src/gui/menus/aircraftmodelmenus.h | 6 +- src/gui/menus/fontmenus.h | 2 +- src/gui/menus/menuaction.h | 2 +- src/gui/menus/menudelegate.h | 2 +- src/gui/models/actionhotkeylistmodel.h | 2 +- src/gui/models/actionmodel.cpp | 2 +- src/gui/models/actionmodel.h | 2 +- src/gui/models/aircraftcategorylistmodel.h | 2 +- src/gui/models/aircraftcategorytreemodel.h | 2 +- src/gui/models/aircrafticaofilter.h | 2 +- src/gui/models/aircrafticaolistmodel.h | 2 +- src/gui/models/aircraftmodelfilter.h | 2 +- src/gui/models/aircraftmodellistmodel.h | 10 +- src/gui/models/aircraftpartslistmodel.h | 2 +- .../models/aircraftsituationchangelistmodel.h | 2 +- src/gui/models/aircraftsituationlistmodel.h | 2 +- src/gui/models/airlineicaofilter.h | 2 +- src/gui/models/airlineicaolistmodel.h | 4 +- src/gui/models/applicationinfolistmodel.h | 2 +- src/gui/models/atcstationlistmodel.h | 2 +- src/gui/models/atcstationtreemodel.h | 2 +- src/gui/models/audiodeviceinfolistmodel.h | 2 +- src/gui/models/clientlistmodel.h | 4 +- src/gui/models/columnformatters.h | 56 ++-- src/gui/models/countryfilter.h | 2 +- src/gui/models/countrylistmodel.h | 2 +- src/gui/models/distributorfilter.h | 2 +- src/gui/models/distributorlistmodel.h | 4 +- src/gui/models/identifierlistmodel.h | 2 +- src/gui/models/interpolationsetupmodel.h | 2 +- src/gui/models/listmodelcallsignobjects.h | 6 +- src/gui/models/listmodeldbobjects.h | 14 +- src/gui/models/listmodeltimestampobjects.h | 2 +- src/gui/models/liveryfilter.h | 3 +- src/gui/models/liverylistmodel.h | 2 +- src/gui/models/matchingstatisticsmodel.h | 2 +- src/gui/models/modelfilter.h | 2 +- src/gui/models/namevariantpairlistmodel.h | 2 +- src/gui/models/selectionmodel.h | 2 +- src/gui/models/serverlistmodel.h | 2 +- src/gui/models/simulatedaircraftlistmodel.h | 2 +- src/gui/models/statusmessagefilter.h | 5 +- src/gui/models/statusmessagelistmodel.h | 4 +- src/gui/models/textmessagelistmodel.h | 4 +- src/gui/models/userlistmodel.h | 2 +- src/gui/overlaymessages.cpp | 2 +- src/gui/overlaymessages.h | 4 +- src/gui/overlaymessagesframe.h | 6 +- src/gui/pluginconfig.h | 2 +- src/gui/plugindetailswindow.cpp | 2 +- src/gui/plugindetailswindow.h | 2 +- src/gui/settings/dockwidgetsettings.cpp | 2 - src/gui/settings/dockwidgetsettings.h | 2 +- src/gui/settings/guisettings.cpp | 2 - src/gui/settings/guisettings.h | 2 +- src/gui/settings/navigatorsettings.cpp | 2 - src/gui/settings/navigatorsettings.h | 4 +- src/gui/settings/textmessagesettings.cpp | 2 - src/gui/settings/textmessagesettings.h | 2 +- src/gui/settings/viewupdatesettings.cpp | 2 - src/gui/settings/viewupdatesettings.h | 2 +- src/gui/sharedstringlistcompleter.h | 2 +- src/gui/showhidebar.cpp | 2 +- src/gui/showhidebar.h | 2 +- src/gui/systemtraywindow.h | 4 +- src/gui/textmessagetextedit.cpp | 2 +- src/gui/textmessagetextedit.h | 2 +- src/gui/uppercasevalidator.h | 4 +- .../views/aircraftmodelstatisticsdialog.cpp | 2 +- src/gui/views/aircraftmodelstatisticsdialog.h | 2 +- .../views/aircraftmodelvalidationdialog.cpp | 2 +- src/gui/views/aircraftmodelvalidationdialog.h | 2 +- src/gui/views/aircraftmodelview.h | 10 +- src/gui/views/aircraftsituationview.h | 2 +- src/gui/views/applicationinfoview.h | 2 +- src/gui/views/atcstationview.h | 2 +- src/gui/views/checkboxdelegate.cpp | 2 - src/gui/views/checkboxdelegate.h | 14 +- src/gui/views/flightplandialog.cpp | 2 +- src/gui/views/flightplandialog.h | 2 +- src/gui/views/radarview.h | 4 +- src/gui/views/simulatedaircraftview.h | 2 +- src/gui/views/userview.h | 2 +- src/gui/views/viewbase.h | 111 ++++---- src/gui/views/viewbaseitemdelegate.h | 5 +- src/gui/views/viewbasenontemplate.cpp | 5 +- src/gui/views/viewbaseproxystyle.h | 4 +- src/gui/views/viewcallsignobjects.h | 2 +- src/gui/views/viewdbobjects.h | 8 +- src/input/joystick.h | 2 +- src/input/keyboard.h | 2 +- src/input/linux/joysticklinux.h | 6 +- src/input/linux/keyboardlinux.h | 4 +- src/misc/CMakeLists.txt | 1 - src/misc/applicationinfolist.cpp | 2 - src/misc/applicationinfolist.h | 2 +- src/misc/atomicfile.h | 6 +- src/misc/aviation/aircraftcategorylist.cpp | 2 - src/misc/aviation/aircraftcategorylist.h | 2 +- src/misc/aviation/aircraftengine.h | 2 +- src/misc/aviation/aircrafticaocode.h | 2 +- src/misc/aviation/aircrafticaocodelist.cpp | 2 - src/misc/aviation/aircrafticaocodelist.h | 2 +- src/misc/aviation/aircraftparts.h | 2 +- src/misc/aviation/aircraftpartslist.cpp | 2 - src/misc/aviation/aircraftpartslist.h | 2 +- src/misc/aviation/aircraftsituation.cpp | 2 - src/misc/aviation/aircraftsituation.h | 15 +- .../aviation/aircraftsituationchangelist.cpp | 2 - .../aviation/aircraftsituationchangelist.h | 2 +- src/misc/aviation/aircraftvelocity.cpp | 2 - src/misc/aviation/aircraftvelocity.h | 2 +- src/misc/aviation/airlineicaocodelist.cpp | 2 - src/misc/aviation/airlineicaocodelist.h | 2 +- src/misc/aviation/airport.h | 14 +- src/misc/aviation/airporticaocode.h | 2 +- src/misc/aviation/atcstation.cpp | 2 - src/misc/aviation/atcstation.h | 10 +- src/misc/aviation/atcstationlist.cpp | 2 - src/misc/aviation/atcstationlist.h | 2 +- src/misc/aviation/callsign.h | 2 +- src/misc/aviation/callsignset.cpp | 2 - src/misc/aviation/callsignset.h | 2 +- src/misc/aviation/comsystem.h | 2 +- src/misc/aviation/flightplan.cpp | 2 - src/misc/aviation/flightplan.h | 2 +- src/misc/aviation/flightplanlist.cpp | 2 - src/misc/aviation/flightplanlist.h | 2 +- src/misc/aviation/livery.cpp | 2 - src/misc/aviation/livery.h | 2 +- src/misc/aviation/liverylist.cpp | 2 - src/misc/aviation/liverylist.h | 2 +- src/misc/countrylist.cpp | 2 - src/misc/countrylist.h | 2 +- src/misc/crashhandler.h | 2 +- src/misc/datacache.cpp | 2 - src/misc/datacache.h | 6 +- src/misc/db/artifact.cpp | 2 - src/misc/db/artifact.h | 2 +- src/misc/db/artifactlist.cpp | 2 - src/misc/db/artifactlist.h | 2 +- src/misc/db/dbinfolist.cpp | 2 - src/misc/db/dbinfolist.h | 2 +- src/misc/db/distribution.cpp | 2 - src/misc/db/distribution.h | 2 +- src/misc/db/distributionlist.cpp | 2 - src/misc/db/distributionlist.h | 2 +- src/misc/db/updateinfo.h | 4 +- src/misc/dbusserver.h | 2 +- src/misc/dictionary.h | 2 +- src/misc/geo/coordinategeodetic.cpp | 4 - src/misc/geo/coordinategeodetic.h | 18 +- src/misc/geo/coordinategeodeticlist.cpp | 2 - src/misc/geo/coordinategeodeticlist.h | 2 +- src/misc/geo/elevationplane.h | 4 +- src/misc/icon.h | 2 +- src/misc/iconlist.h | 2 +- src/misc/identifierlist.cpp | 2 - src/misc/identifierlist.h | 2 +- src/misc/input/keyboardkeylist.cpp | 2 - src/misc/input/keyboardkeylist.h | 2 +- src/misc/logmessage.cpp | 2 - src/misc/logmessage.h | 2 +- src/misc/namevariantpairlist.cpp | 2 - src/misc/namevariantpairlist.h | 2 +- src/misc/network/authenticateduser.cpp | 2 - src/misc/network/authenticateduser.h | 2 +- src/misc/network/clientlist.cpp | 2 - src/misc/network/clientlist.h | 2 +- src/misc/network/clientprovider.h | 30 +- src/misc/network/ecosystem.h | 2 +- src/misc/network/ecosystemlist.cpp | 2 - src/misc/network/ecosystemlist.h | 2 +- src/misc/network/fsdsetup.h | 2 +- src/misc/network/rawfsdmessagelist.cpp | 2 - src/misc/network/rawfsdmessagelist.h | 2 +- src/misc/network/remotefilelist.cpp | 2 - src/misc/network/remotefilelist.h | 2 +- src/misc/network/rolelist.cpp | 2 - src/misc/network/rolelist.h | 2 +- src/misc/network/server.h | 2 +- src/misc/network/serverlist.cpp | 2 - src/misc/network/serverlist.h | 2 +- src/misc/network/textmessage.h | 2 +- src/misc/network/textmessagelist.cpp | 2 - src/misc/network/textmessagelist.h | 2 +- src/misc/network/urlloglist.cpp | 2 - src/misc/network/urlloglist.h | 2 +- src/misc/network/userlist.cpp | 2 - src/misc/network/userlist.h | 2 +- src/misc/orderable.cpp | 2 - src/misc/orderable.h | 2 +- src/misc/platform.h | 2 +- src/misc/platformset.cpp | 2 - src/misc/platformset.h | 2 +- src/misc/pq/units.h | 8 +- src/misc/processinfo.h | 2 +- src/misc/promise.h | 2 +- src/misc/propertyindexlist.cpp | 2 - src/misc/propertyindexlist.h | 2 +- src/misc/provider.cpp | 9 - src/misc/provider.h | 4 +- src/misc/sharedstate/datalinkdbus.h | 10 +- src/misc/sharedstate/datalinklocal.h | 10 +- src/misc/sharedstate/dbus/dupleximpl.h | 15 +- src/misc/sharedstate/dbus/duplexproxy.h | 15 +- src/misc/sharedstate/dbus/hubimpl.h | 12 +- src/misc/sharedstate/dbus/hubproxy.h | 12 +- src/misc/sharedstate/listobserver.h | 12 +- src/misc/sharedstate/scalarobserver.h | 2 +- src/misc/simulation/aircraftmodel.h | 2 +- src/misc/simulation/aircraftmodelinterfaces.h | 20 +- src/misc/simulation/aircraftmodellist.cpp | 2 - src/misc/simulation/aircraftmodellist.h | 2 +- src/misc/simulation/aircraftmodelloader.cpp | 2 - src/misc/simulation/aircraftmodelloader.h | 12 +- .../simulation/airspaceaircraftsnapshot.cpp | 2 - .../simulation/airspaceaircraftsnapshot.h | 2 +- src/misc/simulation/backgroundvalidation.h | 2 +- src/misc/simulation/categorymatcher.h | 2 +- src/misc/simulation/distributor.cpp | 2 - src/misc/simulation/distributor.h | 2 +- src/misc/simulation/distributorlist.cpp | 2 - src/misc/simulation/distributorlist.h | 2 +- .../simulation/distributorlistpreferences.cpp | 2 - .../simulation/distributorlistpreferences.h | 2 +- .../fscommon/aircraftcfgentrieslist.cpp | 2 - .../fscommon/aircraftcfgentrieslist.h | 2 +- .../simulation/fscommon/aircraftcfgparser.h | 8 +- .../simulation/fscommon/vpilotmodelrule.cpp | 2 - .../simulation/fscommon/vpilotmodelrule.h | 2 +- .../simulation/fsx/simconnectutilities.cpp | 2 - src/misc/simulation/fsx/simconnectutilities.h | 2 +- .../interpolationrenderingsetup.cpp | 10 - .../interpolationrenderingsetup.h | 6 +- .../interpolation/interpolationsetuplist.cpp | 2 - .../interpolation/interpolationsetuplist.h | 2 +- .../interpolation/interpolatorlinear.h | 2 +- .../interpolation/interpolatormulti.cpp | 2 - .../interpolation/interpolatormulti.h | 2 +- .../interpolation/interpolatorspline.h | 2 +- src/misc/simulation/matchingscript.h | 4 +- src/misc/simulation/matchingstatistics.cpp | 2 - src/misc/simulation/matchingstatistics.h | 2 +- .../simulation/matchingstatisticsentry.cpp | 2 - src/misc/simulation/matchingstatisticsentry.h | 2 +- .../simulation/ownaircraftproviderdummy.h | 50 ++-- .../simulation/remoteaircraftprovider.cpp | 6 - src/misc/simulation/remoteaircraftprovider.h | 135 +++++---- .../simulation/remoteaircraftproviderdummy.h | 4 +- .../simulation/settings/modelsettings.cpp | 2 - src/misc/simulation/settings/modelsettings.h | 2 +- .../simulation/settings/simulatorsettings.cpp | 2 - .../simulation/settings/simulatorsettings.h | 6 +- .../settings/swiftpluginsettings.cpp | 2 - .../simulation/settings/swiftpluginsettings.h | 2 +- .../simulation/settings/xswiftbussettings.cpp | 2 - .../simulation/settings/xswiftbussettings.h | 6 +- .../settings/xswiftbussettingsqtfree.h | 4 +- src/misc/simulation/simulatedaircraft.h | 11 +- src/misc/simulation/simulatedaircraftlist.cpp | 2 - src/misc/simulation/simulatedaircraftlist.h | 2 +- src/misc/simulation/simulatorinfo.cpp | 2 - src/misc/simulation/simulatorinfo.h | 2 +- src/misc/simulation/simulatorinfolist.cpp | 2 - src/misc/simulation/simulatorinfolist.h | 2 +- src/misc/simulation/simulatorinternals.h | 2 +- .../simulation/simulatorplugininfolist.cpp | 2 - src/misc/simulation/simulatorplugininfolist.h | 2 +- .../xplane/aircraftmodelloaderxplane.h | 8 +- .../simulation/xplane/navdatareference.cpp | 4 - src/misc/simulation/xplane/navdatareference.h | 17 +- src/misc/slot.h | 2 +- src/misc/statusexception.h | 4 +- src/misc/statusmessage.h | 2 +- src/misc/test/testserviceinterface.cpp | 2 - src/misc/test/testserviceinterface.h | 2 +- src/misc/timestampbased.cpp | 2 - src/misc/timestampbased.h | 2 +- src/misc/variant.h | 2 +- src/misc/variantlist.h | 2 +- src/misc/variantmap.h | 2 +- src/misc/variantprivate.h | 47 ++- src/misc/weather/metardecoder.cpp | 2 +- .../simulator/emulated/simulatoremulated.h | 71 +++-- .../emulated/simulatoremulatedfactory.h | 11 +- .../simulatoremulatedmonitordialog.cpp | 2 +- .../emulated/simulatoremulatedmonitordialog.h | 2 +- .../emulatedconfig/simulatoremulatedconfig.h | 2 +- .../simulatoremulatedconfigwidget.cpp | 2 +- .../simulatoremulatedconfigwidget.h | 2 +- .../flightgear/flightgearmpaircraft.cpp | 2 - .../flightgear/flightgearmpaircraft.h | 2 +- .../flightgear/simulatorflightgear.h | 70 +++-- .../simulatorflightgearconfig.h | 2 +- .../simulatorflightgearconfigwindow.cpp | 2 +- .../simulatorflightgearconfigwindow.h | 2 +- .../plugincommon/simulatorplugincommon.h | 8 +- .../simulator/xplane/simulatorxplane.h | 80 +++--- .../simulator/xplane/xplanempaircraft.cpp | 2 - .../simulator/xplane/xplanempaircraft.h | 4 +- .../xplaneconfig/simulatorxplaneconfig.h | 2 +- .../simulatorxplaneconfigwindow.cpp | 2 +- .../simulatorxplaneconfigwindow.h | 2 +- src/sound/notificationplayer.h | 2 +- .../sampleprovider/bufferedwaveprovider.h | 2 +- .../sampleprovider/equalizersampleprovider.h | 2 +- .../sampleprovider/mixingsampleprovider.h | 2 +- src/sound/sampleprovider/pinknoisegenerator.h | 2 +- .../resourcesoundsampleprovider.h | 4 +- src/sound/sampleprovider/sampleprovider.h | 2 +- src/sound/sampleprovider/sawtoothgenerator.h | 2 +- .../sampleprovider/simplecompressoreffect.h | 2 +- src/sound/sampleprovider/sinusgenerator.h | 2 +- .../sampleprovider/volumesampleprovider.h | 2 +- src/sound/selcalplayer.h | 2 +- src/sound/threadedtonepairplayer.h | 6 +- src/swiftcore/swiftcore.cpp | 2 +- src/swiftcore/swiftcore.h | 2 +- src/swiftdata/swiftdata.cpp | 2 +- src/swiftdata/swiftdata.h | 4 +- src/swiftguistandard/swiftguistd.cpp | 2 +- src/swiftguistandard/swiftguistd.h | 12 +- src/swiftguistandard/swiftguistdapplication.h | 4 +- src/swiftlauncher/swiftlauncher.h | 6 +- src/xswiftbus/service.cpp | 1 + .../core/fsd/testfsdclient/testfsdclient.cpp | 2 +- .../fsd/testfsdmessages/testfsdmessages.cpp | 2 +- tests/misc/testcompress/testcompress.cpp | 2 +- tests/misc/testsharedstate/testsharedstate.h | 6 +- tests/misc/testvalueobject.h | 2 +- 781 files changed, 2015 insertions(+), 2370 deletions(-) delete mode 100644 src/misc/provider.cpp diff --git a/.clang-tidy b/.clang-tidy index 244e8cba09..73f03d9b27 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -4,6 +4,7 @@ Checks: > -*, modernize-use-auto, + modernize-use-override, CheckOptions: diff --git a/src/core/actionbind.cpp b/src/core/actionbind.cpp index b390e6ed23..dc37ffde5b 100644 --- a/src/core/actionbind.cpp +++ b/src/core/actionbind.cpp @@ -22,11 +22,6 @@ namespace swift::core return a; } - CActionBind::~CActionBind() - { - // void - } - void CActionBind::unbind() { if (m_index < 0) { return; } diff --git a/src/core/actionbind.h b/src/core/actionbind.h index 3ec7875ae7..3f16a65248 100644 --- a/src/core/actionbind.h +++ b/src/core/actionbind.h @@ -50,7 +50,7 @@ namespace swift::core //! @} //! Destructor - ~CActionBind() override; + ~CActionBind() override = default; //! Unbind from swift::core::CInputManager void unbind(); diff --git a/src/core/afv/audio/input.h b/src/core/afv/audio/input.h index e320853987..76d5af2a61 100644 --- a/src/core/afv/audio/input.h +++ b/src/core/afv/audio/input.h @@ -35,10 +35,10 @@ namespace swift::core::afv::audio void stop(); //! \copydoc QIODevice::readData - virtual qint64 readData(char *data, qint64 maxlen) override; + qint64 readData(char *data, qint64 maxlen) override; //! \copydoc QIODevice::writeData - virtual qint64 writeData(const char *data, qint64 len) override; + qint64 writeData(const char *data, qint64 len) override; signals: //! Frame is available @@ -80,7 +80,7 @@ namespace swift::core::afv::audio CInput(int sampleRate, QObject *parent = nullptr); //! Dtor - virtual ~CInput() override { this->stop(); } + ~CInput() override { this->stop(); } //! @{ //! Number of encoded bytes diff --git a/src/core/afv/model/atcstationmodel.cpp b/src/core/afv/model/atcstationmodel.cpp index 5e9e5af694..bb77a703f7 100644 --- a/src/core/afv/model/atcstationmodel.cpp +++ b/src/core/afv/model/atcstationmodel.cpp @@ -33,8 +33,6 @@ namespace swift::core::afv::model CSampleAtcStationModel::CSampleAtcStationModel(QObject *parent) : QAbstractListModel(parent) {} - CSampleAtcStationModel::~CSampleAtcStationModel() {} - void CSampleAtcStationModel::updateAtcStations(const QVector &atcStations) { // Add stations which didn't exist yet diff --git a/src/core/afv/model/atcstationmodel.h b/src/core/afv/model/atcstationmodel.h index f41b79b555..73bbe86d23 100644 --- a/src/core/afv/model/atcstationmodel.h +++ b/src/core/afv/model/atcstationmodel.h @@ -65,7 +65,7 @@ namespace swift::core::afv::model CSampleAtcStationModel(QObject *parent = nullptr); //! Dtor - ~CSampleAtcStationModel() override; + ~CSampleAtcStationModel() override = default; //! Update the stations void updateAtcStations(const QVector &atcStations); diff --git a/src/core/aircraftmatcher.h b/src/core/aircraftmatcher.h index 53e3f30646..3bc8972fca 100644 --- a/src/core/aircraftmatcher.h +++ b/src/core/aircraftmatcher.h @@ -54,7 +54,7 @@ namespace swift::core //! Destructor //! \remark saves a log of removed models if any - virtual ~CAircraftMatcher() override; + ~CAircraftMatcher() override; //! Copy constructor CAircraftMatcher(const CAircraftMatcher &) = delete; @@ -268,13 +268,13 @@ namespace swift::core swift::misc::CStatusMessageList *log = nullptr); //! \copydoc swift::misc::simulation::IAircraftModelSetProvider::getModelSet - virtual swift::misc::simulation::CAircraftModelList getModelSet() const override { return m_modelSet; } + swift::misc::simulation::CAircraftModelList getModelSet() const override { return m_modelSet; } //! Model set as reference virtual const swift::misc::simulation::CAircraftModelList &getModelSetRef() const { return m_modelSet; } //! Model set count - virtual int getModelSetCount() const override { return m_modelSet.sizeInt(); } + int getModelSetCount() const override { return m_modelSet.sizeInt(); } //! Models bool hasModels() const { return !m_modelSet.isEmpty(); } diff --git a/src/core/airspacemonitor.h b/src/core/airspacemonitor.h index 94b2e558ec..7e5db2a36a 100644 --- a/src/core/airspacemonitor.h +++ b/src/core/airspacemonitor.h @@ -195,7 +195,7 @@ namespace swift::core struct FsInnPacket { //! Default ctor - FsInnPacket() {} + FsInnPacket() = default; //! Constructor FsInnPacket(const QString &aircraftIcaoDesignator, const QString &airlineIcaoDesignator, @@ -358,7 +358,7 @@ namespace swift::core //! \threadsafe //! \remark sets gnd.flag from parts if parts are available //! \remark uses gnd.elevation if found - virtual swift::misc::aviation::CAircraftSituation + swift::misc::aviation::CAircraftSituation storeAircraftSituation(const swift::misc::aviation::CAircraftSituation &situation, bool allowTestOffset = true) override; diff --git a/src/core/context/contextapplicationempty.h b/src/core/context/contextapplicationempty.h index 68f6c46399..03d4cca7b6 100644 --- a/src/core/context/contextapplicationempty.h +++ b/src/core/context/contextapplicationempty.h @@ -29,8 +29,8 @@ namespace swift::core public slots: //! \copydoc IContextApplication::changeSettings - virtual void changeSettings(const swift::misc::CValueCachePacket &settings, - const swift::misc::CIdentifier &origin) override + void changeSettings(const swift::misc::CValueCachePacket &settings, + const swift::misc::CIdentifier &origin) override { Q_UNUSED(settings); Q_UNUSED(origin); @@ -38,31 +38,31 @@ namespace swift::core } //! \copydoc IContextApplication::getAllSettings - virtual swift::misc::CValueCachePacket getAllSettings() const override + swift::misc::CValueCachePacket getAllSettings() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::CValueCachePacket(); } //! \copydoc IContextApplication::getUnsavedSettingsKeys - virtual QStringList getUnsavedSettingsKeys() const override + QStringList getUnsavedSettingsKeys() const override { logEmptyContextWarning(Q_FUNC_INFO); return QStringList(); } //! \copydoc IContextApplication::getUnsavedSettingsKeys - virtual swift::core::context::CSettingsDictionary getUnsavedSettingsKeysDescribed() const override + swift::core::context::CSettingsDictionary getUnsavedSettingsKeysDescribed() const override { logEmptyContextWarning(Q_FUNC_INFO); return CSettingsDictionary(); } //! \copydoc IContextApplication::synchronizeLocalSettings - virtual void synchronizeLocalSettings() override { logEmptyContextWarning(Q_FUNC_INFO); } + void synchronizeLocalSettings() override { logEmptyContextWarning(Q_FUNC_INFO); } //! \copydoc IContextApplication::saveSettings - virtual swift::misc::CStatusMessage saveSettings(const QString &keyPrefix = {}) override + swift::misc::CStatusMessage saveSettings(const QString &keyPrefix = {}) override { Q_UNUSED(keyPrefix); logEmptyContextWarning(Q_FUNC_INFO); @@ -70,7 +70,7 @@ namespace swift::core } //! \copydoc IContextApplication::saveSettingsByKey - virtual swift::misc::CStatusMessage saveSettingsByKey(const QStringList &keys) override + swift::misc::CStatusMessage saveSettingsByKey(const QStringList &keys) override { Q_UNUSED(keys); logEmptyContextWarning(Q_FUNC_INFO); @@ -78,15 +78,14 @@ namespace swift::core } //! \copydoc IContextApplication::loadSettings - virtual swift::misc::CStatusMessage loadSettings() override + swift::misc::CStatusMessage loadSettings() override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::CStatusMessage(); } //! \copydoc IContextApplication::registerHotkeyActions - virtual void registerHotkeyActions(const QStringList &actions, - const swift::misc::CIdentifier &origin) override + void registerHotkeyActions(const QStringList &actions, const swift::misc::CIdentifier &origin) override { Q_UNUSED(actions); Q_UNUSED(origin); @@ -94,8 +93,8 @@ namespace swift::core } //! \copydoc IContextApplication::callHotkeyActionRemotely - virtual void callHotkeyActionRemotely(const QString &action, bool argument, - const swift::misc::CIdentifier &origin) override + void callHotkeyActionRemotely(const QString &action, bool argument, + const swift::misc::CIdentifier &origin) override { Q_UNUSED(action); Q_UNUSED(argument); @@ -104,7 +103,7 @@ namespace swift::core } //! \copydoc IContextApplication::registerApplication - virtual swift::misc::CIdentifier registerApplication(const swift::misc::CIdentifier &application) override + swift::misc::CIdentifier registerApplication(const swift::misc::CIdentifier &application) override { Q_UNUSED(application); logEmptyContextWarning(Q_FUNC_INFO); @@ -112,21 +111,21 @@ namespace swift::core } //! \copydoc IContextApplication::unregisterApplication - virtual void unregisterApplication(const swift::misc::CIdentifier &application) override + void unregisterApplication(const swift::misc::CIdentifier &application) override { Q_UNUSED(application); logEmptyContextWarning(Q_FUNC_INFO); } //! \copydoc IContextApplication::getRegisteredApplications - virtual swift::misc::CIdentifierList getRegisteredApplications() const override + swift::misc::CIdentifierList getRegisteredApplications() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::CIdentifierList(); } //! \copydoc IContextApplication::getApplicationIdentifier - virtual swift::misc::CIdentifier getApplicationIdentifier() const override + swift::misc::CIdentifier getApplicationIdentifier() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::CIdentifier(); diff --git a/src/core/context/contextapplicationimpl.h b/src/core/context/contextapplicationimpl.h index 15daa2fc47..4b3b7d381d 100644 --- a/src/core/context/contextapplicationimpl.h +++ b/src/core/context/contextapplicationimpl.h @@ -40,49 +40,48 @@ namespace swift::core public slots: //! \copydoc swift::core::context::IContextApplication::changeSettings - virtual void changeSettings(const swift::misc::CValueCachePacket &settings, - const swift::misc::CIdentifier &origin) override; + void changeSettings(const swift::misc::CValueCachePacket &settings, + const swift::misc::CIdentifier &origin) override; //! \copydoc swift::core::context::IContextApplication::getAllSettings - virtual swift::misc::CValueCachePacket getAllSettings() const override; + swift::misc::CValueCachePacket getAllSettings() const override; //! \copydoc swift::core::context::IContextApplication::getUnsavedSettingsKeys - virtual QStringList getUnsavedSettingsKeys() const override; + QStringList getUnsavedSettingsKeys() const override; //! \copydoc swift::core::context::IContextApplication::getUnsavedSettingsKeysDescribed - virtual swift::core::context::CSettingsDictionary getUnsavedSettingsKeysDescribed() const override; + swift::core::context::CSettingsDictionary getUnsavedSettingsKeysDescribed() const override; //! \copydoc swift::core::context::IContextApplication::synchronizeLocalSettings - virtual void synchronizeLocalSettings() override; + void synchronizeLocalSettings() override; //! \copydoc swift::core::context::IContextApplication::saveSettings - virtual swift::misc::CStatusMessage saveSettings(const QString &keyPrefix = {}) override; + swift::misc::CStatusMessage saveSettings(const QString &keyPrefix = {}) override; //! \copydoc swift::core::context::IContextApplication::saveSettingsByKey - virtual swift::misc::CStatusMessage saveSettingsByKey(const QStringList &keys) override; + swift::misc::CStatusMessage saveSettingsByKey(const QStringList &keys) override; //! \copydoc swift::core::context::IContextApplication::loadSettings - virtual swift::misc::CStatusMessage loadSettings() override; + swift::misc::CStatusMessage loadSettings() override; //! \copydoc swift::core::context::IContextApplication::registerHotkeyActions - virtual void registerHotkeyActions(const QStringList &actions, - const swift::misc::CIdentifier &origin) override; + void registerHotkeyActions(const QStringList &actions, const swift::misc::CIdentifier &origin) override; //! \copydoc swift::core::context::IContextApplication::callHotkeyActionRemotely - virtual void callHotkeyActionRemotely(const QString &action, bool argument, - const swift::misc::CIdentifier &origin) override; + void callHotkeyActionRemotely(const QString &action, bool argument, + const swift::misc::CIdentifier &origin) override; //! \copydoc swift::core::context::IContextApplication::registerApplication - virtual swift::misc::CIdentifier registerApplication(const swift::misc::CIdentifier &application) override; + swift::misc::CIdentifier registerApplication(const swift::misc::CIdentifier &application) override; //! \copydoc swift::core::context::IContextApplication::unregisterApplication - virtual void unregisterApplication(const swift::misc::CIdentifier &application) override; + void unregisterApplication(const swift::misc::CIdentifier &application) override; //! \copydoc swift::core::context::IContextApplication::getRegisteredApplications - virtual swift::misc::CIdentifierList getRegisteredApplications() const override; + swift::misc::CIdentifierList getRegisteredApplications() const override; //! \copydoc swift::core::context::IContextApplication::getApplicationIdentifier - virtual swift::misc::CIdentifier getApplicationIdentifier() const override; + swift::misc::CIdentifier getApplicationIdentifier() const override; protected: //! Constructor diff --git a/src/core/context/contextapplicationproxy.h b/src/core/context/contextapplicationproxy.h index a0ecba43e3..71773e6e63 100644 --- a/src/core/context/contextapplicationproxy.h +++ b/src/core/context/contextapplicationproxy.h @@ -41,53 +41,52 @@ namespace swift::core public: //! Destructor - virtual ~CContextApplicationProxy() override {} + ~CContextApplicationProxy() override = default; public slots: //! \copydoc swift::core::context::IContextApplication::changeSettings - virtual void changeSettings(const swift::misc::CValueCachePacket &settings, - const swift::misc::CIdentifier &origin) override; + void changeSettings(const swift::misc::CValueCachePacket &settings, + const swift::misc::CIdentifier &origin) override; //! \copydoc swift::core::context::IContextApplication::getAllSettings - virtual swift::misc::CValueCachePacket getAllSettings() const override; + swift::misc::CValueCachePacket getAllSettings() const override; //! \copydoc swift::core::context::IContextApplication::getUnsavedSettingsKeys - virtual QStringList getUnsavedSettingsKeys() const override; + QStringList getUnsavedSettingsKeys() const override; //! \copydoc swift::core::context::IContextApplication::getUnsavedSettingsKeysDescribed - virtual swift::core::context::CSettingsDictionary getUnsavedSettingsKeysDescribed() const override; + swift::core::context::CSettingsDictionary getUnsavedSettingsKeysDescribed() const override; //! \copydoc swift::core::context::IContextApplication::synchronizeLocalSettings - virtual void synchronizeLocalSettings() override; + void synchronizeLocalSettings() override; //! \copydoc swift::core::context::IContextApplication::saveSettings - virtual swift::misc::CStatusMessage saveSettings(const QString &keyPrefix = {}) override; + swift::misc::CStatusMessage saveSettings(const QString &keyPrefix = {}) override; //! \copydoc swift::core::context::IContextApplication::saveSettingsByKey - virtual swift::misc::CStatusMessage saveSettingsByKey(const QStringList &keys) override; + swift::misc::CStatusMessage saveSettingsByKey(const QStringList &keys) override; //! \copydoc swift::core::context::IContextApplication::loadSettings - virtual swift::misc::CStatusMessage loadSettings() override; + swift::misc::CStatusMessage loadSettings() override; //! \copydoc swift::core::context::IContextApplication::registerHotkeyActions - virtual void registerHotkeyActions(const QStringList &actions, - const swift::misc::CIdentifier &origin) override; + void registerHotkeyActions(const QStringList &actions, const swift::misc::CIdentifier &origin) override; //! \copydoc swift::core::context::IContextApplication::callHotkeyActionRemotely - virtual void callHotkeyActionRemotely(const QString &action, bool argument, - const swift::misc::CIdentifier &origin) override; + void callHotkeyActionRemotely(const QString &action, bool argument, + const swift::misc::CIdentifier &origin) override; //! \copydoc swift::core::context::IContextApplication::registerApplication - virtual swift::misc::CIdentifier registerApplication(const swift::misc::CIdentifier &application) override; + swift::misc::CIdentifier registerApplication(const swift::misc::CIdentifier &application) override; //! \copydoc swift::core::context::IContextApplication::unregisterApplication - virtual void unregisterApplication(const swift::misc::CIdentifier &application) override; + void unregisterApplication(const swift::misc::CIdentifier &application) override; //! \copydoc swift::core::context::IContextApplication::getRegisteredApplications - virtual swift::misc::CIdentifierList getRegisteredApplications() const override; + swift::misc::CIdentifierList getRegisteredApplications() const override; //! \copydoc swift::core::context::IContextApplication::getApplicationIdentifier - virtual swift::misc::CIdentifier getApplicationIdentifier() const override; + swift::misc::CIdentifier getApplicationIdentifier() const override; //! Used to test if there is a core running? //! \note creates and connects via proxy object, so not meant for very frequent tests diff --git a/src/core/context/contextaudioproxy.h b/src/core/context/contextaudioproxy.h index 3d35e99af9..d3db3b5535 100644 --- a/src/core/context/contextaudioproxy.h +++ b/src/core/context/contextaudioproxy.h @@ -50,7 +50,7 @@ namespace swift::core public: //! Destructor - virtual ~CContextAudioProxy() override {} + ~CContextAudioProxy() override = default; //! Unit test relay signals //! \private @@ -58,27 +58,27 @@ namespace swift::core public slots: //! \copydoc swift::core::context::CContextAudioBase::getRegisteredDevices - virtual swift::misc::audio::CAudioDeviceInfoList getRegisteredDevices() const override; + swift::misc::audio::CAudioDeviceInfoList getRegisteredDevices() const override; //! \copydoc swift::core::context::CContextAudioBase::registerDevices - virtual void registerDevices(const swift::misc::audio::CAudioDeviceInfoList &devices) override; + void registerDevices(const swift::misc::audio::CAudioDeviceInfoList &devices) override; //! \copydoc swift::core::context::CContextAudioBase::unRegisterDevices - virtual void unRegisterDevices(const swift::misc::audio::CAudioDeviceInfoList &devices) override; + void unRegisterDevices(const swift::misc::audio::CAudioDeviceInfoList &devices) override; //! \copydoc swift::core::context::CContextAudioBase::unRegisterDevicesFor - virtual void unRegisterDevicesFor(const swift::misc::CIdentifier &identifier) override; + void unRegisterDevicesFor(const swift::misc::CIdentifier &identifier) override; //! \copydoc swift::core::context::CContextAudioBase::registerAudioCallsign - virtual void registerAudioCallsign(const swift::misc::aviation::CCallsign &callsign, - const swift::misc::CIdentifier &identifier) override; + void registerAudioCallsign(const swift::misc::aviation::CCallsign &callsign, + const swift::misc::CIdentifier &identifier) override; //! \copydoc swift::core::context::CContextAudioBase::unRegisterAudioCallsign - virtual void unRegisterAudioCallsign(const swift::misc::aviation::CCallsign &callsign, - const swift::misc::CIdentifier &identifier) override; + void unRegisterAudioCallsign(const swift::misc::aviation::CCallsign &callsign, + const swift::misc::CIdentifier &identifier) override; //! \copydoc swift::core::context::CContextAudioBase::hasRegisteredAudioCallsign - virtual bool hasRegisteredAudioCallsign(const swift::misc::aviation::CCallsign &callsign) const override; + bool hasRegisteredAudioCallsign(const swift::misc::aviation::CCallsign &callsign) const override; private: swift::misc::CGenericDBusInterface *m_dBusInterface; diff --git a/src/core/context/contextnetwork.h b/src/core/context/contextnetwork.h index 96245152ec..b29a4067aa 100644 --- a/src/core/context/contextnetwork.h +++ b/src/core/context/contextnetwork.h @@ -91,14 +91,14 @@ namespace swift::core::context } //! \copydoc IContext::getPathAndContextId() - virtual QString getPathAndContextId() const override { return this->buildPathAndContextId(ObjectPath()); } + QString getPathAndContextId() const override { return this->buildPathAndContextId(ObjectPath()); } //! Factory method static IContextNetwork *create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, swift::misc::CDBusServer *server, QDBusConnection &connection); //! Destructor - virtual ~IContextNetwork() override {} + ~IContextNetwork() override = default; signals: //! An aircraft disappeared diff --git a/src/core/context/contextnetworkempty.h b/src/core/context/contextnetworkempty.h index 9bd95867c1..a41a9d8723 100644 --- a/src/core/context/contextnetworkempty.h +++ b/src/core/context/contextnetworkempty.h @@ -25,7 +25,7 @@ namespace swift::core::context public slots: //! \copydoc IContextNetwork::getAtcStationsOnline() - virtual swift::misc::aviation::CAtcStationList getAtcStationsOnline(bool recalculateDistance) const override + swift::misc::aviation::CAtcStationList getAtcStationsOnline(bool recalculateDistance) const override { Q_UNUSED(recalculateDistance) logEmptyContextWarning(Q_FUNC_INFO); @@ -33,7 +33,7 @@ namespace swift::core::context } //! \copydoc IContextNetwork::getClosestAtcStationsOnline() - virtual swift::misc::aviation::CAtcStationList getClosestAtcStationsOnline(int number) const override + swift::misc::aviation::CAtcStationList getClosestAtcStationsOnline(int number) const override { Q_UNUSED(number) logEmptyContextWarning(Q_FUNC_INFO); @@ -41,14 +41,14 @@ namespace swift::core::context } //! \copydoc IContextNetwork::getAircraftInRange() - virtual swift::misc::simulation::CSimulatedAircraftList getAircraftInRange() const override + swift::misc::simulation::CSimulatedAircraftList getAircraftInRange() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::simulation::CSimulatedAircraftList(); } //! \copydoc IContextNetwork::getAircraftInRangeForCallsign - virtual swift::misc::simulation::CSimulatedAircraft + swift::misc::simulation::CSimulatedAircraft getAircraftInRangeForCallsign(const swift::misc::aviation::CCallsign &callsign) const override { Q_UNUSED(callsign) @@ -57,7 +57,7 @@ namespace swift::core::context } //! \copydoc IContextNetwork::getOnlineStationsForFrequency - virtual swift::misc::aviation::CAtcStationList + swift::misc::aviation::CAtcStationList getOnlineStationsForFrequency(const swift::misc::physical_quantities::CFrequency &frequency) const override { Q_UNUSED(frequency) @@ -66,21 +66,21 @@ namespace swift::core::context } //! \copydoc IContextNetwork::getAircraftInRangeCallsigns() - virtual swift::misc::aviation::CCallsignSet getAircraftInRangeCallsigns() const override + swift::misc::aviation::CCallsignSet getAircraftInRangeCallsigns() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::aviation::CCallsignSet(); } //! \copydoc IContextNetwork::getAircraftInRangeCount - virtual int getAircraftInRangeCount() const override + int getAircraftInRangeCount() const override { logEmptyContextWarning(Q_FUNC_INFO); return 0; } //! \copydoc IContextNetwork::isAircraftInRange - virtual bool isAircraftInRange(const swift::misc::aviation::CCallsign &callsign) const override + bool isAircraftInRange(const swift::misc::aviation::CCallsign &callsign) const override { Q_UNUSED(callsign) logEmptyContextWarning(Q_FUNC_INFO); @@ -88,7 +88,7 @@ namespace swift::core::context } //! \copydoc IContextNetwork::getOnlineStationForCallsign - virtual swift::misc::aviation::CAtcStation + swift::misc::aviation::CAtcStation getOnlineStationForCallsign(const swift::misc::aviation::CCallsign &callsign) const override { Q_UNUSED(callsign) @@ -97,7 +97,7 @@ namespace swift::core::context } //! \copydoc IContextNetwork::isOnlineStation - virtual bool isOnlineStation(const swift::misc::aviation::CCallsign &callsign) const override + bool isOnlineStation(const swift::misc::aviation::CCallsign &callsign) const override { Q_UNUSED(callsign) logEmptyContextWarning(Q_FUNC_INFO); @@ -105,11 +105,11 @@ namespace swift::core::context } //! \copydoc IContextNetwork::connectToNetwork - virtual swift::misc::CStatusMessage connectToNetwork(const swift::misc::network::CServer &server, - const QString &extraLiveryString, bool sendLivery, - const QString &extraModelString, bool sendModelString, - const swift::misc::aviation::CCallsign &partnerCallsign, - swift::misc::network::CLoginMode mode) override + swift::misc::CStatusMessage connectToNetwork(const swift::misc::network::CServer &server, + const QString &extraLiveryString, bool sendLivery, + const QString &extraModelString, bool sendModelString, + const swift::misc::aviation::CCallsign &partnerCallsign, + swift::misc::network::CLoginMode mode) override { Q_UNUSED(mode) Q_UNUSED(server) @@ -123,63 +123,63 @@ namespace swift::core::context } //! \copydoc IContextNetwork::getNetworkPresetValues - virtual QStringList getNetworkPresetValues() const override + QStringList getNetworkPresetValues() const override { logEmptyContextWarning(Q_FUNC_INFO); return {}; } //! \copydoc IContextNetwork::getPartnerCallsign - virtual swift::misc::aviation::CCallsign getPartnerCallsign() const override + swift::misc::aviation::CCallsign getPartnerCallsign() const override { logEmptyContextWarning(Q_FUNC_INFO); return {}; } //! \copydoc IContextNetwork::disconnectFromNetwork() - virtual swift::misc::CStatusMessage disconnectFromNetwork() override + swift::misc::CStatusMessage disconnectFromNetwork() override { logEmptyContextWarning(Q_FUNC_INFO); return statusMessageEmptyContext(); } //! \copydoc IContextNetwork::isConnected() - virtual bool isConnected() const override + bool isConnected() const override { logEmptyContextWarning(Q_FUNC_INFO); return false; } //! \copydoc IContextNetwork::getConnectedServer - virtual swift::misc::network::CServer getConnectedServer() const override + swift::misc::network::CServer getConnectedServer() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::network::CServer(); } //! \copydoc IContextNetwork::getLoginMode - virtual swift::misc::network::CLoginMode getLoginMode() const override + swift::misc::network::CLoginMode getLoginMode() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::network::CLoginMode::Pilot; } //! \copydoc IContextNetwork::sendTextMessages() - virtual void sendTextMessages(const swift::misc::network::CTextMessageList &textMessages) override + void sendTextMessages(const swift::misc::network::CTextMessageList &textMessages) override { Q_UNUSED(textMessages) logEmptyContextWarning(Q_FUNC_INFO); } //! \copydoc IContextNetwork::sendFlightPlan() - virtual void sendFlightPlan(const swift::misc::aviation::CFlightPlan &flightPlan) override + void sendFlightPlan(const swift::misc::aviation::CFlightPlan &flightPlan) override { Q_UNUSED(flightPlan) logEmptyContextWarning(Q_FUNC_INFO); } //! \copydoc IContextNetwork::loadFlightPlanFromNetwork() - virtual swift::misc::aviation::CFlightPlan + swift::misc::aviation::CFlightPlan loadFlightPlanFromNetwork(const swift::misc::aviation::CCallsign &callsign) const override { Q_UNUSED(callsign) @@ -197,14 +197,14 @@ namespace swift::core::context } //! \copydoc IContextNetwork::getUsers() - virtual swift::misc::network::CUserList getUsers() const override + swift::misc::network::CUserList getUsers() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::network::CUserList(); } //! \copydoc IContextNetwork::getUsersForCallsigns - virtual swift::misc::network::CUserList + swift::misc::network::CUserList getUsersForCallsigns(const swift::misc::aviation::CCallsignSet &callsigns) const override { Q_UNUSED(callsigns) @@ -213,8 +213,7 @@ namespace swift::core::context } //! \copydoc IContextNetwork::getUserForCallsign - virtual swift::misc::network::CUser - getUserForCallsign(const swift::misc::aviation::CCallsign &callsign) const override + swift::misc::network::CUser getUserForCallsign(const swift::misc::aviation::CCallsign &callsign) const override { Q_UNUSED(callsign) logEmptyContextWarning(Q_FUNC_INFO); @@ -222,14 +221,14 @@ namespace swift::core::context } //! \copydoc IContextNetwork::getClients - virtual swift::misc::network::CClientList getClients() const override + swift::misc::network::CClientList getClients() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::network::CClientList(); } //! \copydoc IContextNetwork::getClientsForCallsigns - virtual swift::misc::network::CClientList + swift::misc::network::CClientList getClientsForCallsigns(const swift::misc::aviation::CCallsignSet &callsigns) const override { Q_UNUSED(callsigns) @@ -238,7 +237,7 @@ namespace swift::core::context } //! \copydoc IContextNetwork::setOtherClient - virtual bool setOtherClient(const swift::misc::network::CClient &client) override + bool setOtherClient(const swift::misc::network::CClient &client) override { Q_UNUSED(client) logEmptyContextWarning(Q_FUNC_INFO); @@ -246,21 +245,21 @@ namespace swift::core::context } //! \copydoc IContextNetwork::requestAircraftDataUpdates - virtual void requestAircraftDataUpdates() override { logEmptyContextWarning(Q_FUNC_INFO); } + void requestAircraftDataUpdates() override { logEmptyContextWarning(Q_FUNC_INFO); } //! \copydoc IContextNetwork::requestAtisUpdates - virtual void requestAtisUpdates() override { logEmptyContextWarning(Q_FUNC_INFO); } + void requestAtisUpdates() override { logEmptyContextWarning(Q_FUNC_INFO); } //! \copydoc IContextNetwork::testCreateDummyOnlineAtcStations - virtual void testCreateDummyOnlineAtcStations(int number) override + void testCreateDummyOnlineAtcStations(int number) override { Q_UNUSED(number) logEmptyContextWarning(Q_FUNC_INFO); } //! \copydoc IContextNetwork::testAddAircraftParts - virtual void testAddAircraftParts(const swift::misc::aviation::CCallsign &callsign, - const swift::misc::aviation::CAircraftParts &parts, bool incremental) override + void testAddAircraftParts(const swift::misc::aviation::CCallsign &callsign, + const swift::misc::aviation::CAircraftParts &parts, bool incremental) override { Q_UNUSED(callsign) Q_UNUSED(parts) @@ -269,23 +268,23 @@ namespace swift::core::context } //! \copydoc IContextNetwork::testReceivedTextMessages - virtual void testReceivedTextMessages(const swift::misc::network::CTextMessageList &textMessages) override + void testReceivedTextMessages(const swift::misc::network::CTextMessageList &textMessages) override { Q_UNUSED(textMessages) logEmptyContextWarning(Q_FUNC_INFO); } //! \copydoc IContextNetwork::testRequestAircraftConfig - virtual void testRequestAircraftConfig(const swift::misc::aviation::CCallsign &callsign) override + void testRequestAircraftConfig(const swift::misc::aviation::CCallsign &callsign) override { Q_UNUSED(callsign) logEmptyContextWarning(Q_FUNC_INFO); } //! \copydoc IContextNetwork::testAddAltitudeOffset - virtual bool testAddAltitudeOffset(const swift::misc::aviation::CCallsign &callsign, - const swift::misc::physical_quantities::CLength &offset = - swift::misc::physical_quantities::CLength::null()) override + bool testAddAltitudeOffset(const swift::misc::aviation::CCallsign &callsign, + const swift::misc::physical_quantities::CLength &offset = + swift::misc::physical_quantities::CLength::null()) override { Q_UNUSED(callsign) Q_UNUSED(offset) @@ -294,8 +293,8 @@ namespace swift::core::context } //! \copydoc IContextNetwork::testReceivedAtisMessage - virtual void testReceivedAtisMessage(const swift::misc::aviation::CCallsign &callsign, - const swift::misc::aviation::CInformationMessage &msg) override + void testReceivedAtisMessage(const swift::misc::aviation::CCallsign &callsign, + const swift::misc::aviation::CInformationMessage &msg) override { Q_UNUSED(callsign) Q_UNUSED(msg) @@ -303,7 +302,7 @@ namespace swift::core::context } //! \copydoc IContextNetwork::parseCommandLine - virtual bool parseCommandLine(const QString &commandLine, const swift::misc::CIdentifier &originator) override + bool parseCommandLine(const QString &commandLine, const swift::misc::CIdentifier &originator) override { Q_UNUSED(commandLine) Q_UNUSED(originator) @@ -312,15 +311,14 @@ namespace swift::core::context } //! \copydoc IContextNetwork::getVatsimFsdServers - virtual swift::misc::network::CServerList getVatsimFsdServers() const override + swift::misc::network::CServerList getVatsimFsdServers() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::network::CServerList(); } //! \copydoc IContextNetwork::updateAircraftEnabled - virtual bool updateAircraftEnabled(const swift::misc::aviation::CCallsign &callsign, - bool enabledForRendering) override + bool updateAircraftEnabled(const swift::misc::aviation::CCallsign &callsign, bool enabledForRendering) override { Q_UNUSED(callsign) Q_UNUSED(enabledForRendering) @@ -329,8 +327,8 @@ namespace swift::core::context } //! \copydoc IContextNetwork::updateAircraftSupportingGndFLag - virtual bool updateAircraftSupportingGndFLag(const swift::misc::aviation::CCallsign &callsign, - bool supportGndFlag) override + bool updateAircraftSupportingGndFLag(const swift::misc::aviation::CCallsign &callsign, + bool supportGndFlag) override { Q_UNUSED(callsign) Q_UNUSED(supportGndFlag) @@ -339,9 +337,9 @@ namespace swift::core::context } //! \copydoc IContextNetwork::updateAircraftModel - virtual bool updateAircraftModel(const swift::misc::aviation::CCallsign &callsign, - const swift::misc::simulation::CAircraftModel &model, - const swift::misc::CIdentifier &originator) override + bool updateAircraftModel(const swift::misc::aviation::CCallsign &callsign, + const swift::misc::simulation::CAircraftModel &model, + const swift::misc::CIdentifier &originator) override { Q_UNUSED(callsign) Q_UNUSED(model) @@ -351,9 +349,9 @@ namespace swift::core::context } //! \copydoc IContextNetwork::updateAircraftNetworkModel - virtual bool updateAircraftNetworkModel(const swift::misc::aviation::CCallsign &callsign, - const swift::misc::simulation::CAircraftModel &model, - const swift::misc::CIdentifier &originator) override + bool updateAircraftNetworkModel(const swift::misc::aviation::CCallsign &callsign, + const swift::misc::simulation::CAircraftModel &model, + const swift::misc::CIdentifier &originator) override { Q_UNUSED(callsign) Q_UNUSED(model) @@ -363,8 +361,8 @@ namespace swift::core::context } //! \copydoc IContextNetwork::updateFastPositionEnabled - virtual bool updateFastPositionEnabled(const swift::misc::aviation::CCallsign &callsign, - bool enableFastPositionSending) override + bool updateFastPositionEnabled(const swift::misc::aviation::CCallsign &callsign, + bool enableFastPositionSending) override { logEmptyContextWarning(Q_FUNC_INFO); Q_UNUSED(callsign) @@ -373,8 +371,7 @@ namespace swift::core::context } //! \copydoc IContextNetwork::setAircraftEnabledFlag - virtual bool setAircraftEnabledFlag(const swift::misc::aviation::CCallsign &callsign, - bool enabledForRendering) override + bool setAircraftEnabledFlag(const swift::misc::aviation::CCallsign &callsign, bool enabledForRendering) override { logEmptyContextWarning(Q_FUNC_INFO); Q_UNUSED(callsign) @@ -383,24 +380,24 @@ namespace swift::core::context } //! \copydoc IContextNetwork::reInitializeAllAircraft - virtual int reInitializeAllAircraft() override { return 0; } + int reInitializeAllAircraft() override { return 0; } //! \copydoc IContextNetwork::setFastPositionEnabledCallsigns - virtual void setFastPositionEnabledCallsigns(swift::misc::aviation::CCallsignSet &callsigns) override + void setFastPositionEnabledCallsigns(swift::misc::aviation::CCallsignSet &callsigns) override { Q_UNUSED(callsigns) logEmptyContextWarning(Q_FUNC_INFO); } //! \copydoc IContextNetwork::getFastPositionEnabledCallsigns - virtual swift::misc::aviation::CCallsignSet getFastPositionEnabledCallsigns() const override + swift::misc::aviation::CCallsignSet getFastPositionEnabledCallsigns() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::aviation::CCallsignSet(); } //! \copydoc IContextNetwork::getReverseLookupMessages - virtual swift::misc::CStatusMessageList + swift::misc::CStatusMessageList getReverseLookupMessages(const swift::misc::aviation::CCallsign &callsign) const override { logEmptyContextWarning(Q_FUNC_INFO); @@ -409,21 +406,21 @@ namespace swift::core::context } //! \copydoc IContextNetwork::isReverseLookupMessagesEnabled - virtual swift::misc::simulation::ReverseLookupLogging isReverseLookupMessagesEnabled() const override + swift::misc::simulation::ReverseLookupLogging isReverseLookupMessagesEnabled() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::simulation::RevLogDisabled; } //! \copydoc IContextNetwork::enableReverseLookupMessages - virtual void enableReverseLookupMessages(swift::misc::simulation::ReverseLookupLogging enable) override + void enableReverseLookupMessages(swift::misc::simulation::ReverseLookupLogging enable) override { logEmptyContextWarning(Q_FUNC_INFO); Q_UNUSED(enable) } //! \copydoc IContextNetwork::getAircraftPartsHistory - virtual swift::misc::CStatusMessageList + swift::misc::CStatusMessageList getAircraftPartsHistory(const swift::misc::aviation::CCallsign &callsign) const override { logEmptyContextWarning(Q_FUNC_INFO); @@ -432,7 +429,7 @@ namespace swift::core::context } //! \copydoc IContextNetwork::getRemoteAircraftParts - virtual swift::misc::aviation::CAircraftPartsList + swift::misc::aviation::CAircraftPartsList getRemoteAircraftParts(const swift::misc::aviation::CCallsign &callsign) const override { logEmptyContextWarning(Q_FUNC_INFO); @@ -441,14 +438,14 @@ namespace swift::core::context } //! \copydoc IContextNetwork::isAircraftPartsHistoryEnabled - virtual bool isAircraftPartsHistoryEnabled() const override + bool isAircraftPartsHistoryEnabled() const override { logEmptyContextWarning(Q_FUNC_INFO); return false; } //! \copydoc IContextNetwork::isRemoteAircraftSupportingParts - virtual bool isRemoteAircraftSupportingParts(const swift::misc::aviation::CCallsign &callsign) const override + bool isRemoteAircraftSupportingParts(const swift::misc::aviation::CCallsign &callsign) const override { logEmptyContextWarning(Q_FUNC_INFO); Q_UNUSED(callsign) @@ -456,14 +453,14 @@ namespace swift::core::context } //! \copydoc IContextNetwork::enableAircraftPartsHistory - virtual void enableAircraftPartsHistory(bool enabled) override + void enableAircraftPartsHistory(bool enabled) override { logEmptyContextWarning(Q_FUNC_INFO); Q_UNUSED(enabled) } //! \copydoc IContextNetwork::getNetworkStatistics - virtual QString getNetworkStatistics(bool reset, const QString &separator) override + QString getNetworkStatistics(bool reset, const QString &separator) override { logEmptyContextWarning(Q_FUNC_INFO); Q_UNUSED(reset) @@ -472,7 +469,7 @@ namespace swift::core::context } //! \copydoc IContextNetwork::setNetworkStatisticsEnable - virtual bool setNetworkStatisticsEnable(bool enabled) override + bool setNetworkStatisticsEnable(bool enabled) override { logEmptyContextWarning(Q_FUNC_INFO); Q_UNUSED(enabled;) @@ -481,8 +478,8 @@ namespace swift::core::context public: //! \copydoc IContextNetwork::connectRawFsdMessageSignal - virtual QMetaObject::Connection - connectRawFsdMessageSignal(QObject *receiver, RawFsdMessageReceivedSlot rawFsdMessageReceivedSlot) override + QMetaObject::Connection connectRawFsdMessageSignal(QObject *receiver, + RawFsdMessageReceivedSlot rawFsdMessageReceivedSlot) override { logEmptyContextWarning(Q_FUNC_INFO); Q_UNUSED(receiver) diff --git a/src/core/context/contextnetworkimpl.h b/src/core/context/contextnetworkimpl.h index 7e7d72081d..e0e34fda07 100644 --- a/src/core/context/contextnetworkimpl.h +++ b/src/core/context/contextnetworkimpl.h @@ -89,53 +89,50 @@ namespace swift::core public: //! Destructor - virtual ~CContextNetwork() override; + ~CContextNetwork() override; // remoteaircraftprovider - virtual swift::misc::aviation::CAircraftSituationList + swift::misc::aviation::CAircraftSituationList remoteAircraftSituations(const swift::misc::aviation::CCallsign &callsign) const override; - virtual swift::misc::aviation::CAircraftSituation + swift::misc::aviation::CAircraftSituation remoteAircraftSituation(const swift::misc::aviation::CCallsign &callsign, int index) const override; - virtual swift::misc::MillisecondsMinMaxMean remoteAircraftSituationsTimestampDifferenceMinMaxMean( + swift::misc::MillisecondsMinMaxMean remoteAircraftSituationsTimestampDifferenceMinMaxMean( const swift::misc::aviation::CCallsign &callsign) const override; - virtual swift::misc::aviation::CAircraftSituationList latestRemoteAircraftSituations() const override; - virtual swift::misc::aviation::CAircraftSituationList latestOnGroundProviderElevations() const override; - virtual int remoteAircraftSituationsCount(const swift::misc::aviation::CCallsign &callsign) const override; - virtual swift::misc::aviation::CAircraftPartsList + swift::misc::aviation::CAircraftSituationList latestRemoteAircraftSituations() const override; + swift::misc::aviation::CAircraftSituationList latestOnGroundProviderElevations() const override; + int remoteAircraftSituationsCount(const swift::misc::aviation::CCallsign &callsign) const override; + swift::misc::aviation::CAircraftPartsList remoteAircraftParts(const swift::misc::aviation::CCallsign &callsign) const override; - virtual int remoteAircraftPartsCount(const swift::misc::aviation::CCallsign &callsign) const override; - virtual swift::misc::aviation::CCallsignSet remoteAircraftSupportingParts() const override; - virtual swift::misc::aviation::CAircraftSituationChangeList + int remoteAircraftPartsCount(const swift::misc::aviation::CCallsign &callsign) const override; + swift::misc::aviation::CCallsignSet remoteAircraftSupportingParts() const override; + swift::misc::aviation::CAircraftSituationChangeList remoteAircraftSituationChanges(const swift::misc::aviation::CCallsign &callsign) const override; - virtual int - remoteAircraftSituationChangesCount(const swift::misc::aviation::CCallsign &callsign) const override; - virtual bool updateAircraftRendered(const swift::misc::aviation::CCallsign &callsign, - bool rendered) override; - virtual int updateMultipleAircraftRendered(const swift::misc::aviation::CCallsignSet &callsigns, - bool rendered) override; - virtual int updateMultipleAircraftEnabled(const swift::misc::aviation::CCallsignSet &callsigns, - bool enabled) override; - virtual int updateAircraftGroundElevation(const swift::misc::aviation::CCallsign &callsign, - const swift::misc::geo::CElevationPlane &elevation, - swift::misc::aviation::CAircraftSituation::GndElevationInfo info, - bool *setForOnGroundPosition) override; - virtual void updateMarkAllAsNotRendered() override; - virtual swift::misc::physical_quantities::CLength + int remoteAircraftSituationChangesCount(const swift::misc::aviation::CCallsign &callsign) const override; + bool updateAircraftRendered(const swift::misc::aviation::CCallsign &callsign, bool rendered) override; + int updateMultipleAircraftRendered(const swift::misc::aviation::CCallsignSet &callsigns, + bool rendered) override; + int updateMultipleAircraftEnabled(const swift::misc::aviation::CCallsignSet &callsigns, + bool enabled) override; + int updateAircraftGroundElevation(const swift::misc::aviation::CCallsign &callsign, + const swift::misc::geo::CElevationPlane &elevation, + swift::misc::aviation::CAircraftSituation::GndElevationInfo info, + bool *setForOnGroundPosition) override; + void updateMarkAllAsNotRendered() override; + swift::misc::physical_quantities::CLength getCGFromDB(const swift::misc::aviation::CCallsign &callsign) const override; - virtual swift::misc::physical_quantities::CLength getCGFromDB(const QString &modelString) const override; - virtual void rememberCGFromDB(const swift::misc::physical_quantities::CLength &cgFromDB, - const swift::misc::aviation::CCallsign &callsign) override; - virtual void rememberCGFromDB(const swift::misc::physical_quantities::CLength &cgFromDB, - const QString &modelString) override; - virtual swift::misc::simulation::CAirspaceAircraftSnapshot - getLatestAirspaceAircraftSnapshot() const override; - virtual swift::misc::geo::CElevationPlane + swift::misc::physical_quantities::CLength getCGFromDB(const QString &modelString) const override; + void rememberCGFromDB(const swift::misc::physical_quantities::CLength &cgFromDB, + const swift::misc::aviation::CCallsign &callsign) override; + void rememberCGFromDB(const swift::misc::physical_quantities::CLength &cgFromDB, + const QString &modelString) override; + swift::misc::simulation::CAirspaceAircraftSnapshot getLatestAirspaceAircraftSnapshot() const override; + swift::misc::geo::CElevationPlane averageElevationOfNonMovingAircraft(const swift::misc::aviation::CAircraftSituation &reference, const swift::misc::physical_quantities::CLength &range, int minValues = 1, int sufficientValues = 2) const override; //! \copydoc swift::misc::simulation::IRemoteAircraftProvider::connectRemoteAircraftProviderSignals - virtual QList connectRemoteAircraftProviderSignals( + QList connectRemoteAircraftProviderSignals( QObject *receiver, std::function addedSituationSlot, std::function //! \copydoc IContextNetwork::parseCommandLine - virtual bool parseCommandLine(const QString &commandLine, - const swift::misc::CIdentifier &originator) override; + bool parseCommandLine(const QString &commandLine, const swift::misc::CIdentifier &originator) override; //! Register help static void registerHelp() @@ -363,50 +356,49 @@ namespace swift::core } //! \copydoc swift::core::context::IContextNetwork::getAtcStationsOnline - virtual swift::misc::aviation::CAtcStationList - getAtcStationsOnline(bool recalculateDistance) const override; + swift::misc::aviation::CAtcStationList getAtcStationsOnline(bool recalculateDistance) const override; //! \copydoc swift::core::context::IContextNetwork::getClosestAtcStationsOnline - virtual swift::misc::aviation::CAtcStationList getClosestAtcStationsOnline(int number) const override; + swift::misc::aviation::CAtcStationList getClosestAtcStationsOnline(int number) const override; //! \copydoc swift::core::context::IContextNetwork::getOnlineStationForCallsign - virtual swift::misc::aviation::CAtcStation + swift::misc::aviation::CAtcStation getOnlineStationForCallsign(const swift::misc::aviation::CCallsign &callsign) const override; //! \copydoc swift::core::context::IContextNetwork::getOnlineStationsForFrequency - virtual swift::misc::aviation::CAtcStationList + swift::misc::aviation::CAtcStationList getOnlineStationsForFrequency(const swift::misc::physical_quantities::CFrequency &frequency) const override; //! \copydoc swift::core::context::IContextNetwork::isOnlineStation - virtual bool isOnlineStation(const swift::misc::aviation::CCallsign &callsign) const override; + bool isOnlineStation(const swift::misc::aviation::CCallsign &callsign) const override; //! \copydoc swift::core::context::IContextNetwork::connectToNetwork - virtual swift::misc::CStatusMessage - connectToNetwork(const swift::misc::network::CServer &server, const QString &extraLiveryString, - bool sendLivery, const QString &extraModelString, bool sendModelString, - const swift::misc::aviation::CCallsign &partnerCallsign, - swift::misc::network::CLoginMode mode) override; + swift::misc::CStatusMessage connectToNetwork(const swift::misc::network::CServer &server, + const QString &extraLiveryString, bool sendLivery, + const QString &extraModelString, bool sendModelString, + const swift::misc::aviation::CCallsign &partnerCallsign, + swift::misc::network::CLoginMode mode) override; //! \copydoc swift::core::context::IContextNetwork::getConnectedServer - virtual swift::misc::network::CServer getConnectedServer() const override; + swift::misc::network::CServer getConnectedServer() const override; //! \copydoc swift::core::context::IContextNetwork::getLoginMode - virtual swift::misc::network::CLoginMode getLoginMode() const override; + swift::misc::network::CLoginMode getLoginMode() const override; //! \copydoc swift::core::context::IContextNetwork::disconnectFromNetwork - virtual swift::misc::CStatusMessage disconnectFromNetwork() override; + swift::misc::CStatusMessage disconnectFromNetwork() override; //! \copydoc swift::core::context::IContextNetwork::isConnected - virtual bool isConnected() const override; + bool isConnected() const override; //! \copydoc swift::core::context::IContextNetwork::sendTextMessages - virtual void sendTextMessages(const swift::misc::network::CTextMessageList &textMessages) override; + void sendTextMessages(const swift::misc::network::CTextMessageList &textMessages) override; //! \copydoc swift::core::context::IContextNetwork::sendFlightPlan - virtual void sendFlightPlan(const swift::misc::aviation::CFlightPlan &flightPlan) override; + void sendFlightPlan(const swift::misc::aviation::CFlightPlan &flightPlan) override; //! \copydoc swift::core::context::IContextNetwork::loadFlightPlanFromNetwork - virtual swift::misc::aviation::CFlightPlan + swift::misc::aviation::CFlightPlan loadFlightPlanFromNetwork(const swift::misc::aviation::CCallsign &callsign) const override; //! \copydoc swift::core::context::IContextNetwork::getMetarForAirport @@ -414,48 +406,47 @@ namespace swift::core getMetarForAirport(const swift::misc::aviation::CAirportIcaoCode &airportIcaoCode) const override; //! \copydoc swift::core::context::IContextNetwork::getUsers - virtual swift::misc::network::CUserList getUsers() const override; + swift::misc::network::CUserList getUsers() const override; //! \copydoc swift::core::context::IContextNetwork::getUsersForCallsigns - virtual swift::misc::network::CUserList + swift::misc::network::CUserList getUsersForCallsigns(const swift::misc::aviation::CCallsignSet &callsigns) const override; //! \copydoc swift::core::context::IContextNetwork::getUserForCallsign - virtual swift::misc::network::CUser + swift::misc::network::CUser getUserForCallsign(const swift::misc::aviation::CCallsign &callsign) const override; //! \copydoc swift::core::context::IContextNetwork::getVatsimFsdServers - virtual swift::misc::network::CServerList getVatsimFsdServers() const override; + swift::misc::network::CServerList getVatsimFsdServers() const override; //! \copydoc swift::core::context::IContextNetwork::requestAircraftDataUpdates - virtual void requestAircraftDataUpdates() override; + void requestAircraftDataUpdates() override; //! \copydoc swift::core::context::IContextNetwork::requestAtisUpdates - virtual void requestAtisUpdates() override; + void requestAtisUpdates() override; //! \copydoc swift::core::context::IContextNetwork::setFastPositionEnabledCallsigns - virtual void setFastPositionEnabledCallsigns(swift::misc::aviation::CCallsignSet &callsigns) override; + void setFastPositionEnabledCallsigns(swift::misc::aviation::CCallsignSet &callsigns) override; //! \copydoc swift::core::context::IContextNetwork::getFastPositionEnabledCallsigns - virtual swift::misc::aviation::CCallsignSet getFastPositionEnabledCallsigns() const override; + swift::misc::aviation::CCallsignSet getFastPositionEnabledCallsigns() const override; //! \copydoc swift::core::context::IContextNetwork::testCreateDummyOnlineAtcStations - virtual void testCreateDummyOnlineAtcStations(int number) override; + void testCreateDummyOnlineAtcStations(int number) override; //! \copydoc swift::core::context::IContextNetwork::testAddAircraftParts - virtual void testAddAircraftParts(const swift::misc::aviation::CCallsign &callsign, - const swift::misc::aviation::CAircraftParts &parts, - bool incremental) override; + void testAddAircraftParts(const swift::misc::aviation::CCallsign &callsign, + const swift::misc::aviation::CAircraftParts &parts, bool incremental) override; //! \copydoc swift::core::context::IContextNetwork::testReceivedAtisMessage - virtual void testReceivedAtisMessage(const swift::misc::aviation::CCallsign &callsign, - const swift::misc::aviation::CInformationMessage &msg) override; + void testReceivedAtisMessage(const swift::misc::aviation::CCallsign &callsign, + const swift::misc::aviation::CInformationMessage &msg) override; //! \copydoc swift::core::context::IContextNetwork::testReceivedTextMessages - virtual void testReceivedTextMessages(const swift::misc::network::CTextMessageList &textMessages) override; + void testReceivedTextMessages(const swift::misc::network::CTextMessageList &textMessages) override; //! \copydoc swift::core::context::IContextNetwork::testRequestAircraftConfig - virtual void testRequestAircraftConfig(const swift::misc::aviation::CCallsign &callsign) override; + void testRequestAircraftConfig(const swift::misc::aviation::CCallsign &callsign) override; protected: //! Constructor, with link to runtime diff --git a/src/core/context/contextnetworkproxy.h b/src/core/context/contextnetworkproxy.h index 14a377d94c..c2f5b9473b 100644 --- a/src/core/context/contextnetworkproxy.h +++ b/src/core/context/contextnetworkproxy.h @@ -62,7 +62,7 @@ namespace swift::core public: //! Destructor - virtual ~CContextNetworkProxy() override {} + ~CContextNetworkProxy() override = default; //! Unit test relay signals //! \private @@ -73,70 +73,68 @@ namespace swift::core //! @{ //! \copydoc swift::core::context::IContextNetwork::getAtcStationsOnline - virtual swift::misc::aviation::CAtcStationList - getAtcStationsOnline(bool recalculateDistance) const override; + swift::misc::aviation::CAtcStationList getAtcStationsOnline(bool recalculateDistance) const override; //! \copydoc swift::core::context::IContextNetwork::getClosestAtcStationsOnline - virtual swift::misc::aviation::CAtcStationList getClosestAtcStationsOnline(int number) const override; + swift::misc::aviation::CAtcStationList getClosestAtcStationsOnline(int number) const override; //! \copydoc swift::core::context::IContextNetwork::getAircraftInRange - virtual swift::misc::simulation::CSimulatedAircraftList getAircraftInRange() const override; + swift::misc::simulation::CSimulatedAircraftList getAircraftInRange() const override; //! \copydoc swift::core::context::IContextNetwork::getAircraftInRangeCallsigns - virtual swift::misc::aviation::CCallsignSet getAircraftInRangeCallsigns() const override; + swift::misc::aviation::CCallsignSet getAircraftInRangeCallsigns() const override; //! \copydoc swift::core::context::IContextNetwork::getAircraftInRangeCount - virtual int getAircraftInRangeCount() const override; + int getAircraftInRangeCount() const override; //! \copydoc swift::core::context::IContextNetwork::isAircraftInRange - virtual bool isAircraftInRange(const swift::misc::aviation::CCallsign &callsign) const override; + bool isAircraftInRange(const swift::misc::aviation::CCallsign &callsign) const override; //! \copydoc swift::core::context::IContextNetwork::getAircraftInRangeForCallsign - virtual swift::misc::simulation::CSimulatedAircraft + swift::misc::simulation::CSimulatedAircraft getAircraftInRangeForCallsign(const swift::misc::aviation::CCallsign &callsign) const override; //! \copydoc swift::core::context::IContextNetwork::getOnlineStationsForFrequency - virtual swift::misc::aviation::CAtcStationList + swift::misc::aviation::CAtcStationList getOnlineStationsForFrequency(const swift::misc::physical_quantities::CFrequency &frequency) const override; //! \copydoc swift::core::context::IContextNetwork::getOnlineStationForCallsign - virtual swift::misc::aviation::CAtcStation + swift::misc::aviation::CAtcStation getOnlineStationForCallsign(const swift::misc::aviation::CCallsign &callsign) const override; //! \copydoc swift::core::context::IContextNetwork::isOnlineStation - virtual bool isOnlineStation(const swift::misc::aviation::CCallsign &callsign) const override; + bool isOnlineStation(const swift::misc::aviation::CCallsign &callsign) const override; //! \copydoc swift::core::context::IContextNetwork::connectToNetwork - virtual swift::misc::CStatusMessage - connectToNetwork(const swift::misc::network::CServer &server, const QString &extraLiveryString, - bool sendLivery, const QString &extraModelString, bool sendModelString, - const swift::misc::aviation::CCallsign &partnerCallsign, - swift::misc::network::CLoginMode mode) override; + swift::misc::CStatusMessage connectToNetwork(const swift::misc::network::CServer &server, + const QString &extraLiveryString, bool sendLivery, + const QString &extraModelString, bool sendModelString, + const swift::misc::aviation::CCallsign &partnerCallsign, + swift::misc::network::CLoginMode mode) override; //! \copydoc swift::core::context::IContextNetwork::disconnectFromNetwork - virtual swift::misc::CStatusMessage disconnectFromNetwork() override; + swift::misc::CStatusMessage disconnectFromNetwork() override; //! \copydoc swift::core::context::IContextNetwork::isConnected - virtual bool isConnected() const override; + bool isConnected() const override; //! \copydoc swift::core::context::IContextNetwork::getConnectedServer - virtual swift::misc::network::CServer getConnectedServer() const override; + swift::misc::network::CServer getConnectedServer() const override; //! \copydoc swift::core::context::IContextNetwork::getLoginMode - virtual swift::misc::network::CLoginMode getLoginMode() const override; + swift::misc::network::CLoginMode getLoginMode() const override; //! \copydoc swift::core::context::IContextNetwork::parseCommandLine - virtual bool parseCommandLine(const QString &commandLine, - const swift::misc::CIdentifier &originator) override; + bool parseCommandLine(const QString &commandLine, const swift::misc::CIdentifier &originator) override; //! \copydoc swift::core::context::IContextNetwork::sendTextMessages - virtual void sendTextMessages(const swift::misc::network::CTextMessageList &textMessages) override; + void sendTextMessages(const swift::misc::network::CTextMessageList &textMessages) override; //! \copydoc swift::core::context::IContextNetwork::sendFlightPlan - virtual void sendFlightPlan(const swift::misc::aviation::CFlightPlan &flightPlan) override; + void sendFlightPlan(const swift::misc::aviation::CFlightPlan &flightPlan) override; //! \copydoc swift::core::context::IContextNetwork::loadFlightPlanFromNetwork - virtual swift::misc::aviation::CFlightPlan + swift::misc::aviation::CFlightPlan loadFlightPlanFromNetwork(const swift::misc::aviation::CCallsign &callsign) const override; //! \copydoc swift::core::context::IContextNetwork::getMetarForAirport @@ -144,137 +142,135 @@ namespace swift::core getMetarForAirport(const swift::misc::aviation::CAirportIcaoCode &airportIcaoCode) const override; //! \copydoc swift::core::context::IContextNetwork::getUsers - virtual swift::misc::network::CUserList getUsers() const override; + swift::misc::network::CUserList getUsers() const override; //! \copydoc swift::core::context::IContextNetwork::getUsersForCallsigns - virtual swift::misc::network::CUserList + swift::misc::network::CUserList getUsersForCallsigns(const swift::misc::aviation::CCallsignSet &callsigns) const override; //! \copydoc swift::core::context::IContextNetwork::getUserForCallsign - virtual swift::misc::network::CUser + swift::misc::network::CUser getUserForCallsign(const swift::misc::aviation::CCallsign &callsign) const override; //! \copydoc swift::core::context::IContextNetwork::getClients - virtual swift::misc::network::CClientList getClients() const override; + swift::misc::network::CClientList getClients() const override; //! \copydoc swift::core::context::IContextNetwork::getVatsimFsdServers - virtual swift::misc::network::CServerList getVatsimFsdServers() const override; + swift::misc::network::CServerList getVatsimFsdServers() const override; //! \copydoc swift::core::context::IContextNetwork::getClientsForCallsigns - virtual swift::misc::network::CClientList + swift::misc::network::CClientList getClientsForCallsigns(const swift::misc::aviation::CCallsignSet &callsigns) const override; //! \copydoc swift::core::context::IContextNetwork::setOtherClient - virtual bool setOtherClient(const swift::misc::network::CClient &client) override; + bool setOtherClient(const swift::misc::network::CClient &client) override; //! \copydoc swift::core::context::IContextNetwork::requestAircraftDataUpdates - virtual void requestAircraftDataUpdates() override; + void requestAircraftDataUpdates() override; //! \copydoc swift::core::context::IContextNetwork::requestAtisUpdates - virtual void requestAtisUpdates() override; + void requestAtisUpdates() override; //! \copydoc swift::core::context::IContextNetwork::updateAircraftEnabled - virtual bool updateAircraftEnabled(const swift::misc::aviation::CCallsign &callsign, - bool enabledForRendering) override; + bool updateAircraftEnabled(const swift::misc::aviation::CCallsign &callsign, + bool enabledForRendering) override; //! \copydoc swift::core::context::IContextNetwork::setAircraftEnabledFlag - virtual bool setAircraftEnabledFlag(const swift::misc::aviation::CCallsign &callsign, - bool enabledForRendering) override; + bool setAircraftEnabledFlag(const swift::misc::aviation::CCallsign &callsign, + bool enabledForRendering) override; //! \copydoc swift::core::context::IContextNetwork::updateAircraftModel - virtual bool updateAircraftModel(const swift::misc::aviation::CCallsign &callsign, - const swift::misc::simulation::CAircraftModel &model, - const swift::misc::CIdentifier &originator) override; + bool updateAircraftModel(const swift::misc::aviation::CCallsign &callsign, + const swift::misc::simulation::CAircraftModel &model, + const swift::misc::CIdentifier &originator) override; //! \copydoc swift::core::context::IContextNetwork::updateAircraftNetworkModel - virtual bool updateAircraftNetworkModel(const swift::misc::aviation::CCallsign &callsign, - const swift::misc::simulation::CAircraftModel &model, - const swift::misc::CIdentifier &originator) override; + bool updateAircraftNetworkModel(const swift::misc::aviation::CCallsign &callsign, + const swift::misc::simulation::CAircraftModel &model, + const swift::misc::CIdentifier &originator) override; //! \copydoc swift::core::context::IContextNetwork::updateFastPositionEnabled - virtual bool updateFastPositionEnabled(const swift::misc::aviation::CCallsign &callsign, - bool enableFastPositionSending) override; + bool updateFastPositionEnabled(const swift::misc::aviation::CCallsign &callsign, + bool enableFastPositionSending) override; //! \copydoc swift::core::context::IContextNetwork::updateAircraftSupportingGndFLag - virtual bool updateAircraftSupportingGndFLag(const swift::misc::aviation::CCallsign &callsign, - bool supportGndFlag) override; + bool updateAircraftSupportingGndFLag(const swift::misc::aviation::CCallsign &callsign, + bool supportGndFlag) override; //! \copydoc swift::core::context::IContextNetwork::reInitializeAllAircraft - virtual int reInitializeAllAircraft() override; + int reInitializeAllAircraft() override; //! \copydoc swift::core::context::IContextNetwork::setFastPositionEnabledCallsigns - virtual void setFastPositionEnabledCallsigns(swift::misc::aviation::CCallsignSet &callsigns) override; + void setFastPositionEnabledCallsigns(swift::misc::aviation::CCallsignSet &callsigns) override; //! \copydoc swift::core::context::IContextNetwork::getFastPositionEnabledCallsigns - virtual swift::misc::aviation::CCallsignSet getFastPositionEnabledCallsigns() const override; + swift::misc::aviation::CCallsignSet getFastPositionEnabledCallsigns() const override; //! \copydoc swift::core::context::IContextNetwork::getReverseLookupMessages - virtual swift::misc::CStatusMessageList + swift::misc::CStatusMessageList getReverseLookupMessages(const swift::misc::aviation::CCallsign &callsign) const override; //! \copydoc swift::core::context::IContextNetwork::isReverseLookupMessagesEnabled - virtual swift::misc::simulation::ReverseLookupLogging isReverseLookupMessagesEnabled() const override; + swift::misc::simulation::ReverseLookupLogging isReverseLookupMessagesEnabled() const override; //! \copydoc swift::core::context::IContextNetwork::enableReverseLookupMessages - virtual void enableReverseLookupMessages(swift::misc::simulation::ReverseLookupLogging enable) override; + void enableReverseLookupMessages(swift::misc::simulation::ReverseLookupLogging enable) override; //! \copydoc swift::core::context::IContextNetwork::getAircraftPartsHistory - virtual swift::misc::CStatusMessageList + swift::misc::CStatusMessageList getAircraftPartsHistory(const swift::misc::aviation::CCallsign &callsign) const override; //! \copydoc swift::core::context::IContextNetwork::getRemoteAircraftParts - virtual swift::misc::aviation::CAircraftPartsList + swift::misc::aviation::CAircraftPartsList getRemoteAircraftParts(const swift::misc::aviation::CCallsign &callsign) const override; //! \copydoc swift::core::context::IContextNetwork::isAircraftPartsHistoryEnabled - virtual bool isAircraftPartsHistoryEnabled() const override; + bool isAircraftPartsHistoryEnabled() const override; //! \copydoc swift::core::context::IContextNetwork::isRemoteAircraftSupportingParts - virtual bool - isRemoteAircraftSupportingParts(const swift::misc::aviation::CCallsign &callsign) const override; + bool isRemoteAircraftSupportingParts(const swift::misc::aviation::CCallsign &callsign) const override; //! \copydoc swift::core::context::IContextNetwork::enableAircraftPartsHistory - virtual void enableAircraftPartsHistory(bool enabled) override; + void enableAircraftPartsHistory(bool enabled) override; //! \copydoc swift::core::context::IContextNetwork::getNetworkStatistics - virtual QString getNetworkStatistics(bool reset, const QString &separator) override; + QString getNetworkStatistics(bool reset, const QString &separator) override; //! \copydoc swift::core::context::IContextNetwork::setNetworkStatisticsEnable - virtual bool setNetworkStatisticsEnable(bool enabled) override; + bool setNetworkStatisticsEnable(bool enabled) override; //! \copydoc swift::core::context::IContextNetwork::getNetworkPresetValues - virtual QStringList getNetworkPresetValues() const override; + QStringList getNetworkPresetValues() const override; //! \copydoc swift::core::context::IContextNetwork::getPartnerCallsign - virtual swift::misc::aviation::CCallsign getPartnerCallsign() const override; + swift::misc::aviation::CCallsign getPartnerCallsign() const override; //! \copydoc swift::core::context::IContextNetwork::testCreateDummyOnlineAtcStations - virtual void testCreateDummyOnlineAtcStations(int number) override; + void testCreateDummyOnlineAtcStations(int number) override; //! \copydoc swift::core::context::IContextNetwork::testAddAircraftParts - virtual void testAddAircraftParts(const swift::misc::aviation::CCallsign &callsign, - const swift::misc::aviation::CAircraftParts &parts, - bool incremental) override; + void testAddAircraftParts(const swift::misc::aviation::CCallsign &callsign, + const swift::misc::aviation::CAircraftParts &parts, bool incremental) override; //! \copydoc swift::core::context::IContextNetwork::testReceivedTextMessages - virtual void testReceivedTextMessages(const swift::misc::network::CTextMessageList &textMessages) override; + void testReceivedTextMessages(const swift::misc::network::CTextMessageList &textMessages) override; //! \copydoc swift::core::context::IContextNetwork::testReceivedAtisMessage - virtual void testReceivedAtisMessage(const swift::misc::aviation::CCallsign &callsign, - const swift::misc::aviation::CInformationMessage &msg) override; + void testReceivedAtisMessage(const swift::misc::aviation::CCallsign &callsign, + const swift::misc::aviation::CInformationMessage &msg) override; //! \copydoc swift::core::context::IContextNetwork::testRequestAircraftConfig - virtual void testRequestAircraftConfig(const swift::misc::aviation::CCallsign &callsign) override; + void testRequestAircraftConfig(const swift::misc::aviation::CCallsign &callsign) override; //! \copydoc swift::core::context::IContextNetwork::testAddAltitudeOffset - virtual bool testAddAltitudeOffset(const swift::misc::aviation::CCallsign &callsign, - const swift::misc::physical_quantities::CLength &offset = - swift::misc::physical_quantities::CLength::null()) override; + bool testAddAltitudeOffset(const swift::misc::aviation::CCallsign &callsign, + const swift::misc::physical_quantities::CLength &offset = + swift::misc::physical_quantities::CLength::null()) override; //! @} public: //! \copydoc IContextNetwork::connectRawFsdMessageSignal - virtual QMetaObject::Connection + QMetaObject::Connection connectRawFsdMessageSignal(QObject *receiver, RawFsdMessageReceivedSlot rawFsdMessageReceivedSlot) override; private: diff --git a/src/core/context/contextownaircraft.h b/src/core/context/contextownaircraft.h index f683ce202a..121a94c144 100644 --- a/src/core/context/contextownaircraft.h +++ b/src/core/context/contextownaircraft.h @@ -69,14 +69,14 @@ namespace swift::core::context } //! \copydoc IContext::getPathAndContextId() - virtual QString getPathAndContextId() const override { return this->buildPathAndContextId(ObjectPath()); } + QString getPathAndContextId() const override { return this->buildPathAndContextId(ObjectPath()); } //! Factory method static IContextOwnAircraft *create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, swift::misc::CDBusServer *server, QDBusConnection &connection); //! Destructor - virtual ~IContextOwnAircraft() override {} + ~IContextOwnAircraft() override = default; signals: //! Aircraft cockpit update diff --git a/src/core/context/contextownaircraftempty.h b/src/core/context/contextownaircraftempty.h index e1804a464b..8b0bc43119 100644 --- a/src/core/context/contextownaircraftempty.h +++ b/src/core/context/contextownaircraftempty.h @@ -24,14 +24,14 @@ namespace swift::core::context public slots: //! \copydoc IContextOwnAircraft::getOwnAircraft() - virtual swift::misc::simulation::CSimulatedAircraft getOwnAircraft() const override + swift::misc::simulation::CSimulatedAircraft getOwnAircraft() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::simulation::CSimulatedAircraft(); } //! \copydoc IContextOwnAircraft::getOwnComSystem - virtual swift::misc::aviation::CComSystem + swift::misc::aviation::CComSystem getOwnComSystem(swift::misc::aviation::CComSystem::ComUnit unit) const override { Q_UNUSED((unit);) @@ -40,23 +40,23 @@ namespace swift::core::context } //! \copydoc IContextOwnAircraft::getOwnTransponder() - virtual swift::misc::aviation::CTransponder getOwnTransponder() const override + swift::misc::aviation::CTransponder getOwnTransponder() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::aviation::CTransponder(); } //! \copydoc IContextOwnAircraft::getOwnAircraftSituation() - virtual swift::misc::aviation::CAircraftSituation getOwnAircraftSituation() const override + swift::misc::aviation::CAircraftSituation getOwnAircraftSituation() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::aviation::CAircraftSituation(); } //! \copydoc IContextOwnAircraft::updateOwnPosition - virtual bool updateOwnPosition(const swift::misc::geo::CCoordinateGeodetic &position, - const swift::misc::aviation::CAltitude &altitude, - const swift::misc::aviation::CAltitude &pressureAltitude) override + bool updateOwnPosition(const swift::misc::geo::CCoordinateGeodetic &position, + const swift::misc::aviation::CAltitude &altitude, + const swift::misc::aviation::CAltitude &pressureAltitude) override { Q_UNUSED(position); Q_UNUSED(altitude); @@ -66,10 +66,9 @@ namespace swift::core::context } //! \copydoc IContextOwnAircraft::updateCockpit - virtual bool updateCockpit(const swift::misc::aviation::CComSystem &com1, - const swift::misc::aviation::CComSystem &com2, - const swift::misc::aviation::CTransponder &transponder, - const swift::misc::CIdentifier &originator) override + bool updateCockpit(const swift::misc::aviation::CComSystem &com1, const swift::misc::aviation::CComSystem &com2, + const swift::misc::aviation::CTransponder &transponder, + const swift::misc::CIdentifier &originator) override { Q_UNUSED(com1); Q_UNUSED(com2); @@ -80,8 +79,8 @@ namespace swift::core::context } //! \copydoc IContextOwnAircraft::updateTransponderMode - virtual bool updateTransponderMode(const swift::misc::aviation::CTransponder::TransponderMode &transponderMode, - const swift::misc::CIdentifier &originator) override + bool updateTransponderMode(const swift::misc::aviation::CTransponder::TransponderMode &transponderMode, + const swift::misc::CIdentifier &originator) override { Q_UNUSED(transponderMode); Q_UNUSED(originator); @@ -90,9 +89,9 @@ namespace swift::core::context } //! \copydoc IContextOwnAircraft::updateActiveComFrequency - virtual bool updateActiveComFrequency(const swift::misc::physical_quantities::CFrequency &frequency, - swift::misc::aviation::CComSystem::ComUnit comUnit, - const swift::misc::CIdentifier &originator) override + bool updateActiveComFrequency(const swift::misc::physical_quantities::CFrequency &frequency, + swift::misc::aviation::CComSystem::ComUnit comUnit, + const swift::misc::CIdentifier &originator) override { Q_UNUSED(frequency); Q_UNUSED(comUnit); @@ -102,7 +101,7 @@ namespace swift::core::context } //! \copydoc IContextOwnAircraft::updateOwnAircraftPilot - virtual bool updateOwnAircraftPilot(const swift::misc::network::CUser &pilot) override + bool updateOwnAircraftPilot(const swift::misc::network::CUser &pilot) override { Q_UNUSED(pilot); logEmptyContextWarning(Q_FUNC_INFO); @@ -110,8 +109,8 @@ namespace swift::core::context } //! \copydoc IContextOwnAircraft::updateSelcal - virtual bool updateSelcal(const swift::misc::aviation::CSelcal &selcal, - const swift::misc::CIdentifier &originator) override + bool updateSelcal(const swift::misc::aviation::CSelcal &selcal, + const swift::misc::CIdentifier &originator) override { Q_UNUSED(selcal); Q_UNUSED(originator); @@ -120,7 +119,7 @@ namespace swift::core::context } //! \copydoc IContextOwnAircraft::updateOwnCallsign - virtual bool updateOwnCallsign(const swift::misc::aviation::CCallsign &callsign) override + bool updateOwnCallsign(const swift::misc::aviation::CCallsign &callsign) override { Q_UNUSED(callsign); logEmptyContextWarning(Q_FUNC_INFO); @@ -128,8 +127,8 @@ namespace swift::core::context } //! \copydoc IContextOwnAircraft::updateOwnIcaoCodes - virtual bool updateOwnIcaoCodes(const swift::misc::aviation::CAircraftIcaoCode &aircraftIcaoCode, - const swift::misc::aviation::CAirlineIcaoCode &airlineIcaoCode) override + bool updateOwnIcaoCodes(const swift::misc::aviation::CAircraftIcaoCode &aircraftIcaoCode, + const swift::misc::aviation::CAirlineIcaoCode &airlineIcaoCode) override { Q_UNUSED(aircraftIcaoCode); Q_UNUSED(airlineIcaoCode); @@ -138,10 +137,10 @@ namespace swift::core::context } //! \copydoc IContextOwnAircraft::toggleTransponderMode - virtual void toggleTransponderMode() override { logEmptyContextWarning(Q_FUNC_INFO); } + void toggleTransponderMode() override { logEmptyContextWarning(Q_FUNC_INFO); } //! \copydoc IContextOwnAircraft::setTransponderMode - virtual bool setTransponderMode(swift::misc::aviation::CTransponder::TransponderMode mode) override + bool setTransponderMode(swift::misc::aviation::CTransponder::TransponderMode mode) override { Q_UNUSED(mode); logEmptyContextWarning(Q_FUNC_INFO); @@ -149,7 +148,7 @@ namespace swift::core::context } //! \copydoc IContextOwnAircraft::parseCommandLine - virtual bool parseCommandLine(const QString &commandLine, const swift::misc::CIdentifier &originator) override + bool parseCommandLine(const QString &commandLine, const swift::misc::CIdentifier &originator) override { Q_UNUSED(commandLine); Q_UNUSED(originator); diff --git a/src/core/context/contextownaircraftimpl.cpp b/src/core/context/contextownaircraftimpl.cpp index 14b02040ac..4b3191ff7c 100644 --- a/src/core/context/contextownaircraftimpl.cpp +++ b/src/core/context/contextownaircraftimpl.cpp @@ -70,8 +70,6 @@ namespace swift::core::context this->initOwnAircraft(); } - CContextOwnAircraft::~CContextOwnAircraft() {} - CSimulatedAircraft CContextOwnAircraft::getOwnAircraft() const { if (isDebugEnabled()) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; } diff --git a/src/core/context/contextownaircraftimpl.h b/src/core/context/contextownaircraftimpl.h index b88cc730d0..dcc5bb849a 100644 --- a/src/core/context/contextownaircraftimpl.h +++ b/src/core/context/contextownaircraftimpl.h @@ -73,49 +73,49 @@ namespace swift::core public: //! Destructor - virtual ~CContextOwnAircraft() override; + ~CContextOwnAircraft() override = default; // IOwnAircraftProvider overrides //! \copydoc swift::misc::simulation::IOwnAircraftProvider::getOwnCallsign //! \ingroup ownaircraftprovider - virtual swift::misc::aviation::CCallsign getOwnCallsign() const override; + swift::misc::aviation::CCallsign getOwnCallsign() const override; //! \copydoc swift::misc::simulation::IOwnAircraftProvider::getOwnAircraftPosition //! \ingroup ownaircraftprovider - virtual swift::misc::geo::CCoordinateGeodetic getOwnAircraftPosition() const override; + swift::misc::geo::CCoordinateGeodetic getOwnAircraftPosition() const override; //! \copydoc swift::misc::simulation::IOwnAircraftProvider::getOwnAircraftParts //! \ingroup ownaircraftprovider - virtual swift::misc::aviation::CAircraftParts getOwnAircraftParts() const override; + swift::misc::aviation::CAircraftParts getOwnAircraftParts() const override; //! \copydoc swift::misc::simulation::IOwnAircraftProvider::getOwnAircraftModel //! \ingroup ownaircraftprovider - virtual swift::misc::simulation::CAircraftModel getOwnAircraftModel() const override; + swift::misc::simulation::CAircraftModel getOwnAircraftModel() const override; //! \copydoc swift::misc::simulation::IOwnAircraftProvider::getDistanceToOwnAircraft //! \ingroup ownaircraftprovider - virtual swift::misc::physical_quantities::CLength + swift::misc::physical_quantities::CLength getDistanceToOwnAircraft(const swift::misc::geo::ICoordinateGeodetic &position) const override; //! \copydoc swift::misc::simulation::IOwnAircraftProvider::updateOwnModel //! \ingroup ownaircraftprovider //! \remark perform reverse lookup if possible - virtual bool updateOwnModel(const swift::misc::simulation::CAircraftModel &model) override; + bool updateOwnModel(const swift::misc::simulation::CAircraftModel &model) override; //! \copydoc swift::misc::simulation::IOwnAircraftProvider::updateOwnSituation //! \ingroup ownaircraftprovider - virtual bool updateOwnSituation(const swift::misc::aviation::CAircraftSituation &situation) override; + bool updateOwnSituation(const swift::misc::aviation::CAircraftSituation &situation) override; //! \copydoc swift::misc::simulation::IOwnAircraftProvider::updateOwnParts //! \ingroup ownaircraftprovider - virtual bool updateOwnParts(const swift::misc::aviation::CAircraftParts &parts) override; + bool updateOwnParts(const swift::misc::aviation::CAircraftParts &parts) override; //! \copydoc swift::misc::simulation::IOwnAircraftProvider::updateOwnParts //! \ingroup ownaircraftprovider - virtual bool updateOwnCG(const swift::misc::physical_quantities::CLength &cg) override; + bool updateOwnCG(const swift::misc::physical_quantities::CLength &cg) override; //! \copydoc swift::misc::IProvider::asQObject - virtual QObject *asQObject() override { return this; } + QObject *asQObject() override { return this; } signals: //! Changed aircraft model @@ -127,63 +127,62 @@ namespace swift::core public slots: //! \copydoc IContextOwnAircraft::getOwnAircraft() //! \ingroup ownaircraftprovider - virtual swift::misc::simulation::CSimulatedAircraft getOwnAircraft() const override; + swift::misc::simulation::CSimulatedAircraft getOwnAircraft() const override; //! \copydoc IContextOwnAircraft::getOwnComSystem //! \ingroup ownaircraftprovider - virtual swift::misc::aviation::CComSystem + swift::misc::aviation::CComSystem getOwnComSystem(swift::misc::aviation::CComSystem::ComUnit unit) const override; //! \copydoc IContextOwnAircraft::getOwnTransponder() //! \ingroup ownaircraftprovider - virtual swift::misc::aviation::CTransponder getOwnTransponder() const override; + swift::misc::aviation::CTransponder getOwnTransponder() const override; //! \copydoc IContextOwnAircraft::getOwnAircraftSituation() //! \ingroup ownaircraftprovider - virtual swift::misc::aviation::CAircraftSituation getOwnAircraftSituation() const override; + swift::misc::aviation::CAircraftSituation getOwnAircraftSituation() const override; //! \copydoc IContextOwnAircraft::updateOwnCallsign //! \ingroup ownaircraftprovider - virtual bool updateOwnCallsign(const swift::misc::aviation::CCallsign &callsign) override; + bool updateOwnCallsign(const swift::misc::aviation::CCallsign &callsign) override; //! \copydoc IContextOwnAircraft::updateOwnIcaoCodes //! \ingroup ownaircraftprovider - virtual bool updateOwnIcaoCodes(const swift::misc::aviation::CAircraftIcaoCode &aircraftIcaoCode, - const swift::misc::aviation::CAirlineIcaoCode &airlineIcaoCode) override; + bool updateOwnIcaoCodes(const swift::misc::aviation::CAircraftIcaoCode &aircraftIcaoCode, + const swift::misc::aviation::CAirlineIcaoCode &airlineIcaoCode) override; //! \copydoc IContextOwnAircraft::updateOwnPosition - virtual bool updateOwnPosition(const swift::misc::geo::CCoordinateGeodetic &position, - const swift::misc::aviation::CAltitude &altitude, - const swift::misc::aviation::CAltitude &pressureAltitude) override; + bool updateOwnPosition(const swift::misc::geo::CCoordinateGeodetic &position, + const swift::misc::aviation::CAltitude &altitude, + const swift::misc::aviation::CAltitude &pressureAltitude) override; //! \copydoc IContextOwnAircraft::updateCockpit - virtual bool updateCockpit(const swift::misc::aviation::CComSystem &com1, - const swift::misc::aviation::CComSystem &com2, - const swift::misc::aviation::CTransponder &transponder, - const swift::misc::CIdentifier &originator) override; + bool updateCockpit(const swift::misc::aviation::CComSystem &com1, + const swift::misc::aviation::CComSystem &com2, + const swift::misc::aviation::CTransponder &transponder, + const swift::misc::CIdentifier &originator) override; //! \copydoc IContextOwnAircraft::updateTransponderMode - virtual bool - updateTransponderMode(const swift::misc::aviation::CTransponder::TransponderMode &transponderMode, - const swift::misc::CIdentifier &originator) override; + bool updateTransponderMode(const swift::misc::aviation::CTransponder::TransponderMode &transponderMode, + const swift::misc::CIdentifier &originator) override; //! \copydoc IContextOwnAircraft::updateSelcal - virtual bool updateSelcal(const swift::misc::aviation::CSelcal &selcal, - const swift::misc::CIdentifier &originator) override; + bool updateSelcal(const swift::misc::aviation::CSelcal &selcal, + const swift::misc::CIdentifier &originator) override; //! \copydoc IContextOwnAircraft::updateActiveComFrequency - virtual bool updateActiveComFrequency(const swift::misc::physical_quantities::CFrequency &frequency, - swift::misc::aviation::CComSystem::ComUnit comUnit, - const swift::misc::CIdentifier &originator) override; + bool updateActiveComFrequency(const swift::misc::physical_quantities::CFrequency &frequency, + swift::misc::aviation::CComSystem::ComUnit comUnit, + const swift::misc::CIdentifier &originator) override; //! \copydoc IContextOwnAircraft::updateOwnAircraftPilot - virtual bool updateOwnAircraftPilot(const swift::misc::network::CUser &pilot) override; + bool updateOwnAircraftPilot(const swift::misc::network::CUser &pilot) override; //! \copydoc IContextOwnAircraft::toggleTransponderMode - virtual void toggleTransponderMode() override; + void toggleTransponderMode() override; //! \copydoc IContextOwnAircraft::setTransponderMode - virtual bool setTransponderMode(swift::misc::aviation::CTransponder::TransponderMode mode) override; + bool setTransponderMode(swift::misc::aviation::CTransponder::TransponderMode mode) override; //! \ingroup swiftdotcommands //!
@@ -193,8 +192,7 @@ namespace swift::core
             //! .selcal      code       set SELCAL code         swift::core::context::CContextOwnAircraft
             //! 
//! \copydoc IContextOwnAircraft::parseCommandLine - virtual bool parseCommandLine(const QString &commandLine, - const swift::misc::CIdentifier &originator) override; + bool parseCommandLine(const QString &commandLine, const swift::misc::CIdentifier &originator) override; //! Register help static void registerHelp() diff --git a/src/core/context/contextownaircraftproxy.h b/src/core/context/contextownaircraftproxy.h index 95bfcf77c5..f318b281b6 100644 --- a/src/core/context/contextownaircraftproxy.h +++ b/src/core/context/contextownaircraftproxy.h @@ -49,7 +49,7 @@ namespace swift::core public: //! Destructor - virtual ~CContextOwnAircraftProxy() override {} + ~CContextOwnAircraftProxy() override = default; //! Unit test relay signals //! \private @@ -57,62 +57,60 @@ namespace swift::core public slots: //! \copydoc swift::core::context::IContextOwnAircraft::getOwnAircraft - virtual swift::misc::simulation::CSimulatedAircraft getOwnAircraft() const override; + swift::misc::simulation::CSimulatedAircraft getOwnAircraft() const override; //! \copydoc swift::core::context::IContextOwnAircraft::getOwnComSystem - virtual swift::misc::aviation::CComSystem + swift::misc::aviation::CComSystem getOwnComSystem(swift::misc::aviation::CComSystem::ComUnit unit) const override; //! \copydoc swift::core::context::IContextOwnAircraft::getOwnTransponder - virtual swift::misc::aviation::CTransponder getOwnTransponder() const override; + swift::misc::aviation::CTransponder getOwnTransponder() const override; //! \copydoc swift::core::context::IContextOwnAircraft::getOwnAircraftSituation - virtual swift::misc::aviation::CAircraftSituation getOwnAircraftSituation() const override; + swift::misc::aviation::CAircraftSituation getOwnAircraftSituation() const override; //! \copydoc swift::core::context::IContextOwnAircraft::updateOwnPosition - virtual bool updateOwnPosition(const swift::misc::geo::CCoordinateGeodetic &position, - const swift::misc::aviation::CAltitude &altitude, - const swift::misc::aviation::CAltitude &pressureAltitude) override; + bool updateOwnPosition(const swift::misc::geo::CCoordinateGeodetic &position, + const swift::misc::aviation::CAltitude &altitude, + const swift::misc::aviation::CAltitude &pressureAltitude) override; //! \copydoc swift::core::context::IContextOwnAircraft::updateCockpit - virtual bool updateCockpit(const swift::misc::aviation::CComSystem &com1, - const swift::misc::aviation::CComSystem &com2, - const swift::misc::aviation::CTransponder &transponder, - const swift::misc::CIdentifier &originator) override; + bool updateCockpit(const swift::misc::aviation::CComSystem &com1, + const swift::misc::aviation::CComSystem &com2, + const swift::misc::aviation::CTransponder &transponder, + const swift::misc::CIdentifier &originator) override; //! \copydoc swift::core::context::IContextOwnAircraft::updateTransponderMode - virtual bool - updateTransponderMode(const swift::misc::aviation::CTransponder::TransponderMode &transponderMode, - const swift::misc::CIdentifier &originator) override; + bool updateTransponderMode(const swift::misc::aviation::CTransponder::TransponderMode &transponderMode, + const swift::misc::CIdentifier &originator) override; //! \copydoc swift::core::context::IContextOwnAircraft::updateActiveComFrequency - virtual bool updateActiveComFrequency(const swift::misc::physical_quantities::CFrequency &frequency, - swift::misc::aviation::CComSystem::ComUnit comUnit, - const swift::misc::CIdentifier &originator) override; + bool updateActiveComFrequency(const swift::misc::physical_quantities::CFrequency &frequency, + swift::misc::aviation::CComSystem::ComUnit comUnit, + const swift::misc::CIdentifier &originator) override; //! \copydoc swift::core::context::IContextOwnAircraft::updateOwnAircraftPilot - virtual bool updateOwnAircraftPilot(const swift::misc::network::CUser &pilot) override; + bool updateOwnAircraftPilot(const swift::misc::network::CUser &pilot) override; //! \copydoc swift::core::context::IContextOwnAircraft::updateSelcal - virtual bool updateSelcal(const swift::misc::aviation::CSelcal &selcal, - const swift::misc::CIdentifier &originator) override; + bool updateSelcal(const swift::misc::aviation::CSelcal &selcal, + const swift::misc::CIdentifier &originator) override; //! \copydoc swift::core::context::IContextOwnAircraft::updateOwnCallsign - virtual bool updateOwnCallsign(const swift::misc::aviation::CCallsign &callsign) override; + bool updateOwnCallsign(const swift::misc::aviation::CCallsign &callsign) override; //! \copydoc swift::core::context::IContextOwnAircraft::updateOwnIcaoCodes - virtual bool updateOwnIcaoCodes(const swift::misc::aviation::CAircraftIcaoCode &aircraftIcaoCode, - const swift::misc::aviation::CAirlineIcaoCode &airlineIcaoCode) override; + bool updateOwnIcaoCodes(const swift::misc::aviation::CAircraftIcaoCode &aircraftIcaoCode, + const swift::misc::aviation::CAirlineIcaoCode &airlineIcaoCode) override; //! \copydoc swift::core::context::IContextOwnAircraft::toggleTransponderMode - virtual void toggleTransponderMode() override; + void toggleTransponderMode() override; //! \copydoc swift::core::context::IContextOwnAircraft::setTransponderMode - virtual bool setTransponderMode(swift::misc::aviation::CTransponder::TransponderMode mode) override; + bool setTransponderMode(swift::misc::aviation::CTransponder::TransponderMode mode) override; //! \copydoc swift::core::context::IContextOwnAircraft::parseCommandLine - virtual bool parseCommandLine(const QString &commandLine, - const swift::misc::CIdentifier &originator) override; + bool parseCommandLine(const QString &commandLine, const swift::misc::CIdentifier &originator) override; protected: //! \brief Constructor diff --git a/src/core/context/contextsimulator.h b/src/core/context/contextsimulator.h index 85617a047b..a607745ba3 100644 --- a/src/core/context/contextsimulator.h +++ b/src/core/context/contextsimulator.h @@ -71,7 +71,7 @@ namespace swift::core::context swift::misc::CDBusServer *server, QDBusConnection &connection); //! Destructor - ~IContextSimulator() override {} + ~IContextSimulator() override = default; signals: //! Simulator combined status diff --git a/src/core/context/contextsimulatorempty.h b/src/core/context/contextsimulatorempty.h index 6fc79af78e..fc374a50c8 100644 --- a/src/core/context/contextsimulatorempty.h +++ b/src/core/context/contextsimulatorempty.h @@ -25,29 +25,29 @@ namespace swift::core::context public slots: //! \copydoc IContextSimulator::getSimulatorPluginInfo - virtual swift::misc::simulation::CSimulatorPluginInfo getSimulatorPluginInfo() const override + swift::misc::simulation::CSimulatorPluginInfo getSimulatorPluginInfo() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::simulation::CSimulatorPluginInfo(); } //! \copydoc IContextSimulator::getAvailableSimulatorPlugins - virtual swift::misc::simulation::CSimulatorPluginInfoList getAvailableSimulatorPlugins() const override + swift::misc::simulation::CSimulatorPluginInfoList getAvailableSimulatorPlugins() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::simulation::CSimulatorPluginInfoList(); } //! \copydoc IContextSimulator::getSimulatorSettings - virtual swift::misc::simulation::settings::CSimulatorSettings getSimulatorSettings() const override + swift::misc::simulation::settings::CSimulatorSettings getSimulatorSettings() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::simulation::settings::CSimulatorSettings(); } //! \copydoc IContextSimulator::setSimulatorSettings - virtual bool setSimulatorSettings(const swift::misc::simulation::settings::CSimulatorSettings &settings, - const swift::misc::simulation::CSimulatorInfo &simulatorInfo) override + bool setSimulatorSettings(const swift::misc::simulation::settings::CSimulatorSettings &settings, + const swift::misc::simulation::CSimulatorInfo &simulatorInfo) override { Q_UNUSED(settings) Q_UNUSED(simulatorInfo) @@ -56,7 +56,7 @@ namespace swift::core::context } //! \copydoc IContextSimulator::startSimulatorPlugin - virtual bool startSimulatorPlugin(const swift::misc::simulation::CSimulatorPluginInfo &simulatorInfo) override + bool startSimulatorPlugin(const swift::misc::simulation::CSimulatorPluginInfo &simulatorInfo) override { Q_UNUSED(simulatorInfo) logEmptyContextWarning(Q_FUNC_INFO); @@ -64,66 +64,66 @@ namespace swift::core::context } //! \copydoc IContextSimulator::checkListeners - virtual int checkListeners() override { return 0; } + int checkListeners() override { return 0; } //! \copydoc IContextSimulator::getSimulatorStatus - virtual ISimulator::SimulatorStatus getSimulatorStatus() const override + ISimulator::SimulatorStatus getSimulatorStatus() const override { logEmptyContextWarning(Q_FUNC_INFO); return ISimulator::Unspecified; } //! \copydoc IContextSimulator::stopSimulatorPlugin - virtual void stopSimulatorPlugin(const swift::misc::simulation::CSimulatorPluginInfo &simulatorInfo) override + void stopSimulatorPlugin(const swift::misc::simulation::CSimulatorPluginInfo &simulatorInfo) override { Q_UNUSED(simulatorInfo) logEmptyContextWarning(Q_FUNC_INFO); } //! \copydoc IContextSimulator::getModelSet - virtual swift::misc::simulation::CAircraftModelList getModelSet() const override + swift::misc::simulation::CAircraftModelList getModelSet() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::simulation::CAircraftModelList(); } //! \copydoc IContextSimulator::simulatorsWithInitializedModelSet - virtual swift::misc::simulation::CSimulatorInfo simulatorsWithInitializedModelSet() const override + swift::misc::simulation::CSimulatorInfo simulatorsWithInitializedModelSet() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::simulation::CSimulatorInfo(); } //! \copydoc IContextSimulator::verifyPrerequisites - virtual swift::misc::CStatusMessageList verifyPrerequisites() const override + swift::misc::CStatusMessageList verifyPrerequisites() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::CStatusMessageList(); } //! \copydoc IContextSimulator::getModelSetLoaderSimulator - virtual swift::misc::simulation::CSimulatorInfo getModelSetLoaderSimulator() const override + swift::misc::simulation::CSimulatorInfo getModelSetLoaderSimulator() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::simulation::CSimulatorInfo(); } //! \copydoc IContextSimulator::setModelSetLoaderSimulator - virtual void setModelSetLoaderSimulator(const swift::misc::simulation::CSimulatorInfo &simulator) override + void setModelSetLoaderSimulator(const swift::misc::simulation::CSimulatorInfo &simulator) override { Q_UNUSED(simulator); logEmptyContextWarning(Q_FUNC_INFO); } //! \copydoc IContextSimulator::getModelSetStrings - virtual QStringList getModelSetStrings() const override + QStringList getModelSetStrings() const override { logEmptyContextWarning(Q_FUNC_INFO); return QStringList(); } //! \copydoc IContextSimulator::getModelSetCompleterStrings - virtual QStringList getModelSetCompleterStrings(bool sorted) const override + QStringList getModelSetCompleterStrings(bool sorted) const override { Q_UNUSED(sorted); logEmptyContextWarning(Q_FUNC_INFO); @@ -131,7 +131,7 @@ namespace swift::core::context } //! \copydoc IContextSimulator::removeModelsFromSet - virtual int removeModelsFromSet(const swift::misc::simulation::CAircraftModelList &removeModels) override + int removeModelsFromSet(const swift::misc::simulation::CAircraftModelList &removeModels) override { Q_UNUSED(removeModels); logEmptyContextWarning(Q_FUNC_INFO); @@ -139,8 +139,8 @@ namespace swift::core::context } //! \copydoc CAircraftMatcher::disableModelsForMatching - virtual void disableModelsForMatching(const swift::misc::simulation::CAircraftModelList &removedModels, - bool incremental) override + void disableModelsForMatching(const swift::misc::simulation::CAircraftModelList &removedModels, + bool incremental) override { logEmptyContextWarning(Q_FUNC_INFO); Q_UNUSED(removedModels); @@ -148,17 +148,17 @@ namespace swift::core::context } //! \copydoc CAircraftMatcher::getDisabledModelsForMatching - virtual swift::misc::simulation::CAircraftModelList getDisabledModelsForMatching() const override + swift::misc::simulation::CAircraftModelList getDisabledModelsForMatching() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::simulation::CAircraftModelList(); } //! \copydoc CAircraftMatcher::restoreDisabledModels - virtual void restoreDisabledModels() override { logEmptyContextWarning(Q_FUNC_INFO); } + void restoreDisabledModels() override { logEmptyContextWarning(Q_FUNC_INFO); } //! \copydoc swift::misc::simulation::CBackgroundValidation::triggerValidation - virtual bool triggerModelSetValidation(const swift::misc::simulation::CSimulatorInfo &simulator) override + bool triggerModelSetValidation(const swift::misc::simulation::CSimulatorInfo &simulator) override { logEmptyContextWarning(Q_FUNC_INFO); Q_UNUSED(simulator); @@ -166,14 +166,14 @@ namespace swift::core::context } //! \copydoc swift::misc::simulation::CBackgroundValidation::isValidating - virtual bool isValidationInProgress() const override + bool isValidationInProgress() const override { logEmptyContextWarning(Q_FUNC_INFO); return false; } //! \copydoc IContextSimulator::isKnownModelInSet - virtual bool isKnownModelInSet(const QString &modelstring) const override + bool isKnownModelInSet(const QString &modelstring) const override { Q_UNUSED(modelstring); logEmptyContextWarning(Q_FUNC_INFO); @@ -181,7 +181,7 @@ namespace swift::core::context } //! \copydoc IContextSimulator::getModelSetModelsStartingWith - virtual swift::misc::simulation::CAircraftModelList + swift::misc::simulation::CAircraftModelList getModelSetModelsStartingWith(const QString &modelString) const override { Q_UNUSED(modelString); @@ -190,21 +190,21 @@ namespace swift::core::context } //! \copydoc IContextSimulator::getModelSetCount - virtual int getModelSetCount() const override + int getModelSetCount() const override { logEmptyContextWarning(Q_FUNC_INFO); return 0; } //! \copydoc IContextSimulator::getSimulatorInternals - virtual swift::misc::simulation::CSimulatorInternals getSimulatorInternals() const override + swift::misc::simulation::CSimulatorInternals getSimulatorInternals() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::simulation::CSimulatorInternals(); } //! \copydoc ISimulator::getInterpolationSetupGlobal - virtual swift::misc::simulation::CInterpolationAndRenderingSetupGlobal + swift::misc::simulation::CInterpolationAndRenderingSetupGlobal getInterpolationAndRenderingSetupGlobal() const override { logEmptyContextWarning(Q_FUNC_INFO); @@ -212,15 +212,14 @@ namespace swift::core::context } //! \copydoc ISimulator::getInterpolationSetupsPerCallsign - virtual swift::misc::simulation::CInterpolationSetupList - getInterpolationAndRenderingSetupsPerCallsign() const override + swift::misc::simulation::CInterpolationSetupList getInterpolationAndRenderingSetupsPerCallsign() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::simulation::CInterpolationSetupList(); } //! \copydoc ISimulator::getInterpolationSetupPerCallsignOrDefault - virtual swift::misc::simulation::CInterpolationAndRenderingSetupPerCallsign + swift::misc::simulation::CInterpolationAndRenderingSetupPerCallsign getInterpolationAndRenderingSetupPerCallsignOrDefault( const swift::misc::aviation::CCallsign &callsign) const override { @@ -230,7 +229,7 @@ namespace swift::core::context } //! \copydoc swift::misc::simulation::IInterpolationSetupProvider::setInterpolationSetupGlobal - virtual void setInterpolationAndRenderingSetupGlobal( + void setInterpolationAndRenderingSetupGlobal( const swift::misc::simulation::CInterpolationAndRenderingSetupGlobal &setup) override { Q_UNUSED(setup) @@ -238,7 +237,7 @@ namespace swift::core::context } //! \copydoc swift::misc::simulation::IInterpolationSetupProvider::setInterpolationSetupsPerCallsign - virtual bool + bool setInterpolationAndRenderingSetupsPerCallsign(const swift::misc::simulation::CInterpolationSetupList &setups, bool ignoreSameAsGlobal) override { @@ -249,7 +248,7 @@ namespace swift::core::context } //! \copydoc IContextSimulator::getInterpolationMessages - virtual swift::misc::CStatusMessageList + swift::misc::CStatusMessageList getInterpolationMessages(const swift::misc::aviation::CCallsign &callsign) const override { Q_UNUSED(callsign) @@ -258,7 +257,7 @@ namespace swift::core::context } //! \copydoc IContextSimulator::followAircraft - virtual bool followAircraft(const swift::misc::aviation::CCallsign &callsign) override + bool followAircraft(const swift::misc::aviation::CCallsign &callsign) override { Q_UNUSED(callsign) logEmptyContextWarning(Q_FUNC_INFO); @@ -266,27 +265,27 @@ namespace swift::core::context } //! \copydoc IContextSimulator::recalculateAllAircraft - virtual void recalculateAllAircraft() override { logEmptyContextWarning(Q_FUNC_INFO); } + void recalculateAllAircraft() override { logEmptyContextWarning(Q_FUNC_INFO); } //! \copydoc IContextSimulator::resetToModelMatchingAircraft - virtual bool resetToModelMatchingAircraft(const swift::misc::aviation::CCallsign &callsign) override + bool resetToModelMatchingAircraft(const swift::misc::aviation::CCallsign &callsign) override { Q_UNUSED(callsign) return false; } //! \copydoc IContextSimulator::doMatchingsAgain - virtual int doMatchingsAgain() override { return 0; } + int doMatchingsAgain() override { return 0; } //! \copydoc IContextSimulator::doMatchingAgain - virtual bool doMatchingAgain(const swift::misc::aviation::CCallsign &callsign) override + bool doMatchingAgain(const swift::misc::aviation::CCallsign &callsign) override { Q_UNUSED(callsign) return false; } //! \copydoc IContextSimulator::requestElevationBySituation - virtual bool requestElevationBySituation(const swift::misc::aviation::CAircraftSituation &situation) override + bool requestElevationBySituation(const swift::misc::aviation::CAircraftSituation &situation) override { Q_UNUSED(situation) logEmptyContextWarning(Q_FUNC_INFO); @@ -294,7 +293,7 @@ namespace swift::core::context } //! \copydoc IContextSimulator::findClosestElevationWithinRange - virtual swift::misc::geo::CElevationPlane + swift::misc::geo::CElevationPlane findClosestElevationWithinRange(const swift::misc::geo::CCoordinateGeodetic &reference, const swift::misc::physical_quantities::CLength &range) const override { @@ -305,7 +304,7 @@ namespace swift::core::context } //! \copydoc IContextSimulator::getMatchingMessages - virtual swift::misc::CStatusMessageList + swift::misc::CStatusMessageList getMatchingMessages(const swift::misc::aviation::CCallsign &callsign) const override { Q_UNUSED(callsign); @@ -314,21 +313,21 @@ namespace swift::core::context } //! \copydoc IContextSimulator::enableMatchingMessages - virtual void enableMatchingMessages(swift::misc::simulation::MatchingLog enable) override + void enableMatchingMessages(swift::misc::simulation::MatchingLog enable) override { Q_UNUSED(enable) logEmptyContextWarning(Q_FUNC_INFO); } //! \copydoc IContextSimulator::isMatchingMessagesEnabled - virtual swift::misc::simulation::MatchingLog isMatchingMessagesEnabled() const override + swift::misc::simulation::MatchingLog isMatchingMessagesEnabled() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::simulation::MatchingLogNothing; } //! \copydoc IContextSimulator::parseCommandLine - virtual bool parseCommandLine(const QString &commandLine, const swift::misc::CIdentifier &originator) override + bool parseCommandLine(const QString &commandLine, const swift::misc::CIdentifier &originator) override { Q_UNUSED(commandLine) Q_UNUSED(originator) @@ -337,8 +336,7 @@ namespace swift::core::context } //! \copydoc IContextSimulator::getCurrentMatchingStatistics - virtual swift::misc::simulation::CMatchingStatistics - getCurrentMatchingStatistics(bool missingOnly) const override + swift::misc::simulation::CMatchingStatistics getCurrentMatchingStatistics(bool missingOnly) const override { Q_UNUSED(missingOnly) logEmptyContextWarning(Q_FUNC_INFO); @@ -346,14 +344,14 @@ namespace swift::core::context } //! \copydoc IContextSimulator::setMatchingSetup - virtual void setMatchingSetup(const swift::misc::simulation::CAircraftMatcherSetup &setup) override + void setMatchingSetup(const swift::misc::simulation::CAircraftMatcherSetup &setup) override { Q_UNUSED(setup) logEmptyContextWarning(Q_FUNC_INFO); } //! \copydoc IContextSimulator::testRemoteAircraft - virtual bool testRemoteAircraft(const swift::misc::simulation::CSimulatedAircraft &aircraft, bool add) override + bool testRemoteAircraft(const swift::misc::simulation::CSimulatedAircraft &aircraft, bool add) override { Q_UNUSED(aircraft) Q_UNUSED(add) @@ -362,9 +360,9 @@ namespace swift::core::context } //! \copydoc IContextSimulator::testUpdateRemoteAircraft - virtual bool testUpdateRemoteAircraft(const swift::misc::aviation::CCallsign &cs, - const swift::misc::aviation::CAircraftSituation &situation, - const swift::misc::aviation::CAircraftParts &parts) override + bool testUpdateRemoteAircraft(const swift::misc::aviation::CCallsign &cs, + const swift::misc::aviation::CAircraftSituation &situation, + const swift::misc::aviation::CAircraftParts &parts) override { Q_UNUSED(cs) Q_UNUSED(situation) @@ -374,7 +372,7 @@ namespace swift::core::context } //! \copydoc IContextSimulator::setMatchingSetup - virtual swift::misc::simulation::CAircraftMatcherSetup getMatchingSetup() const override + swift::misc::simulation::CAircraftMatcherSetup getMatchingSetup() const override { logEmptyContextWarning(Q_FUNC_INFO); return swift::misc::simulation::CAircraftMatcherSetup(); diff --git a/src/core/context/contextsimulatorimpl.h b/src/core/context/contextsimulatorimpl.h index c4a630b7ac..f055119364 100644 --- a/src/core/context/contextsimulatorimpl.h +++ b/src/core/context/contextsimulatorimpl.h @@ -74,162 +74,157 @@ namespace swift::core public slots: //! \copydoc swift::core::context::IContextSimulator::getSimulatorPluginInfo - virtual swift::misc::simulation::CSimulatorPluginInfo getSimulatorPluginInfo() const override; + swift::misc::simulation::CSimulatorPluginInfo getSimulatorPluginInfo() const override; //! \copydoc swift::core::context::IContextSimulator::getAvailableSimulatorPlugins - virtual swift::misc::simulation::CSimulatorPluginInfoList getAvailableSimulatorPlugins() const override; + swift::misc::simulation::CSimulatorPluginInfoList getAvailableSimulatorPlugins() const override; //! \copydoc swift::core::context::IContextSimulator::getSimulatorSettings - virtual swift::misc::simulation::settings::CSimulatorSettings getSimulatorSettings() const override; + swift::misc::simulation::settings::CSimulatorSettings getSimulatorSettings() const override; //! \copydoc swift::core::context::IContextSimulator::setSimulatorSettings - virtual bool setSimulatorSettings(const swift::misc::simulation::settings::CSimulatorSettings &settings, - const swift::misc::simulation::CSimulatorInfo &simulator) override; + bool setSimulatorSettings(const swift::misc::simulation::settings::CSimulatorSettings &settings, + const swift::misc::simulation::CSimulatorInfo &simulator) override; //! \copydoc swift::core::context::IContextSimulator::startSimulatorPlugin - virtual bool - startSimulatorPlugin(const swift::misc::simulation::CSimulatorPluginInfo &simulatorInfo) override; + bool startSimulatorPlugin(const swift::misc::simulation::CSimulatorPluginInfo &simulatorInfo) override; //! \copydoc swift::core::context::IContextSimulator::stopSimulatorPlugin - virtual void - stopSimulatorPlugin(const swift::misc::simulation::CSimulatorPluginInfo &simulatorInfo) override; + void stopSimulatorPlugin(const swift::misc::simulation::CSimulatorPluginInfo &simulatorInfo) override; //! \copydoc swift::core::context::IContextSimulator::checkListeners - virtual int checkListeners() override; + int checkListeners() override; //! \copydoc swift::core::context::IContextSimulator::getSimulatorStatus - virtual ISimulator::SimulatorStatus getSimulatorStatus() const override; + ISimulator::SimulatorStatus getSimulatorStatus() const override; //! \copydoc swift::core::context::IContextSimulator::getSimulatorInternals - virtual swift::misc::simulation::CSimulatorInternals getSimulatorInternals() const override; + swift::misc::simulation::CSimulatorInternals getSimulatorInternals() const override; //! \copydoc swift::core::context::IContextSimulator::getModelSetLoaderSimulator - virtual swift::misc::simulation::CSimulatorInfo getModelSetLoaderSimulator() const override; + swift::misc::simulation::CSimulatorInfo getModelSetLoaderSimulator() const override; //! \copydoc swift::core::context::IContextSimulator::setModelSetLoaderSimulator - virtual void setModelSetLoaderSimulator(const swift::misc::simulation::CSimulatorInfo &simulator) override; + void setModelSetLoaderSimulator(const swift::misc::simulation::CSimulatorInfo &simulator) override; //! \copydoc swift::core::context::IContextSimulator::simulatorsWithInitializedModelSet - virtual swift::misc::simulation::CSimulatorInfo simulatorsWithInitializedModelSet() const override; + swift::misc::simulation::CSimulatorInfo simulatorsWithInitializedModelSet() const override; //! \copydoc swift::core::context::IContextSimulator::verifyPrerequisites - virtual swift::misc::CStatusMessageList verifyPrerequisites() const override; + swift::misc::CStatusMessageList verifyPrerequisites() const override; //! \copydoc swift::core::context::IContextSimulator::getModelSetStrings - virtual QStringList getModelSetStrings() const override; + QStringList getModelSetStrings() const override; //! \copydoc swift::core::context::IContextSimulator::getModelSetCompleterStrings - virtual QStringList getModelSetCompleterStrings(bool sorted) const override; + QStringList getModelSetCompleterStrings(bool sorted) const override; //! \copydoc swift::core::context::IContextSimulator::isKnownModelInSet - virtual bool isKnownModelInSet(const QString &modelString) const override; + bool isKnownModelInSet(const QString &modelString) const override; //! \copydoc swift::core::context::IContextSimulator::removeModelsFromSet - virtual int removeModelsFromSet(const swift::misc::simulation::CAircraftModelList &removeModels) override; + int removeModelsFromSet(const swift::misc::simulation::CAircraftModelList &removeModels) override; //! \copydoc swift::core::context::IContextSimulator::disableModelsForMatching - virtual void disableModelsForMatching(const swift::misc::simulation::CAircraftModelList &removedModels, - bool incremental) override; + void disableModelsForMatching(const swift::misc::simulation::CAircraftModelList &removedModels, + bool incremental) override; //! \copydoc swift::core::context::IContextSimulator::getDisabledModelsForMatching - virtual swift::misc::simulation::CAircraftModelList getDisabledModelsForMatching() const override; + swift::misc::simulation::CAircraftModelList getDisabledModelsForMatching() const override; //! \copydoc swift::core::context::IContextSimulator::restoreDisabledModels - virtual void restoreDisabledModels() override; + void restoreDisabledModels() override; //! \copydoc swift::core::context::IContextSimulator::isValidationInProgress - virtual bool isValidationInProgress() const override; + bool isValidationInProgress() const override; //! \copydoc swift::core::context::IContextSimulator::triggerModelSetValidation - virtual bool triggerModelSetValidation(const swift::misc::simulation::CSimulatorInfo &simulator) override; + bool triggerModelSetValidation(const swift::misc::simulation::CSimulatorInfo &simulator) override; //! \copydoc swift::core::context::IContextSimulator::getModelSetModelsStartingWith - virtual swift::misc::simulation::CAircraftModelList + swift::misc::simulation::CAircraftModelList getModelSetModelsStartingWith(const QString &modelString) const override; //! \copydoc swift::core::context::IContextSimulator::getInterpolationAndRenderingSetupGlobal - virtual swift::misc::simulation::CInterpolationAndRenderingSetupGlobal + swift::misc::simulation::CInterpolationAndRenderingSetupGlobal getInterpolationAndRenderingSetupGlobal() const override; //! \copydoc swift::core::context::IContextSimulator::getInterpolationAndRenderingSetupsPerCallsign - virtual swift::misc::simulation::CInterpolationSetupList + swift::misc::simulation::CInterpolationSetupList getInterpolationAndRenderingSetupsPerCallsign() const override; //! \copydoc swift::core::context::IContextSimulator::getInterpolationAndRenderingSetupPerCallsignOrDefault - virtual swift::misc::simulation::CInterpolationAndRenderingSetupPerCallsign + swift::misc::simulation::CInterpolationAndRenderingSetupPerCallsign getInterpolationAndRenderingSetupPerCallsignOrDefault( const swift::misc::aviation::CCallsign &callsign) const override; //! \copydoc swift::core::context::IContextSimulator::setInterpolationAndRenderingSetupsPerCallsign - virtual bool setInterpolationAndRenderingSetupsPerCallsign( + bool setInterpolationAndRenderingSetupsPerCallsign( const swift::misc::simulation::CInterpolationSetupList &setups, bool ignoreSameAsGlobal) override; //! \copydoc swift::core::context::IContextSimulator::setInterpolationAndRenderingSetupGlobal - virtual void setInterpolationAndRenderingSetupGlobal( + void setInterpolationAndRenderingSetupGlobal( const swift::misc::simulation::CInterpolationAndRenderingSetupGlobal &setup) override; //! \copydoc swift::core::context::IContextSimulator::getInterpolationMessages - virtual swift::misc::CStatusMessageList + swift::misc::CStatusMessageList getInterpolationMessages(const swift::misc::aviation::CCallsign &callsign) const override; //! \copydoc swift::core::context::IContextSimulator::followAircraft - virtual bool followAircraft(const swift::misc::aviation::CCallsign &callsign) override; + bool followAircraft(const swift::misc::aviation::CCallsign &callsign) override; //! \copydoc swift::core::context::IContextSimulator::recalculateAllAircraft - virtual void recalculateAllAircraft() override; + void recalculateAllAircraft() override; //! \copydoc swift::core::context::IContextSimulator::resetToModelMatchingAircraft - virtual bool resetToModelMatchingAircraft(const swift::misc::aviation::CCallsign &callsign) override; + bool resetToModelMatchingAircraft(const swift::misc::aviation::CCallsign &callsign) override; //! \copydoc swift::core::context::IContextSimulator::requestElevationBySituation - virtual bool - requestElevationBySituation(const swift::misc::aviation::CAircraftSituation &situation) override; + bool requestElevationBySituation(const swift::misc::aviation::CAircraftSituation &situation) override; //! \copydoc swift::core::context::IContextSimulator::findClosestElevationWithinRange - virtual swift::misc::geo::CElevationPlane + swift::misc::geo::CElevationPlane findClosestElevationWithinRange(const swift::misc::geo::CCoordinateGeodetic &reference, const swift::misc::physical_quantities::CLength &range) const override; //! \copydoc swift::core::context::IContextSimulator::doMatchingsAgain - virtual int doMatchingsAgain() override; + int doMatchingsAgain() override; //! \copydoc swift::core::context::IContextSimulator::doMatchingAgain - virtual bool doMatchingAgain(const swift::misc::aviation::CCallsign &callsign) override; + bool doMatchingAgain(const swift::misc::aviation::CCallsign &callsign) override; //! \copydoc swift::core::context::IContextSimulator::getMatchingMessages - virtual swift::misc::CStatusMessageList + swift::misc::CStatusMessageList getMatchingMessages(const swift::misc::aviation::CCallsign &callsign) const override; //! \copydoc swift::core::context::IContextSimulator::isMatchingMessagesEnabled - virtual swift::misc::simulation::MatchingLog isMatchingMessagesEnabled() const override; + swift::misc::simulation::MatchingLog isMatchingMessagesEnabled() const override; //! \copydoc swift::core::context::IContextSimulator::enableMatchingMessages - virtual void enableMatchingMessages(swift::misc::simulation::MatchingLog enabled) override; + void enableMatchingMessages(swift::misc::simulation::MatchingLog enabled) override; //! \copydoc swift::core::context::IContextSimulator::getCurrentMatchingStatistics - virtual swift::misc::simulation::CMatchingStatistics - getCurrentMatchingStatistics(bool missingOnly) const override; + swift::misc::simulation::CMatchingStatistics getCurrentMatchingStatistics(bool missingOnly) const override; //! \copydoc swift::core::context::IContextSimulator::setMatchingSetup - virtual void setMatchingSetup(const swift::misc::simulation::CAircraftMatcherSetup &setup) override; + void setMatchingSetup(const swift::misc::simulation::CAircraftMatcherSetup &setup) override; //! \copydoc swift::core::context::IContextSimulator::getMatchingSetup - virtual swift::misc::simulation::CAircraftMatcherSetup getMatchingSetup() const override; + swift::misc::simulation::CAircraftMatcherSetup getMatchingSetup() const override; //! \copydoc swift::core::context::IContextSimulator::testRemoteAircraft - virtual bool testRemoteAircraft(const swift::misc::simulation::CSimulatedAircraft &aircraft, - bool add) override; + bool testRemoteAircraft(const swift::misc::simulation::CSimulatedAircraft &aircraft, bool add) override; //! \copydoc swift::core::context::IContextSimulator::testUpdateRemoteAircraft - virtual bool testUpdateRemoteAircraft(const swift::misc::aviation::CCallsign &cs, - const swift::misc::aviation::CAircraftSituation &situation, - const swift::misc::aviation::CAircraftParts &parts) override; + bool testUpdateRemoteAircraft(const swift::misc::aviation::CCallsign &cs, + const swift::misc::aviation::CAircraftSituation &situation, + const swift::misc::aviation::CAircraftParts &parts) override; //! \copydoc swift::core::context::IContextSimulator::getModelSet - virtual swift::misc::simulation::CAircraftModelList getModelSet() const override; + swift::misc::simulation::CAircraftModelList getModelSet() const override; //! \copydoc swift::core::context::IContextSimulator::getModelSetCount - virtual int getModelSetCount() const override; + int getModelSetCount() const override; //! \ingroup swiftdotcommands //!
@@ -240,13 +235,12 @@ namespace swift::core
             //! .ris parts on|off interpolation/rendering setup, aircraft parts
             //! 
//! \copydoc IContextSimulator::parseCommandLine - virtual bool parseCommandLine(const QString &commandLine, - const swift::misc::CIdentifier &originator) override; + bool parseCommandLine(const QString &commandLine, const swift::misc::CIdentifier &originator) override; // ----------------------------- context interface ----------------------------- public: //! Destructor - virtual ~CContextSimulator() override; + ~CContextSimulator() override; //! Gracefully shut down, e.g. for plugin unloading void gracefulShutdown(); diff --git a/src/core/context/contextsimulatorproxy.h b/src/core/context/contextsimulatorproxy.h index d3b7f9cccf..a877b6aef3 100644 --- a/src/core/context/contextsimulatorproxy.h +++ b/src/core/context/contextsimulatorproxy.h @@ -46,7 +46,7 @@ namespace swift::core public: //! Destructor - virtual ~CContextSimulatorProxy() override {} + ~CContextSimulatorProxy() override = default; //! Unit test relay signals //! \private @@ -57,166 +57,160 @@ namespace swift::core //! @{ //! \copydoc swift::core::context::IContextSimulator::getSimulatorPluginInfo - virtual swift::misc::simulation::CSimulatorPluginInfo getSimulatorPluginInfo() const override; + swift::misc::simulation::CSimulatorPluginInfo getSimulatorPluginInfo() const override; //! \copydoc swift::core::context::IContextSimulator::getAvailableSimulatorPlugins - virtual swift::misc::simulation::CSimulatorPluginInfoList getAvailableSimulatorPlugins() const override; + swift::misc::simulation::CSimulatorPluginInfoList getAvailableSimulatorPlugins() const override; //! \copydoc swift::core::context::IContextSimulator::getSimulatorSettings - virtual swift::misc::simulation::settings::CSimulatorSettings getSimulatorSettings() const override; + swift::misc::simulation::settings::CSimulatorSettings getSimulatorSettings() const override; //! \copydoc swift::core::context::IContextSimulator::setSimulatorSettings - virtual bool setSimulatorSettings(const swift::misc::simulation::settings::CSimulatorSettings &settings, - const swift::misc::simulation::CSimulatorInfo &simulatorInfo) override; + bool setSimulatorSettings(const swift::misc::simulation::settings::CSimulatorSettings &settings, + const swift::misc::simulation::CSimulatorInfo &simulatorInfo) override; //! \copydoc swift::core::context::IContextSimulator::startSimulatorPlugin - virtual bool - startSimulatorPlugin(const swift::misc::simulation::CSimulatorPluginInfo &simulatorInfo) override; + bool startSimulatorPlugin(const swift::misc::simulation::CSimulatorPluginInfo &simulatorInfo) override; //! \copydoc swift::core::context::IContextSimulator::stopSimulatorPlugin - virtual void - stopSimulatorPlugin(const swift::misc::simulation::CSimulatorPluginInfo &simulatorInfo) override; + void stopSimulatorPlugin(const swift::misc::simulation::CSimulatorPluginInfo &simulatorInfo) override; //! \copydoc swift::core::context::IContextSimulator::checkListeners - virtual int checkListeners() override; + int checkListeners() override; //! \copydoc swift::core::context::IContextSimulator::getSimulatorStatus - virtual ISimulator::SimulatorStatus getSimulatorStatus() const override; + ISimulator::SimulatorStatus getSimulatorStatus() const override; //! \copydoc swift::core::context::IContextSimulator::getModelSet - virtual swift::misc::simulation::CAircraftModelList getModelSet() const override; + swift::misc::simulation::CAircraftModelList getModelSet() const override; //! \copydoc swift::core::context::IContextSimulator::simulatorsWithInitializedModelSet - virtual swift::misc::simulation::CSimulatorInfo simulatorsWithInitializedModelSet() const override; + swift::misc::simulation::CSimulatorInfo simulatorsWithInitializedModelSet() const override; //! \copydoc swift::core::context::IContextSimulator::verifyPrerequisites - virtual swift::misc::CStatusMessageList verifyPrerequisites() const override; + swift::misc::CStatusMessageList verifyPrerequisites() const override; //! \copydoc swift::core::context::IContextSimulator::getModelSetLoaderSimulator - virtual swift::misc::simulation::CSimulatorInfo getModelSetLoaderSimulator() const override; + swift::misc::simulation::CSimulatorInfo getModelSetLoaderSimulator() const override; //! \copydoc swift::core::context::IContextSimulator::setModelSetLoaderSimulator - virtual void setModelSetLoaderSimulator(const swift::misc::simulation::CSimulatorInfo &simulator) override; + void setModelSetLoaderSimulator(const swift::misc::simulation::CSimulatorInfo &simulator) override; //! \copydoc swift::core::context::IContextSimulator::getModelSetStrings - virtual QStringList getModelSetStrings() const override; + QStringList getModelSetStrings() const override; //! \copydoc swift::core::context::IContextSimulator::getModelSetCompleterStrings - virtual QStringList getModelSetCompleterStrings(bool sorted) const override; + QStringList getModelSetCompleterStrings(bool sorted) const override; //! \copydoc swift::core::context::IContextSimulator::removeModelsFromSet - virtual int removeModelsFromSet(const swift::misc::simulation::CAircraftModelList &removeModels) override; + int removeModelsFromSet(const swift::misc::simulation::CAircraftModelList &removeModels) override; //! \copydoc swift::core::context::IContextSimulator::isKnownModelInSet - virtual bool isKnownModelInSet(const QString &modelString) const override; + bool isKnownModelInSet(const QString &modelString) const override; //! \copydoc swift::core::context::IContextSimulator::getModelSetModelsStartingWith - virtual swift::misc::simulation::CAircraftModelList + swift::misc::simulation::CAircraftModelList getModelSetModelsStartingWith(const QString &modelString) const override; //! \copydoc swift::core::context::IContextSimulator::getModelSetCount - virtual int getModelSetCount() const override; + int getModelSetCount() const override; //! \copydoc swift::core::context::IContextSimulator::getSimulatorInternals - virtual swift::misc::simulation::CSimulatorInternals getSimulatorInternals() const override; + swift::misc::simulation::CSimulatorInternals getSimulatorInternals() const override; //! \copydoc swift::core::context::IContextSimulator::disableModelsForMatching - virtual void disableModelsForMatching(const swift::misc::simulation::CAircraftModelList &removedModels, - bool incremental) override; + void disableModelsForMatching(const swift::misc::simulation::CAircraftModelList &removedModels, + bool incremental) override; //! \copydoc swift::core::context::IContextSimulator::getDisabledModelsForMatching - virtual swift::misc::simulation::CAircraftModelList getDisabledModelsForMatching() const override; + swift::misc::simulation::CAircraftModelList getDisabledModelsForMatching() const override; //! \copydoc swift::core::context::IContextSimulator::triggerModelSetValidation - virtual bool triggerModelSetValidation(const swift::misc::simulation::CSimulatorInfo &simulator) override; + bool triggerModelSetValidation(const swift::misc::simulation::CSimulatorInfo &simulator) override; //! \copydoc swift::core::context::IContextSimulator::isValidationInProgress - virtual bool isValidationInProgress() const override; + bool isValidationInProgress() const override; //! \copydoc swift::core::context::IContextSimulator::restoreDisabledModels - virtual void restoreDisabledModels() override; + void restoreDisabledModels() override; //! \copydoc swift::core::context::IContextSimulator::getInterpolationAndRenderingSetupGlobal - virtual swift::misc::simulation::CInterpolationAndRenderingSetupGlobal + swift::misc::simulation::CInterpolationAndRenderingSetupGlobal getInterpolationAndRenderingSetupGlobal() const override; //! \copydoc swift::core::context::IContextSimulator::setInterpolationAndRenderingSetupGlobal - virtual void setInterpolationAndRenderingSetupGlobal( + void setInterpolationAndRenderingSetupGlobal( const swift::misc::simulation::CInterpolationAndRenderingSetupGlobal &setup) override; //! \copydoc swift::core::context::IContextSimulator::getInterpolationAndRenderingSetupsPerCallsign - virtual swift::misc::simulation::CInterpolationSetupList + swift::misc::simulation::CInterpolationSetupList getInterpolationAndRenderingSetupsPerCallsign() const override; //! \copydoc swift::core::context::IContextSimulator::getInterpolationAndRenderingSetupPerCallsignOrDefault - virtual swift::misc::simulation::CInterpolationAndRenderingSetupPerCallsign + swift::misc::simulation::CInterpolationAndRenderingSetupPerCallsign getInterpolationAndRenderingSetupPerCallsignOrDefault( const swift::misc::aviation::CCallsign &callsign) const override; //! \copydoc swift::core::context::IContextSimulator::setInterpolationAndRenderingSetupsPerCallsign - virtual bool setInterpolationAndRenderingSetupsPerCallsign( + bool setInterpolationAndRenderingSetupsPerCallsign( const swift::misc::simulation::CInterpolationSetupList &setups, bool ignoreSameAsGlobal) override; //! \copydoc swift::core::context::IContextSimulator::getInterpolationMessages - virtual swift::misc::CStatusMessageList + swift::misc::CStatusMessageList getInterpolationMessages(const swift::misc::aviation::CCallsign &callsign) const override; //! \copydoc swift::core::context::IContextSimulator::followAircraft - virtual bool followAircraft(const swift::misc::aviation::CCallsign &callsign) override; + bool followAircraft(const swift::misc::aviation::CCallsign &callsign) override; //! \copydoc swift::core::context::IContextSimulator::recalculateAllAircraft - virtual void recalculateAllAircraft() override; + void recalculateAllAircraft() override; //! \copydoc swift::core::context::IContextSimulator::resetToModelMatchingAircraft - virtual bool resetToModelMatchingAircraft(const swift::misc::aviation::CCallsign &callsign) override; + bool resetToModelMatchingAircraft(const swift::misc::aviation::CCallsign &callsign) override; //! \copydoc swift::core::context::IContextSimulator::requestElevationBySituation - virtual bool - requestElevationBySituation(const swift::misc::aviation::CAircraftSituation &situation) override; + bool requestElevationBySituation(const swift::misc::aviation::CAircraftSituation &situation) override; //! \copydoc swift::core::context::IContextSimulator::findClosestElevationWithinRange - virtual swift::misc::geo::CElevationPlane + swift::misc::geo::CElevationPlane findClosestElevationWithinRange(const swift::misc::geo::CCoordinateGeodetic &reference, const swift::misc::physical_quantities::CLength &range) const override; //! \copydoc swift::core::context::IContextSimulator::getMatchingMessages - virtual swift::misc::CStatusMessageList + swift::misc::CStatusMessageList getMatchingMessages(const swift::misc::aviation::CCallsign &callsign) const override; //! \copydoc swift::core::context::IContextSimulator::isMatchingMessagesEnabled - virtual swift::misc::simulation::MatchingLog isMatchingMessagesEnabled() const override; + swift::misc::simulation::MatchingLog isMatchingMessagesEnabled() const override; //! \copydoc swift::core::context::IContextSimulator::enableMatchingMessages - virtual void enableMatchingMessages(swift::misc::simulation::MatchingLog enabled) override; + void enableMatchingMessages(swift::misc::simulation::MatchingLog enabled) override; //! \copydoc swift::core::context::IContextSimulator::parseCommandLine - virtual bool parseCommandLine(const QString &commandLine, - const swift::misc::CIdentifier &originator) override; + bool parseCommandLine(const QString &commandLine, const swift::misc::CIdentifier &originator) override; //! \copydoc swift::core::context::IContextSimulator::doMatchingsAgain - virtual int doMatchingsAgain() override; + int doMatchingsAgain() override; //! \copydoc swift::core::context::IContextSimulator::doMatchingAgain - virtual bool doMatchingAgain(const swift::misc::aviation::CCallsign &callsign) override; + bool doMatchingAgain(const swift::misc::aviation::CCallsign &callsign) override; //! \copydoc swift::core::context::IContextSimulator::getCurrentMatchingStatistics - virtual swift::misc::simulation::CMatchingStatistics - getCurrentMatchingStatistics(bool missingOnly) const override; + swift::misc::simulation::CMatchingStatistics getCurrentMatchingStatistics(bool missingOnly) const override; //! \copydoc swift::core::context::IContextSimulator::setMatchingSetup - virtual void setMatchingSetup(const swift::misc::simulation::CAircraftMatcherSetup &setup) override; + void setMatchingSetup(const swift::misc::simulation::CAircraftMatcherSetup &setup) override; //! \copydoc swift::core::context::IContextSimulator::getMatchingSetup - virtual swift::misc::simulation::CAircraftMatcherSetup getMatchingSetup() const override; + swift::misc::simulation::CAircraftMatcherSetup getMatchingSetup() const override; //! \copydoc swift::core::context::IContextSimulator::testRemoteAircraft - virtual bool testRemoteAircraft(const swift::misc::simulation::CSimulatedAircraft &aircraft, - bool add) override; + bool testRemoteAircraft(const swift::misc::simulation::CSimulatedAircraft &aircraft, bool add) override; //! \copydoc swift::core::context::IContextSimulator::testUpdateRemoteAircraft - virtual bool testUpdateRemoteAircraft(const swift::misc::aviation::CCallsign &cs, - const swift::misc::aviation::CAircraftSituation &situation, - const swift::misc::aviation::CAircraftParts &parts) override; + bool testUpdateRemoteAircraft(const swift::misc::aviation::CCallsign &cs, + const swift::misc::aviation::CAircraftSituation &situation, + const swift::misc::aviation::CAircraftParts &parts) override; //! @} private: diff --git a/src/core/corefacade.h b/src/core/corefacade.h index d05388328b..d4c974dce1 100644 --- a/src/core/corefacade.h +++ b/src/core/corefacade.h @@ -62,7 +62,7 @@ namespace swift::core CCoreFacade(const CCoreFacadeConfig &config, QObject *parent = nullptr); //! Destructor - virtual ~CCoreFacade() override { this->gracefulShutdown(); } + ~CCoreFacade() override { this->gracefulShutdown(); } //! Transport mechanism for sharing state between applications swift::misc::shared_state::CDataLinkDBus *getDataLinkDBus() { return this->m_dataLinkDBus; } diff --git a/src/core/data/launchersetup.h b/src/core/data/launchersetup.h index f6a7f2bf39..126c606170 100644 --- a/src/core/data/launchersetup.h +++ b/src/core/data/launchersetup.h @@ -47,7 +47,7 @@ namespace swift::core::data Q_DECLARE_FLAGS(AudioMode, AudioModeFlag) //! Default constructor - CLauncherSetup() {} + CLauncherSetup() = default; //! Destructor. // virtual ~CLauncherSetup() {} diff --git a/src/core/data/networksetup.cpp b/src/core/data/networksetup.cpp index 8a2afe4bd4..b555b8dffa 100644 --- a/src/core/data/networksetup.cpp +++ b/src/core/data/networksetup.cpp @@ -12,8 +12,6 @@ using namespace swift::misc::network; namespace swift::core::data { - CNetworkSetup::CNetworkSetup() {} - CServer CNetworkSetup::getLastVatsimServer() const { return m_lastVatsimServer.get(); } CStatusMessage CNetworkSetup::setLastVatsimServer(const CServer &server) { return m_lastVatsimServer.set(server); } diff --git a/src/core/data/networksetup.h b/src/core/data/networksetup.h index 9b6906d284..a45a20563e 100644 --- a/src/core/data/networksetup.h +++ b/src/core/data/networksetup.h @@ -27,10 +27,10 @@ namespace swift::core::data public: //! Default constructor - CNetworkSetup(); + CNetworkSetup() = default; //! Destructor. - virtual ~CNetworkSetup() {} + ~CNetworkSetup() override = default; //! Last VATSIM server (VATSIM only) swift::misc::network::CServer getLastVatsimServer() const; diff --git a/src/core/db/airportdatareader.h b/src/core/db/airportdatareader.h index 1c84fa5f1c..ae08083cbf 100644 --- a/src/core/db/airportdatareader.h +++ b/src/core/db/airportdatareader.h @@ -44,30 +44,28 @@ namespace swift::core::db int getAirportsCount() const; // data read from local data - virtual swift::misc::CStatusMessageList readFromJsonFiles(const QString &dir, - swift::misc::network::CEntityFlags::Entity whatToRead, - bool overrideNewerOnly) override; - virtual bool readFromJsonFilesInBackground(const QString &dir, - swift::misc::network::CEntityFlags::Entity whatToRead, - bool overrideNewerOnly) override; + swift::misc::CStatusMessageList readFromJsonFiles(const QString &dir, + swift::misc::network::CEntityFlags::Entity whatToRead, + bool overrideNewerOnly) override; + bool readFromJsonFilesInBackground(const QString &dir, swift::misc::network::CEntityFlags::Entity whatToRead, + bool overrideNewerOnly) override; // base class overrides - virtual swift::misc::network::CEntityFlags::Entity getSupportedEntities() const override; - virtual QDateTime getCacheTimestamp(swift::misc::network::CEntityFlags::Entity entities) const override; - virtual int getCacheCount(swift::misc::network::CEntityFlags::Entity entity) const override; - virtual swift::misc::network::CEntityFlags::Entity getEntitiesWithCacheCount() const override; - virtual swift::misc::network::CEntityFlags::Entity + swift::misc::network::CEntityFlags::Entity getSupportedEntities() const override; + QDateTime getCacheTimestamp(swift::misc::network::CEntityFlags::Entity entities) const override; + int getCacheCount(swift::misc::network::CEntityFlags::Entity entity) const override; + swift::misc::network::CEntityFlags::Entity getEntitiesWithCacheCount() const override; + swift::misc::network::CEntityFlags::Entity getEntitiesWithCacheTimestampNewerThan(const QDateTime &threshold) const override; - virtual void synchronizeCaches(swift::misc::network::CEntityFlags::Entity entities) override; - virtual void admitCaches(swift::misc::network::CEntityFlags::Entity entities) override; + void synchronizeCaches(swift::misc::network::CEntityFlags::Entity entities) override; + void admitCaches(swift::misc::network::CEntityFlags::Entity entities) override; protected: // base class overrides - virtual void invalidateCaches(swift::misc::network::CEntityFlags::Entity entities) override; - virtual bool hasChangedUrl(swift::misc::network::CEntityFlags::Entity entity, - swift::misc::network::CUrl &oldUrlInfo, - swift::misc::network::CUrl &newUrlInfo) const override; - virtual swift::misc::network::CUrl getDbServiceBaseUrl() const override; + void invalidateCaches(swift::misc::network::CEntityFlags::Entity entities) override; + bool hasChangedUrl(swift::misc::network::CEntityFlags::Entity entity, swift::misc::network::CUrl &oldUrlInfo, + swift::misc::network::CUrl &newUrlInfo) const override; + swift::misc::network::CUrl getDbServiceBaseUrl() const override; private: swift::misc::CData m_airportCache { diff --git a/src/core/db/databasereader.h b/src/core/db/databasereader.h index b68129f2b0..098c3f43fa 100644 --- a/src/core/db/databasereader.h +++ b/src/core/db/databasereader.h @@ -450,7 +450,7 @@ namespace swift::core::db const JsonDatastoreResponse &response) const; //! Network request progress - virtual void networkReplyProgress(int logId, qint64 current, qint64 max, const QUrl &url) override; + void networkReplyProgress(int logId, qint64 current, qint64 max, const QUrl &url) override; private: //! Read / re-read data file diff --git a/src/core/db/icaodatareader.h b/src/core/db/icaodatareader.h index 1722486c7b..92b6376753 100644 --- a/src/core/db/icaodatareader.h +++ b/src/core/db/icaodatareader.h @@ -141,30 +141,28 @@ namespace swift::core::db bool writeToJsonFiles(const QString &dir); // data read from local data - virtual swift::misc::CStatusMessageList readFromJsonFiles(const QString &dir, - swift::misc::network::CEntityFlags::Entity whatToRead, - bool overrideNewerOnly) override; - virtual bool readFromJsonFilesInBackground(const QString &dir, - swift::misc::network::CEntityFlags::Entity whatToRead, - bool overrideNewerOnly) override; + swift::misc::CStatusMessageList readFromJsonFiles(const QString &dir, + swift::misc::network::CEntityFlags::Entity whatToRead, + bool overrideNewerOnly) override; + bool readFromJsonFilesInBackground(const QString &dir, swift::misc::network::CEntityFlags::Entity whatToRead, + bool overrideNewerOnly) override; // cache handling for base class - virtual swift::misc::network::CEntityFlags::Entity getSupportedEntities() const override; - virtual QDateTime getCacheTimestamp(swift::misc::network::CEntityFlags::Entity entity) const override; - virtual int getCacheCount(swift::misc::network::CEntityFlags::Entity entity) const override; - virtual swift::misc::network::CEntityFlags::Entity getEntitiesWithCacheCount() const override; - virtual swift::misc::network::CEntityFlags::Entity + swift::misc::network::CEntityFlags::Entity getSupportedEntities() const override; + QDateTime getCacheTimestamp(swift::misc::network::CEntityFlags::Entity entity) const override; + int getCacheCount(swift::misc::network::CEntityFlags::Entity entity) const override; + swift::misc::network::CEntityFlags::Entity getEntitiesWithCacheCount() const override; + swift::misc::network::CEntityFlags::Entity getEntitiesWithCacheTimestampNewerThan(const QDateTime &threshold) const override; - virtual void synchronizeCaches(swift::misc::network::CEntityFlags::Entity entities) override; - virtual void admitCaches(swift::misc::network::CEntityFlags::Entity entities) override; + void synchronizeCaches(swift::misc::network::CEntityFlags::Entity entities) override; + void admitCaches(swift::misc::network::CEntityFlags::Entity entities) override; protected: // cache handling for base class - virtual void invalidateCaches(swift::misc::network::CEntityFlags::Entity entities) override; - virtual bool hasChangedUrl(swift::misc::network::CEntityFlags::Entity entity, - swift::misc::network::CUrl &oldUrlInfo, - swift::misc::network::CUrl &newUrlInfo) const override; - virtual swift::misc::network::CUrl getDbServiceBaseUrl() const override; + void invalidateCaches(swift::misc::network::CEntityFlags::Entity entities) override; + bool hasChangedUrl(swift::misc::network::CEntityFlags::Entity entity, swift::misc::network::CUrl &oldUrlInfo, + swift::misc::network::CUrl &newUrlInfo) const override; + swift::misc::network::CUrl getDbServiceBaseUrl() const override; private: swift::misc::CData m_aircraftIcaoCache { @@ -184,8 +182,8 @@ namespace swift::core::db std::atomic_bool m_syncedCategories { false }; //!< already synchronized? //! \copydoc CDatabaseReader::read - virtual void read(swift::misc::network::CEntityFlags::Entity entities, - swift::misc::db::CDbFlags::DataRetrievalModeFlag mode, const QDateTime &newerThan) override; + void read(swift::misc::network::CEntityFlags::Entity entities, + swift::misc::db::CDbFlags::DataRetrievalModeFlag mode, const QDateTime &newerThan) override; //! Reader URL (we read from where?) used to detect changes of location swift::misc::CData m_readerUrlCache { diff --git a/src/core/db/infodatareader.h b/src/core/db/infodatareader.h index c114996568..368db19a85 100644 --- a/src/core/db/infodatareader.h +++ b/src/core/db/infodatareader.h @@ -47,30 +47,28 @@ namespace swift::core::db swift::misc::network::CUrl getInfoObjectsUrl() const; // data read from local data - virtual swift::misc::CStatusMessageList readFromJsonFiles(const QString &dir, - swift::misc::network::CEntityFlags::Entity whatToRead, - bool overrideNewer) override; - virtual bool readFromJsonFilesInBackground(const QString &dir, - swift::misc::network::CEntityFlags::Entity whatToRead, - bool overrideNewer) override; + swift::misc::CStatusMessageList readFromJsonFiles(const QString &dir, + swift::misc::network::CEntityFlags::Entity whatToRead, + bool overrideNewer) override; + bool readFromJsonFilesInBackground(const QString &dir, swift::misc::network::CEntityFlags::Entity whatToRead, + bool overrideNewer) override; // cache handling for base class: no cache handling here in that case - virtual swift::misc::network::CEntityFlags::Entity getSupportedEntities() const override; - virtual QDateTime getCacheTimestamp(swift::misc::network::CEntityFlags::Entity entity) const override; - virtual int getCacheCount(swift::misc::network::CEntityFlags::Entity entity) const override; - virtual swift::misc::network::CEntityFlags::Entity getEntitiesWithCacheCount() const override; - virtual swift::misc::network::CEntityFlags::Entity + swift::misc::network::CEntityFlags::Entity getSupportedEntities() const override; + QDateTime getCacheTimestamp(swift::misc::network::CEntityFlags::Entity entity) const override; + int getCacheCount(swift::misc::network::CEntityFlags::Entity entity) const override; + swift::misc::network::CEntityFlags::Entity getEntitiesWithCacheCount() const override; + swift::misc::network::CEntityFlags::Entity getEntitiesWithCacheTimestampNewerThan(const QDateTime &threshold) const override; - virtual void synchronizeCaches(swift::misc::network::CEntityFlags::Entity entities) override; - virtual void admitCaches(swift::misc::network::CEntityFlags::Entity entities) override; + void synchronizeCaches(swift::misc::network::CEntityFlags::Entity entities) override; + void admitCaches(swift::misc::network::CEntityFlags::Entity entities) override; protected: // cache handling for base class - virtual void invalidateCaches(swift::misc::network::CEntityFlags::Entity entities) override; - virtual bool hasChangedUrl(swift::misc::network::CEntityFlags::Entity entity, - swift::misc::network::CUrl &oldUrlInfo, - swift::misc::network::CUrl &newUrlInfo) const override; - virtual swift::misc::network::CUrl getDbServiceBaseUrl() const override; + void invalidateCaches(swift::misc::network::CEntityFlags::Entity entities) override; + bool hasChangedUrl(swift::misc::network::CEntityFlags::Entity entity, swift::misc::network::CUrl &oldUrlInfo, + swift::misc::network::CUrl &newUrlInfo) const override; + swift::misc::network::CUrl getDbServiceBaseUrl() const override; private: //! Info objects have been read @@ -87,8 +85,8 @@ namespace swift::core::db swift::misc::network::CEntityFlags::EntityFlag getEntityForMode() const; //! \copydoc CDatabaseReader::read - virtual void read(swift::misc::network::CEntityFlags::Entity entities, - swift::misc::db::CDbFlags::DataRetrievalModeFlag mode, const QDateTime &newerThan) override; + void read(swift::misc::network::CEntityFlags::Entity entities, + swift::misc::db::CDbFlags::DataRetrievalModeFlag mode, const QDateTime &newerThan) override; swift::misc::db::CDbFlags::DataRetrievalModeFlag m_mode; //!< shared or DB web service? swift::misc::db::CDbInfoList m_infoObjects; diff --git a/src/core/db/modeldatareader.h b/src/core/db/modeldatareader.h index 0d0c17510f..a46db05c3d 100644 --- a/src/core/db/modeldatareader.h +++ b/src/core/db/modeldatareader.h @@ -136,30 +136,28 @@ namespace swift::core::db bool writeToJsonFiles(const QString &dir); // Data read from local data - virtual swift::misc::CStatusMessageList readFromJsonFiles(const QString &dir, - swift::misc::network::CEntityFlags::Entity whatToRead, - bool overrideNewerOnly) override; - virtual bool readFromJsonFilesInBackground(const QString &dir, - swift::misc::network::CEntityFlags::Entity whatToRead, - bool overrideNewerOnly) override; + swift::misc::CStatusMessageList readFromJsonFiles(const QString &dir, + swift::misc::network::CEntityFlags::Entity whatToRead, + bool overrideNewerOnly) override; + bool readFromJsonFilesInBackground(const QString &dir, swift::misc::network::CEntityFlags::Entity whatToRead, + bool overrideNewerOnly) override; // cache handling for base class - virtual swift::misc::network::CEntityFlags::Entity getSupportedEntities() const override; - virtual QDateTime getCacheTimestamp(swift::misc::network::CEntityFlags::Entity entity) const override; - virtual int getCacheCount(swift::misc::network::CEntityFlags::Entity entity) const override; - virtual swift::misc::network::CEntityFlags::Entity getEntitiesWithCacheCount() const override; - virtual swift::misc::network::CEntityFlags::Entity + swift::misc::network::CEntityFlags::Entity getSupportedEntities() const override; + QDateTime getCacheTimestamp(swift::misc::network::CEntityFlags::Entity entity) const override; + int getCacheCount(swift::misc::network::CEntityFlags::Entity entity) const override; + swift::misc::network::CEntityFlags::Entity getEntitiesWithCacheCount() const override; + swift::misc::network::CEntityFlags::Entity getEntitiesWithCacheTimestampNewerThan(const QDateTime &threshold) const override; - virtual void synchronizeCaches(swift::misc::network::CEntityFlags::Entity entities) override; - virtual void admitCaches(swift::misc::network::CEntityFlags::Entity entities) override; + void synchronizeCaches(swift::misc::network::CEntityFlags::Entity entities) override; + void admitCaches(swift::misc::network::CEntityFlags::Entity entities) override; protected: // cache handling for base class - virtual void invalidateCaches(swift::misc::network::CEntityFlags::Entity entities) override; - virtual bool hasChangedUrl(swift::misc::network::CEntityFlags::Entity entity, - swift::misc::network::CUrl &oldUrlInfo, - swift::misc::network::CUrl &newUrlInfo) const override; - virtual swift::misc::network::CUrl getDbServiceBaseUrl() const override; + void invalidateCaches(swift::misc::network::CEntityFlags::Entity entities) override; + bool hasChangedUrl(swift::misc::network::CEntityFlags::Entity entity, swift::misc::network::CUrl &oldUrlInfo, + swift::misc::network::CUrl &newUrlInfo) const override; + swift::misc::network::CUrl getDbServiceBaseUrl() const override; private: swift::misc::CData m_liveryCache { this, @@ -174,10 +172,10 @@ namespace swift::core::db std::atomic_bool m_syncedDistributorCache { false }; //!< already synchronized? //! \copydoc CDatabaseReader::read - virtual void read(swift::misc::network::CEntityFlags::Entity entities = - swift::misc::network::CEntityFlags::DistributorLiveryModel, - swift::misc::db::CDbFlags::DataRetrievalModeFlag mode = swift::misc::db::CDbFlags::DbReading, - const QDateTime &newerThan = QDateTime()) override; + void read(swift::misc::network::CEntityFlags::Entity entities = + swift::misc::network::CEntityFlags::DistributorLiveryModel, + swift::misc::db::CDbFlags::DataRetrievalModeFlag mode = swift::misc::db::CDbFlags::DbReading, + const QDateTime &newerThan = QDateTime()) override; //! Reader URL (we read from where?) used to detect changes of location swift::misc::CData m_readerUrlCache { diff --git a/src/core/fsd/clientresponse.cpp b/src/core/fsd/clientresponse.cpp index a564a6a42d..fc6efecb18 100644 --- a/src/core/fsd/clientresponse.cpp +++ b/src/core/fsd/clientresponse.cpp @@ -8,8 +8,6 @@ namespace swift::core::fsd { - ClientResponse::ClientResponse() {} - ClientResponse::ClientResponse(const QString &sender, const QString &receiver, ClientQueryType queryType, const QStringList &responseData) : MessageBase(sender, receiver), m_queryType(queryType), m_responseData(responseData) diff --git a/src/core/fsd/clientresponse.h b/src/core/fsd/clientresponse.h index c5213d4828..f6c7df2385 100644 --- a/src/core/fsd/clientresponse.h +++ b/src/core/fsd/clientresponse.h @@ -38,7 +38,7 @@ namespace swift::core::fsd //! @} private: - ClientResponse(); + ClientResponse() = default; }; //! Equal to operator diff --git a/src/core/fsd/euroscopesimdata.cpp b/src/core/fsd/euroscopesimdata.cpp index 42d18f20f9..18a5fde1d8 100644 --- a/src/core/fsd/euroscopesimdata.cpp +++ b/src/core/fsd/euroscopesimdata.cpp @@ -12,8 +12,6 @@ using namespace swift::misc::aviation; namespace swift::core::fsd { - EuroscopeSimData::EuroscopeSimData() = default; - EuroscopeSimData::EuroscopeSimData(const QString &sender, const QString &model, const QString &livery, quint64 timestamp, double latitude, double longitude, double altitude, double heading, int bank, int pitch, int groundSpeed, bool onGround, diff --git a/src/core/fsd/euroscopesimdata.h b/src/core/fsd/euroscopesimdata.h index bb27b51437..378393e870 100644 --- a/src/core/fsd/euroscopesimdata.h +++ b/src/core/fsd/euroscopesimdata.h @@ -50,7 +50,7 @@ namespace swift::core::fsd //! @} private: - EuroscopeSimData(); + EuroscopeSimData() = default; }; //! Equal to operator diff --git a/src/core/fsd/flightplan.cpp b/src/core/fsd/flightplan.cpp index ff4be14dd6..9dd1b4d82f 100644 --- a/src/core/fsd/flightplan.cpp +++ b/src/core/fsd/flightplan.cpp @@ -8,8 +8,6 @@ namespace swift::core::fsd { - FlightPlan::FlightPlan() {} - FlightPlan::FlightPlan(const QString &sender, const QString &receiver, FlightType flightType, const QString &aircraftIcaoType, int trueCruisingSpeed, const QString &depAirport, int estimatedDepTime, int actualDepTime, const QString &cruiseAlt, diff --git a/src/core/fsd/flightplan.h b/src/core/fsd/flightplan.h index 220744561b..093374fc0a 100644 --- a/src/core/fsd/flightplan.h +++ b/src/core/fsd/flightplan.h @@ -52,7 +52,7 @@ namespace swift::core::fsd //! @} protected: - FlightPlan(); + FlightPlan() = default; }; //! Equal to operator diff --git a/src/core/fsd/messagebase.h b/src/core/fsd/messagebase.h index 00515e98dc..f9f3170438 100644 --- a/src/core/fsd/messagebase.h +++ b/src/core/fsd/messagebase.h @@ -58,7 +58,7 @@ namespace swift::core::fsd { public: //! Default Constructor - MessageBase() {} + MessageBase() = default; //! Constructor MessageBase(const QString &sender); diff --git a/src/core/fsd/revbclientparts.cpp b/src/core/fsd/revbclientparts.cpp index 8f99323780..06163cdff5 100644 --- a/src/core/fsd/revbclientparts.cpp +++ b/src/core/fsd/revbclientparts.cpp @@ -8,8 +8,6 @@ namespace swift::core::fsd { - RevBClientParts::RevBClientParts() {} - RevBClientParts::RevBClientParts(const QString &sender, const QString &partsval1, const QString &partsval2, const QString &partsval3) : MessageBase(sender), m_partsval1(partsval1), m_partsval2(partsval2), m_partsval3(partsval3) diff --git a/src/core/fsd/revbclientparts.h b/src/core/fsd/revbclientparts.h index dd27483030..e1d77dbab0 100644 --- a/src/core/fsd/revbclientparts.h +++ b/src/core/fsd/revbclientparts.h @@ -40,7 +40,7 @@ namespace swift::core::fsd //! @} private: - RevBClientParts(); + RevBClientParts() = default; }; //! Equal to operator diff --git a/src/core/fsd/servererror.cpp b/src/core/fsd/servererror.cpp index 37658e4ab9..9ad94dd7f0 100644 --- a/src/core/fsd/servererror.cpp +++ b/src/core/fsd/servererror.cpp @@ -9,8 +9,6 @@ namespace swift::core::fsd { - ServerError::ServerError() {} - ServerError::ServerError(const QString &sender, const QString &receiver, ServerErrorCode errorCode, const QString &causingParameter, const QString &description) : MessageBase(sender, receiver), m_errorNumber(errorCode), m_causingParameter(causingParameter), diff --git a/src/core/fsd/servererror.h b/src/core/fsd/servererror.h index 5768635f09..82a3f93e30 100644 --- a/src/core/fsd/servererror.h +++ b/src/core/fsd/servererror.h @@ -54,7 +54,7 @@ namespace swift::core::fsd private: //! Ctor - ServerError(); + ServerError() = default; }; //! Equal to operator diff --git a/src/core/pluginmanagersimulator.h b/src/core/pluginmanagersimulator.h index 922d0f235d..25519dc1e5 100644 --- a/src/core/pluginmanagersimulator.h +++ b/src/core/pluginmanagersimulator.h @@ -51,14 +51,14 @@ namespace swift::core int checkAvailableListeners(); //! \copydoc swift::core::IPluginManager::collectPlugins() - virtual void collectPlugins() override; + void collectPlugins() override; protected: //! \copydoc swift::core::IPluginManager::acceptedIids() - virtual swift::misc::CSequence acceptedIids() const override; + swift::misc::CSequence acceptedIids() const override; //! \copydoc swift::core::IPluginManager::pluginDirectory() - virtual const QString &pluginDirectory() const override; + const QString &pluginDirectory() const override; private: /*! diff --git a/src/core/progress.h b/src/core/progress.h index 5027d9457d..39b26caf94 100644 --- a/src/core/progress.h +++ b/src/core/progress.h @@ -19,7 +19,7 @@ namespace swift::core virtual void updateProgressIndicator(int percentage) = 0; //! Dtor - virtual ~IProgressIndicator() {} + virtual ~IProgressIndicator() = default; //! Same as updateProgressIndicator but processing events void updateProgressIndicatorAndProcessEvents(int percentage) diff --git a/src/core/vatsim/vatsimdatafilereader.h b/src/core/vatsim/vatsimdatafilereader.h index ae6692c07f..73029a53b5 100644 --- a/src/core/vatsim/vatsimdatafilereader.h +++ b/src/core/vatsim/vatsimdatafilereader.h @@ -122,7 +122,7 @@ namespace swift::core::vatsim protected: // CThreadedReader overrides - virtual void doWorkImpl() override; + void doWorkImpl() override; private: //! Section in file diff --git a/src/core/vatsim/vatsimmetarreader.h b/src/core/vatsim/vatsimmetarreader.h index c7934e3de4..f8d637e7bc 100644 --- a/src/core/vatsim/vatsimmetarreader.h +++ b/src/core/vatsim/vatsimmetarreader.h @@ -48,7 +48,7 @@ namespace swift::core::vatsim protected: // CThreadedReader overrides - virtual void doWorkImpl() override; + void doWorkImpl() override; private: //! Decode METARs diff --git a/src/core/vatsim/vatsimsettings.cpp b/src/core/vatsim/vatsimsettings.cpp index 7fa05057e2..6d6fa63541 100644 --- a/src/core/vatsim/vatsimsettings.cpp +++ b/src/core/vatsim/vatsimsettings.cpp @@ -11,8 +11,6 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::core::vatsim, CRawFsdMessageSettings) namespace swift::core::vatsim { - CReaderSettings::CReaderSettings() {} - CReaderSettings::CReaderSettings(const CTime &initialTime, const CTime &periodicTime, bool neverUpdate) : m_initialTime(initialTime), m_periodicTime(periodicTime), m_neverUpdate(neverUpdate) {} @@ -61,8 +59,6 @@ namespace swift::core::vatsim } } - CRawFsdMessageSettings::CRawFsdMessageSettings() {} - CRawFsdMessageSettings::CRawFsdMessageSettings(bool enabled, const QString &FileDir) : m_rawFsdMessagesEnabled(enabled), m_FileDir(FileDir) {} diff --git a/src/core/vatsim/vatsimsettings.h b/src/core/vatsim/vatsimsettings.h index e9e4de18ba..fd406f0fc5 100644 --- a/src/core/vatsim/vatsimsettings.h +++ b/src/core/vatsim/vatsimsettings.h @@ -34,7 +34,7 @@ namespace swift::core::vatsim }; //! Default constructor. - CReaderSettings(); + CReaderSettings() = default; //! Simplified constructor CReaderSettings(const swift::misc::physical_quantities::CTime &initialTime, @@ -152,7 +152,7 @@ namespace swift::core::vatsim }; //! Default constructor. - CRawFsdMessageSettings(); + CRawFsdMessageSettings() = default; //! Simplified constructor CRawFsdMessageSettings(bool enabled, const QString &fileDir); diff --git a/src/core/webdataservices.h b/src/core/webdataservices.h index 94e95dbc89..8aaabdb589 100644 --- a/src/core/webdataservices.h +++ b/src/core/webdataservices.h @@ -89,7 +89,7 @@ namespace swift::core const swift::core::db::CDatabaseReaderConfigList &dbReaderConfig, QObject *parent = nullptr); //! Destructor - virtual ~CWebDataServices() override; + ~CWebDataServices() override; //! Shutdown void gracefulShutdown(); diff --git a/src/core/webdataservicesms.h b/src/core/webdataservicesms.h index 5dd2942d74..d326c73b84 100644 --- a/src/core/webdataservicesms.h +++ b/src/core/webdataservicesms.h @@ -23,7 +23,7 @@ namespace swift::core public: //! Ctor - Q_INVOKABLE MSWebServices() {} + Q_INVOKABLE MSWebServices() = default; //! @{ //! Functions calling the web services diff --git a/src/gui/components/aboutdialog.cpp b/src/gui/components/aboutdialog.cpp index cd37684051..78ac198375 100644 --- a/src/gui/components/aboutdialog.cpp +++ b/src/gui/components/aboutdialog.cpp @@ -30,7 +30,7 @@ namespace swift::gui::components }); } - CAboutDialog::~CAboutDialog() {} + CAboutDialog::~CAboutDialog() = default; void CAboutDialog::init() { diff --git a/src/gui/components/aboutdialog.h b/src/gui/components/aboutdialog.h index 07a111f12f..0508f1c656 100644 --- a/src/gui/components/aboutdialog.h +++ b/src/gui/components/aboutdialog.h @@ -27,7 +27,7 @@ namespace swift::gui::components explicit CAboutDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CAboutDialog() override; + ~CAboutDialog() override; private: //! Init values diff --git a/src/gui/components/abouthtmlcomponent.cpp b/src/gui/components/abouthtmlcomponent.cpp index 3d12a9c686..16cf7268b3 100644 --- a/src/gui/components/abouthtmlcomponent.cpp +++ b/src/gui/components/abouthtmlcomponent.cpp @@ -32,7 +32,7 @@ namespace swift::gui::components }); } - CAboutHtmlComponent::~CAboutHtmlComponent() {} + CAboutHtmlComponent::~CAboutHtmlComponent() = default; void CAboutHtmlComponent::loadAbout() { diff --git a/src/gui/components/abouthtmlcomponent.h b/src/gui/components/abouthtmlcomponent.h index ba8ec3ed53..df01bc6668 100644 --- a/src/gui/components/abouthtmlcomponent.h +++ b/src/gui/components/abouthtmlcomponent.h @@ -30,7 +30,7 @@ namespace swift::gui::components explicit CAboutHtmlComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CAboutHtmlComponent() override; + ~CAboutHtmlComponent() override; private: //! Load credits and legal info diff --git a/src/gui/components/aircraftcombinedtypeselector.cpp b/src/gui/components/aircraftcombinedtypeselector.cpp index 3d09ffe6c4..3fd87782fa 100644 --- a/src/gui/components/aircraftcombinedtypeselector.cpp +++ b/src/gui/components/aircraftcombinedtypeselector.cpp @@ -36,7 +36,7 @@ namespace swift::gui::components ui->le_CombinedType->setValidator(new CUpperCaseValidator(this)); } - CAircraftCombinedTypeSelector::~CAircraftCombinedTypeSelector() {} + CAircraftCombinedTypeSelector::~CAircraftCombinedTypeSelector() = default; void CAircraftCombinedTypeSelector::setCombinedType(const QString &combinedCode) { diff --git a/src/gui/components/aircraftcombinedtypeselector.h b/src/gui/components/aircraftcombinedtypeselector.h index 2e2326429f..c7717b8c28 100644 --- a/src/gui/components/aircraftcombinedtypeselector.h +++ b/src/gui/components/aircraftcombinedtypeselector.h @@ -36,7 +36,7 @@ namespace swift::gui::components explicit CAircraftCombinedTypeSelector(QWidget *parent = nullptr); //! Destructor - virtual ~CAircraftCombinedTypeSelector() override; + ~CAircraftCombinedTypeSelector() override; //! Set comined code, e.g. L1P void setCombinedType(const QString &combinedCode); diff --git a/src/gui/components/aircraftcomponent.cpp b/src/gui/components/aircraftcomponent.cpp index 1295e19653..c7670298f5 100644 --- a/src/gui/components/aircraftcomponent.cpp +++ b/src/gui/components/aircraftcomponent.cpp @@ -62,7 +62,7 @@ namespace swift::gui::components m_updateTimer.start(); } - CAircraftComponent::~CAircraftComponent() {} + CAircraftComponent::~CAircraftComponent() = default; int CAircraftComponent::countAircraftInView() const { diff --git a/src/gui/components/aircraftcomponent.h b/src/gui/components/aircraftcomponent.h index 964b7942bc..7486048422 100644 --- a/src/gui/components/aircraftcomponent.h +++ b/src/gui/components/aircraftcomponent.h @@ -56,13 +56,13 @@ namespace swift::gui explicit CAircraftComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CAircraftComponent() override; + ~CAircraftComponent() override; //! Aircraft in range int countAircraftInView() const; //! \copydoc CEnableForDockWidgetInfoArea::setParentDockWidgetInfoArea - virtual bool setParentDockWidgetInfoArea(swift::gui::CDockWidgetInfoArea *parentDockableWidget) override; + bool setParentDockWidgetInfoArea(swift::gui::CDockWidgetInfoArea *parentDockableWidget) override; //! Update aircraft/airport view void update(); diff --git a/src/gui/components/aircraftmodelsetvalidationdialog.cpp b/src/gui/components/aircraftmodelsetvalidationdialog.cpp index bb88ea9589..4e5e58ca15 100644 --- a/src/gui/components/aircraftmodelsetvalidationdialog.cpp +++ b/src/gui/components/aircraftmodelsetvalidationdialog.cpp @@ -20,7 +20,7 @@ namespace swift::gui::components this->setWindowFlags(this->windowFlags() | Qt::WindowContextHelpButtonHint); } - CAircraftModelSetValidationDialog::~CAircraftModelSetValidationDialog() {} + CAircraftModelSetValidationDialog::~CAircraftModelSetValidationDialog() = default; void CAircraftModelSetValidationDialog::validatedModelSet(const CSimulatorInfo &simulator, const CAircraftModelList &valid, diff --git a/src/gui/components/aircraftmodelsetvalidationdialog.h b/src/gui/components/aircraftmodelsetvalidationdialog.h index 949b26afef..15fc07f704 100644 --- a/src/gui/components/aircraftmodelsetvalidationdialog.h +++ b/src/gui/components/aircraftmodelsetvalidationdialog.h @@ -39,7 +39,7 @@ namespace swift::gui::components explicit CAircraftModelSetValidationDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CAircraftModelSetValidationDialog() override; + ~CAircraftModelSetValidationDialog() override; //! \copydoc CAircraftModelValidationComponent::validatedModelSet void validatedModelSet(const swift::misc::simulation::CSimulatorInfo &simulator, diff --git a/src/gui/components/aircraftmodelstringcompleter.cpp b/src/gui/components/aircraftmodelstringcompleter.cpp index 8119b0e5eb..9d3cdad5cc 100644 --- a/src/gui/components/aircraftmodelstringcompleter.cpp +++ b/src/gui/components/aircraftmodelstringcompleter.cpp @@ -55,7 +55,7 @@ namespace swift::gui::components this->initGui(); } - CAircraftModelStringCompleter::~CAircraftModelStringCompleter() {} + CAircraftModelStringCompleter::~CAircraftModelStringCompleter() = default; QString CAircraftModelStringCompleter::getModelString() const { return ui->le_modelString->text(); } diff --git a/src/gui/components/aircraftmodelstringcompleter.h b/src/gui/components/aircraftmodelstringcompleter.h index 4bb5735c3c..890b60fa85 100644 --- a/src/gui/components/aircraftmodelstringcompleter.h +++ b/src/gui/components/aircraftmodelstringcompleter.h @@ -43,7 +43,7 @@ namespace swift::gui::components explicit CAircraftModelStringCompleter(QWidget *parent = nullptr); //! Destructor - virtual ~CAircraftModelStringCompleter() override; + ~CAircraftModelStringCompleter() override; //! The model string QString getModelString() const; diff --git a/src/gui/components/aircraftmodelvalidationcomponent.cpp b/src/gui/components/aircraftmodelvalidationcomponent.cpp index a62c0a8b23..dc6e26a606 100644 --- a/src/gui/components/aircraftmodelvalidationcomponent.cpp +++ b/src/gui/components/aircraftmodelvalidationcomponent.cpp @@ -58,7 +58,7 @@ namespace swift::gui::components }); } - CAircraftModelValidationComponent::~CAircraftModelValidationComponent() {} + CAircraftModelValidationComponent::~CAircraftModelValidationComponent() = default; void CAircraftModelValidationComponent::validatedModelSet(const CSimulatorInfo &simulator, const CAircraftModelList &valid, diff --git a/src/gui/components/aircraftmodelvalidationcomponent.h b/src/gui/components/aircraftmodelvalidationcomponent.h index f7e5acfad1..a8100cd0f7 100644 --- a/src/gui/components/aircraftmodelvalidationcomponent.h +++ b/src/gui/components/aircraftmodelvalidationcomponent.h @@ -41,7 +41,7 @@ namespace swift::gui::components explicit CAircraftModelValidationComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CAircraftModelValidationComponent() override; + ~CAircraftModelValidationComponent() override; //! Validated a model set //! \remark coming from swift::misc::simulation::CBackgroundValidation diff --git a/src/gui/components/aircraftpartscomponent.cpp b/src/gui/components/aircraftpartscomponent.cpp index ded573d578..5d35a03baf 100644 --- a/src/gui/components/aircraftpartscomponent.cpp +++ b/src/gui/components/aircraftpartscomponent.cpp @@ -43,10 +43,7 @@ namespace swift::gui::components ui->comp_RemoteAircraftCompleter->addOwnCallsign(true); } - CAircraftPartsComponent::~CAircraftPartsComponent() - { - // void - } + CAircraftPartsComponent::~CAircraftPartsComponent() = default; void CAircraftPartsComponent::setCallsign(const CCallsign &callsign) { diff --git a/src/gui/components/aircraftpartscomponent.h b/src/gui/components/aircraftpartscomponent.h index 79cecaa40d..8121e76c29 100644 --- a/src/gui/components/aircraftpartscomponent.h +++ b/src/gui/components/aircraftpartscomponent.h @@ -27,7 +27,7 @@ namespace swift::gui::components explicit CAircraftPartsComponent(QWidget *parent = nullptr); //! Dtor - virtual ~CAircraftPartsComponent() override; + ~CAircraftPartsComponent() override; //! Set selected callsign void setCallsign(const swift::misc::aviation::CCallsign &callsign); diff --git a/src/gui/components/aircraftpartshistory.cpp b/src/gui/components/aircraftpartshistory.cpp index 283b376ca2..b99821e8d6 100644 --- a/src/gui/components/aircraftpartshistory.cpp +++ b/src/gui/components/aircraftpartshistory.cpp @@ -47,7 +47,7 @@ namespace swift::gui::components connect(&m_timerUpdateHistory, &QTimer::timeout, this, &CAircraftPartsHistory::updatePartsHistory); } - CAircraftPartsHistory::~CAircraftPartsHistory() {} + CAircraftPartsHistory::~CAircraftPartsHistory() = default; void CAircraftPartsHistory::initGui() { diff --git a/src/gui/components/aircraftpartshistory.h b/src/gui/components/aircraftpartshistory.h index 30e3192d30..e2c579f71b 100644 --- a/src/gui/components/aircraftpartshistory.h +++ b/src/gui/components/aircraftpartshistory.h @@ -31,7 +31,7 @@ namespace swift::gui::components explicit CAircraftPartsHistory(QWidget *parent = nullptr); //! Destructor - virtual ~CAircraftPartsHistory(); + ~CAircraftPartsHistory() override; private: QScopedPointer ui; diff --git a/src/gui/components/airportcompleter.cpp b/src/gui/components/airportcompleter.cpp index 38adf5b6b9..77d7318c29 100644 --- a/src/gui/components/airportcompleter.cpp +++ b/src/gui/components/airportcompleter.cpp @@ -30,7 +30,7 @@ namespace swift::gui::components this->onAirportsChanged(); } - CAirportCompleter::~CAirportCompleter() {} + CAirportCompleter::~CAirportCompleter() = default; void CAirportCompleter::setAirport(const CAirport &airport) { diff --git a/src/gui/components/airportcompleter.h b/src/gui/components/airportcompleter.h index 734c85c693..dfbebe8233 100644 --- a/src/gui/components/airportcompleter.h +++ b/src/gui/components/airportcompleter.h @@ -27,7 +27,7 @@ namespace swift::gui::components explicit CAirportCompleter(QWidget *parent = nullptr); //! Destructor - virtual ~CAirportCompleter(); + ~CAirportCompleter() override; //! Set airport void setAirport(const swift::misc::aviation::CAirport &airport); diff --git a/src/gui/components/airportdialog.cpp b/src/gui/components/airportdialog.cpp index cb87ce1c23..791fd4889b 100644 --- a/src/gui/components/airportdialog.cpp +++ b/src/gui/components/airportdialog.cpp @@ -15,7 +15,7 @@ namespace swift::gui::components this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); } - CAirportDialog::~CAirportDialog() {} + CAirportDialog::~CAirportDialog() = default; void CAirportDialog::setAirport(const CAirport &airport) { ui->comp_AirportCompleter->setAirport(airport); } diff --git a/src/gui/components/airportdialog.h b/src/gui/components/airportdialog.h index bee4b357aa..1e90f5c18e 100644 --- a/src/gui/components/airportdialog.h +++ b/src/gui/components/airportdialog.h @@ -27,7 +27,7 @@ namespace swift::gui::components explicit CAirportDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CAirportDialog(); + ~CAirportDialog() override; //! Set airport void setAirport(const swift::misc::aviation::CAirport &airport); diff --git a/src/gui/components/airportsmallcompleter.cpp b/src/gui/components/airportsmallcompleter.cpp index f3acc87ac4..2fdd8c7535 100644 --- a/src/gui/components/airportsmallcompleter.cpp +++ b/src/gui/components/airportsmallcompleter.cpp @@ -33,7 +33,7 @@ namespace swift::gui::components this->onAirportsChanged(); } - CAirportSmallCompleter::~CAirportSmallCompleter() {} + CAirportSmallCompleter::~CAirportSmallCompleter() = default; void CAirportSmallCompleter::setAirport(const CAirport &airport) { diff --git a/src/gui/components/airportsmallcompleter.h b/src/gui/components/airportsmallcompleter.h index 715831607b..9150c49c11 100644 --- a/src/gui/components/airportsmallcompleter.h +++ b/src/gui/components/airportsmallcompleter.h @@ -29,7 +29,7 @@ namespace swift::gui::components explicit CAirportSmallCompleter(QWidget *parent = nullptr); //! Destructor - virtual ~CAirportSmallCompleter(); + ~CAirportSmallCompleter() override; //! Set airport void setAirport(const swift::misc::aviation::CAirport &airport); diff --git a/src/gui/components/altitudedialog.cpp b/src/gui/components/altitudedialog.cpp index 5c91485025..75719bf621 100644 --- a/src/gui/components/altitudedialog.cpp +++ b/src/gui/components/altitudedialog.cpp @@ -66,7 +66,7 @@ namespace swift::gui::components connect(ui->le_Sm, &QLineEdit::textEdited, this, &CAltitudeDialog::onTextEdit); } - CAltitudeDialog::~CAltitudeDialog() {} + CAltitudeDialog::~CAltitudeDialog() = default; CAltitudeDialog::Mode CAltitudeDialog::getMode() const { diff --git a/src/gui/components/altitudedialog.h b/src/gui/components/altitudedialog.h index bd634dd72b..b9df3875d2 100644 --- a/src/gui/components/altitudedialog.h +++ b/src/gui/components/altitudedialog.h @@ -44,7 +44,7 @@ namespace swift::gui::components explicit CAltitudeDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CAltitudeDialog() override; + ~CAltitudeDialog() override; //! Get mode Mode getMode() const; diff --git a/src/gui/components/applicationclosedialog.cpp b/src/gui/components/applicationclosedialog.cpp index b7fcf3e4fd..58d0197fa7 100644 --- a/src/gui/components/applicationclosedialog.cpp +++ b/src/gui/components/applicationclosedialog.cpp @@ -38,7 +38,7 @@ namespace swift::gui::components &CApplicationCloseDialog::buttonClicked); } - CApplicationCloseDialog::~CApplicationCloseDialog() {} + CApplicationCloseDialog::~CApplicationCloseDialog() = default; void CApplicationCloseDialog::onAccepted() { diff --git a/src/gui/components/applicationclosedialog.h b/src/gui/components/applicationclosedialog.h index a1c4408c87..05f96bddf4 100644 --- a/src/gui/components/applicationclosedialog.h +++ b/src/gui/components/applicationclosedialog.h @@ -30,7 +30,7 @@ namespace swift::gui::components explicit CApplicationCloseDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CApplicationCloseDialog(); + ~CApplicationCloseDialog() override; private: QScopedPointer ui; diff --git a/src/gui/components/atcbuttoncomponent.cpp b/src/gui/components/atcbuttoncomponent.cpp index 976572b4bf..b737b09c40 100644 --- a/src/gui/components/atcbuttoncomponent.cpp +++ b/src/gui/components/atcbuttoncomponent.cpp @@ -36,7 +36,7 @@ namespace swift::gui::components this->setVisible(false); // will be changed when ATC stations are reported } - CAtcButtonComponent::~CAtcButtonComponent() {} + CAtcButtonComponent::~CAtcButtonComponent() = default; void CAtcButtonComponent::updateStations() { diff --git a/src/gui/components/atcbuttoncomponent.h b/src/gui/components/atcbuttoncomponent.h index 9f329abcdd..c86cd76134 100644 --- a/src/gui/components/atcbuttoncomponent.h +++ b/src/gui/components/atcbuttoncomponent.h @@ -28,7 +28,7 @@ namespace swift::gui::components explicit CAtcButtonComponent(QWidget *parent = nullptr); //! Dtor - virtual ~CAtcButtonComponent(); + ~CAtcButtonComponent() override; //! Update void updateStations(); diff --git a/src/gui/components/atcstationcomponent.cpp b/src/gui/components/atcstationcomponent.cpp index ce4cff06ab..683aac071b 100644 --- a/src/gui/components/atcstationcomponent.cpp +++ b/src/gui/components/atcstationcomponent.cpp @@ -158,7 +158,7 @@ namespace swift::gui::components this->settingsChanged(); } - CAtcStationComponent::~CAtcStationComponent() {} + CAtcStationComponent::~CAtcStationComponent() = default; void CAtcStationComponent::setTab(AtcTab tab) { diff --git a/src/gui/components/atcstationcomponent.h b/src/gui/components/atcstationcomponent.h index d13809bd87..3e36c6b3e0 100644 --- a/src/gui/components/atcstationcomponent.h +++ b/src/gui/components/atcstationcomponent.h @@ -61,7 +61,7 @@ namespace swift::gui explicit CAtcStationComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CAtcStationComponent() override; + ~CAtcStationComponent() override; //! Set tab void setTab(AtcTab tab); @@ -76,7 +76,7 @@ namespace swift::gui void getMetar(const QString &airportIcaoCode); //! \copydoc CEnableForDockWidgetInfoArea::setParentDockWidgetInfoArea - virtual bool setParentDockWidgetInfoArea(swift::gui::CDockWidgetInfoArea *parentDockableWidget) override; + bool setParentDockWidgetInfoArea(swift::gui::CDockWidgetInfoArea *parentDockableWidget) override; signals: //! Request audio widget diff --git a/src/gui/components/audioadvanceddistributedcomponent.cpp b/src/gui/components/audioadvanceddistributedcomponent.cpp index 669d95be7e..1869c9b67d 100644 --- a/src/gui/components/audioadvanceddistributedcomponent.cpp +++ b/src/gui/components/audioadvanceddistributedcomponent.cpp @@ -24,7 +24,7 @@ namespace swift::gui::components &CAudioAdvancedDistributedComponent::reloadRegisteredDevices, Qt::QueuedConnection); } - CAudioAdvancedDistributedComponent::~CAudioAdvancedDistributedComponent() {} + CAudioAdvancedDistributedComponent::~CAudioAdvancedDistributedComponent() = default; void CAudioAdvancedDistributedComponent::reloadRegisteredDevices() { diff --git a/src/gui/components/audioadvanceddistributedcomponent.h b/src/gui/components/audioadvanceddistributedcomponent.h index 770c420030..6edfe190a4 100644 --- a/src/gui/components/audioadvanceddistributedcomponent.h +++ b/src/gui/components/audioadvanceddistributedcomponent.h @@ -27,7 +27,7 @@ namespace swift::gui::components explicit CAudioAdvancedDistributedComponent(QWidget *parent = nullptr); //! Dtor - virtual ~CAudioAdvancedDistributedComponent() override; + ~CAudioAdvancedDistributedComponent() override; //! Reload registered devices void reloadRegisteredDevices(); diff --git a/src/gui/components/audioadvanceddistributeddialog.cpp b/src/gui/components/audioadvanceddistributeddialog.cpp index 3876e6a814..096f6a3e6b 100644 --- a/src/gui/components/audioadvanceddistributeddialog.cpp +++ b/src/gui/components/audioadvanceddistributeddialog.cpp @@ -15,7 +15,7 @@ namespace swift::gui::components this->reloadRegisteredDevices(); } - CAudioAdvancedDistributedDialog::~CAudioAdvancedDistributedDialog() {} + CAudioAdvancedDistributedDialog::~CAudioAdvancedDistributedDialog() = default; void CAudioAdvancedDistributedDialog::reloadRegisteredDevices() { diff --git a/src/gui/components/audioadvanceddistributeddialog.h b/src/gui/components/audioadvanceddistributeddialog.h index 15e807cf1f..02cb7247a5 100644 --- a/src/gui/components/audioadvanceddistributeddialog.h +++ b/src/gui/components/audioadvanceddistributeddialog.h @@ -27,7 +27,7 @@ namespace swift::gui::components explicit CAudioAdvancedDistributedDialog(QWidget *parent = nullptr); //! Dtor - virtual ~CAudioAdvancedDistributedDialog() override; + ~CAudioAdvancedDistributedDialog() override; //! Reload registered devices void reloadRegisteredDevices(); diff --git a/src/gui/components/audiodevicevolumesetupcomponent.cpp b/src/gui/components/audiodevicevolumesetupcomponent.cpp index 86bf0b751e..9cc59f5721 100644 --- a/src/gui/components/audiodevicevolumesetupcomponent.cpp +++ b/src/gui/components/audiodevicevolumesetupcomponent.cpp @@ -209,7 +209,7 @@ namespace swift::gui::components this->setTransmitReceiveInUiFromVoiceClient(); } - CAudioDeviceVolumeSetupComponent::~CAudioDeviceVolumeSetupComponent() {} + CAudioDeviceVolumeSetupComponent::~CAudioDeviceVolumeSetupComponent() = default; int CAudioDeviceVolumeSetupComponent::getInValue(int from, int to) const { diff --git a/src/gui/components/audiodevicevolumesetupcomponent.h b/src/gui/components/audiodevicevolumesetupcomponent.h index 51a9948f2a..f4faee693b 100644 --- a/src/gui/components/audiodevicevolumesetupcomponent.h +++ b/src/gui/components/audiodevicevolumesetupcomponent.h @@ -39,7 +39,7 @@ namespace swift::gui::components explicit CAudioDeviceVolumeSetupComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CAudioDeviceVolumeSetupComponent() override; + ~CAudioDeviceVolumeSetupComponent() override; //! @{ //! Get input and output volume values diff --git a/src/gui/components/audionotificationcomponent.cpp b/src/gui/components/audionotificationcomponent.cpp index 06d522f726..933797b423 100644 --- a/src/gui/components/audionotificationcomponent.cpp +++ b/src/gui/components/audionotificationcomponent.cpp @@ -94,7 +94,7 @@ namespace swift::gui::components Q_ASSERT(c); } - CAudioNotificationComponent::~CAudioNotificationComponent() {} + CAudioNotificationComponent::~CAudioNotificationComponent() = default; void CAudioNotificationComponent::reloadSettings() { diff --git a/src/gui/components/autopublishcomponent.cpp b/src/gui/components/autopublishcomponent.cpp index e4e9abaf27..b578c6f7d0 100644 --- a/src/gui/components/autopublishcomponent.cpp +++ b/src/gui/components/autopublishcomponent.cpp @@ -41,7 +41,7 @@ namespace swift::gui::components } } - CAutoPublishComponent::~CAutoPublishComponent() {} + CAutoPublishComponent::~CAutoPublishComponent() = default; int CAutoPublishComponent::readFiles() { diff --git a/src/gui/components/autopublishcomponent.h b/src/gui/components/autopublishcomponent.h index 03dc8250cb..a6d9be36bd 100644 --- a/src/gui/components/autopublishcomponent.h +++ b/src/gui/components/autopublishcomponent.h @@ -28,7 +28,7 @@ namespace swift::gui::components explicit CAutoPublishComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CAutoPublishComponent() override; + ~CAutoPublishComponent() override; //! Read the files int readFiles(); diff --git a/src/gui/components/autopublishdialog.cpp b/src/gui/components/autopublishdialog.cpp index 660f3036cb..65366f88fd 100644 --- a/src/gui/components/autopublishdialog.cpp +++ b/src/gui/components/autopublishdialog.cpp @@ -15,7 +15,7 @@ namespace swift::gui::components this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); } - CAutoPublishDialog::~CAutoPublishDialog() {} + CAutoPublishDialog::~CAutoPublishDialog() = default; int CAutoPublishDialog::readFiles() { return ui->comp_AutoPublish->readFiles(); } diff --git a/src/gui/components/autopublishdialog.h b/src/gui/components/autopublishdialog.h index 5f9a18f6c2..de3c049e4a 100644 --- a/src/gui/components/autopublishdialog.h +++ b/src/gui/components/autopublishdialog.h @@ -27,7 +27,7 @@ namespace swift::gui::components explicit CAutoPublishDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CAutoPublishDialog() override; + ~CAutoPublishDialog() override; //! \copydoc CAutoPublishComponent::readFiles int readFiles(); diff --git a/src/gui/components/callsigncompleter.cpp b/src/gui/components/callsigncompleter.cpp index 914810a41d..cd531e3587 100644 --- a/src/gui/components/callsigncompleter.cpp +++ b/src/gui/components/callsigncompleter.cpp @@ -43,7 +43,7 @@ namespace swift::gui::components m_dsAircraftsInRangeChanged.inputSignal(); // trigger } - CCallsignCompleter::~CCallsignCompleter() {} + CCallsignCompleter::~CCallsignCompleter() = default; CCallsign CCallsignCompleter::getCallsign(bool onlyKnownCallsign) const { diff --git a/src/gui/components/callsigncompleter.h b/src/gui/components/callsigncompleter.h index 49f0083d94..bef9936526 100644 --- a/src/gui/components/callsigncompleter.h +++ b/src/gui/components/callsigncompleter.h @@ -35,7 +35,7 @@ namespace swift::gui::components explicit CCallsignCompleter(QWidget *parent = nullptr); //! Dtor - virtual ~CCallsignCompleter() override; + ~CCallsignCompleter() override; //! Get the entered callsign swift::misc::aviation::CCallsign getCallsign(bool onlyKnownCallsign = true) const; diff --git a/src/gui/components/cgsourceselector.cpp b/src/gui/components/cgsourceselector.cpp index 541cf8389c..e7afa1d92d 100644 --- a/src/gui/components/cgsourceselector.cpp +++ b/src/gui/components/cgsourceselector.cpp @@ -15,7 +15,7 @@ namespace swift::gui::components this->initComboBox(); } - CCGSourceSelector::~CCGSourceSelector() {} + CCGSourceSelector::~CCGSourceSelector() = default; CSimulatorSettings::CGSource CCGSourceSelector::getValue() const { diff --git a/src/gui/components/cgsourceselector.h b/src/gui/components/cgsourceselector.h index e4f4a5eac1..2799c8f1e1 100644 --- a/src/gui/components/cgsourceselector.h +++ b/src/gui/components/cgsourceselector.h @@ -27,7 +27,7 @@ namespace swift::gui::components explicit CCGSourceSelector(QWidget *parent = nullptr); //! Dtor - virtual ~CCGSourceSelector() override; + ~CCGSourceSelector() override; //! @{ //! Get/set value diff --git a/src/gui/components/cockpitcomaudiodialog.cpp b/src/gui/components/cockpitcomaudiodialog.cpp index b692d8653e..ee1cca4322 100644 --- a/src/gui/components/cockpitcomaudiodialog.cpp +++ b/src/gui/components/cockpitcomaudiodialog.cpp @@ -14,6 +14,6 @@ namespace swift::gui::components this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); } - CCockpitComAudioDialog::~CCockpitComAudioDialog() {} + CCockpitComAudioDialog::~CCockpitComAudioDialog() = default; } // namespace swift::gui::components diff --git a/src/gui/components/cockpitcomaudiodialog.h b/src/gui/components/cockpitcomaudiodialog.h index b7c96f341c..8ab73f5aec 100644 --- a/src/gui/components/cockpitcomaudiodialog.h +++ b/src/gui/components/cockpitcomaudiodialog.h @@ -26,7 +26,7 @@ namespace swift::gui::components explicit CCockpitComAudioDialog(QWidget *parent = nullptr); //! Dtor - virtual ~CCockpitComAudioDialog() override; + ~CCockpitComAudioDialog() override; private: QScopedPointer ui; diff --git a/src/gui/components/cockpitcomcomponent.cpp b/src/gui/components/cockpitcomcomponent.cpp index 864b958dac..e75b0c507f 100644 --- a/src/gui/components/cockpitcomcomponent.cpp +++ b/src/gui/components/cockpitcomcomponent.cpp @@ -93,7 +93,7 @@ namespace swift::gui::components } } - CCockpitComComponent::~CCockpitComComponent() {} + CCockpitComComponent::~CCockpitComComponent() = default; void CCockpitComComponent::setTransponderModeStateIdent() { ui->editor_Com->setTransponderModeStateIdent(); } diff --git a/src/gui/components/cockpitcomcomponent.h b/src/gui/components/cockpitcomcomponent.h index 12dcfc3fe3..8847f249e8 100644 --- a/src/gui/components/cockpitcomcomponent.h +++ b/src/gui/components/cockpitcomcomponent.h @@ -43,7 +43,7 @@ namespace swift::gui::components explicit CCockpitComComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CCockpitComComponent() override; + ~CCockpitComComponent() override; //! Set to swift::misc::aviation::CTransponder::StateIdent void setTransponderModeStateIdent(); @@ -63,7 +63,7 @@ namespace swift::gui::components protected: //! \copydoc QWidget::paintEvent - virtual void paintEvent(QPaintEvent *event) override; + void paintEvent(QPaintEvent *event) override; private: //! Cockpit values have been changed in GUI diff --git a/src/gui/components/cockpitcomponent.cpp b/src/gui/components/cockpitcomponent.cpp index fae3518860..95b9ac3e1f 100644 --- a/src/gui/components/cockpitcomponent.cpp +++ b/src/gui/components/cockpitcomponent.cpp @@ -30,7 +30,7 @@ namespace swift::gui::components &CCockpitComponent::onRequestTextMessageCom2, Qt::QueuedConnection); } - CCockpitComponent::~CCockpitComponent() {} + CCockpitComponent::~CCockpitComponent() = default; bool CCockpitComponent::setParentDockWidgetInfoArea(CDockWidgetInfoArea *parentDockableWidget) { diff --git a/src/gui/components/cockpitcomponent.h b/src/gui/components/cockpitcomponent.h index 10d8aae89c..a5df57db03 100644 --- a/src/gui/components/cockpitcomponent.h +++ b/src/gui/components/cockpitcomponent.h @@ -34,10 +34,10 @@ namespace swift::gui explicit CCockpitComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CCockpitComponent() override; + ~CCockpitComponent() override; //! \copydoc CEnableForDockWidgetInfoArea::setParentDockWidgetInfoArea - virtual bool setParentDockWidgetInfoArea(swift::gui::CDockWidgetInfoArea *parentDockableWidget) override; + bool setParentDockWidgetInfoArea(swift::gui::CDockWidgetInfoArea *parentDockableWidget) override; //! Is the info area shown? bool isInfoAreaShown() const; @@ -50,7 +50,7 @@ namespace swift::gui protected: //! \copydoc QWidget::mouseDoubleClickEvent - virtual void mouseDoubleClickEvent(QMouseEvent *event) override; + void mouseDoubleClickEvent(QMouseEvent *event) override; private: //! Show or hide cockpit details diff --git a/src/gui/components/cockpitcomtransmissioncomponent.cpp b/src/gui/components/cockpitcomtransmissioncomponent.cpp index cfe6ba6d68..8239702a8f 100644 --- a/src/gui/components/cockpitcomtransmissioncomponent.cpp +++ b/src/gui/components/cockpitcomtransmissioncomponent.cpp @@ -18,10 +18,7 @@ namespace swift::gui::components connect(ui->pb_Com2Save, &QPushButton::released, this, &CCockpitComTransmissionComponent::onSave); } - CCockpitComTransmissionComponent::~CCockpitComTransmissionComponent() - { - // void - } + CCockpitComTransmissionComponent::~CCockpitComTransmissionComponent() = default; void CCockpitComTransmissionComponent::updateComSystem(CComSystem &comSystem, CComSystem::ComUnit comUnit) const { diff --git a/src/gui/components/cockpitcomtransmissioncomponent.h b/src/gui/components/cockpitcomtransmissioncomponent.h index 5d0fed428d..688e845b95 100644 --- a/src/gui/components/cockpitcomtransmissioncomponent.h +++ b/src/gui/components/cockpitcomtransmissioncomponent.h @@ -29,7 +29,7 @@ namespace swift::gui::components explicit CCockpitComTransmissionComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CCockpitComTransmissionComponent() override; + ~CCockpitComTransmissionComponent() override; //! Update given COM system void updateComSystem(swift::misc::aviation::CComSystem &comSystem, diff --git a/src/gui/components/cockpitinfoareacomponent.cpp b/src/gui/components/cockpitinfoareacomponent.cpp index 44da84adff..4c9c137a9c 100644 --- a/src/gui/components/cockpitinfoareacomponent.cpp +++ b/src/gui/components/cockpitinfoareacomponent.cpp @@ -24,7 +24,7 @@ namespace swift::gui::components this->toggleTabBarLocked(true); } - CCockpitInfoAreaComponent::~CCockpitInfoAreaComponent() {} + CCockpitInfoAreaComponent::~CCockpitInfoAreaComponent() = default; QSize CCockpitInfoAreaComponent::getPreferredSizeWhenFloating(int areaIndex) const { diff --git a/src/gui/components/cockpitinfoareacomponent.h b/src/gui/components/cockpitinfoareacomponent.h index 8d077f6b0d..e927b0cbac 100644 --- a/src/gui/components/cockpitinfoareacomponent.h +++ b/src/gui/components/cockpitinfoareacomponent.h @@ -33,7 +33,7 @@ namespace swift::gui::components explicit CCockpitInfoAreaComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CCockpitInfoAreaComponent() override; + ~CCockpitInfoAreaComponent() override; //! Info areas enum InfoArea @@ -54,10 +54,10 @@ namespace swift::gui::components protected: //! \copydoc CInfoArea::getPreferredSizeWhenFloating - virtual QSize getPreferredSizeWhenFloating(int areaIndex) const override; + QSize getPreferredSizeWhenFloating(int areaIndex) const override; //! \copydoc CInfoArea::indexToPixmap - virtual const QPixmap &indexToPixmap(int areaIndex) const override; + const QPixmap &indexToPixmap(int areaIndex) const override; private: QScopedPointer ui; diff --git a/src/gui/components/colorselector.cpp b/src/gui/components/colorselector.cpp index ff23543ebd..9d75b08713 100644 --- a/src/gui/components/colorselector.cpp +++ b/src/gui/components/colorselector.cpp @@ -51,7 +51,7 @@ namespace swift::gui::components connect(completer, qOverload(&QCompleter::activated), this, &CColorSelector::setColorByName); } - CColorSelector::~CColorSelector() {} + CColorSelector::~CColorSelector() = default; void CColorSelector::setColor(const swift::misc::CRgbColor &color) { diff --git a/src/gui/components/colorselector.h b/src/gui/components/colorselector.h index 5049d71aad..b6cd6748d2 100644 --- a/src/gui/components/colorselector.h +++ b/src/gui/components/colorselector.h @@ -64,19 +64,19 @@ namespace swift::gui::components protected: //! \copydoc QWidget::dragEnterEvent - virtual void dragEnterEvent(QDragEnterEvent *event) override; + void dragEnterEvent(QDragEnterEvent *event) override; //! \copydoc QWidget::dragMoveEvent - virtual void dragMoveEvent(QDragMoveEvent *event) override; + void dragMoveEvent(QDragMoveEvent *event) override; //! \copydoc QWidget::dragLeaveEvent - virtual void dragLeaveEvent(QDragLeaveEvent *event) override; + void dragLeaveEvent(QDragLeaveEvent *event) override; //! \copydoc QWidget::dropEvent - virtual void dropEvent(QDropEvent *event) override; + void dropEvent(QDropEvent *event) override; //! For dragging the color - virtual void mousePressEvent(QMouseEvent *event) override; + void mousePressEvent(QMouseEvent *event) override; private: //! Open up a color dilaog diff --git a/src/gui/components/configsimulatorcomponent.cpp b/src/gui/components/configsimulatorcomponent.cpp index e7dcbb9b4f..2c875470f2 100644 --- a/src/gui/components/configsimulatorcomponent.cpp +++ b/src/gui/components/configsimulatorcomponent.cpp @@ -24,7 +24,7 @@ namespace swift::gui::components this->preselectSimulators(); } - CConfigSimulatorComponent::~CConfigSimulatorComponent() {} + CConfigSimulatorComponent::~CConfigSimulatorComponent() = default; void CConfigSimulatorComponent::save() { diff --git a/src/gui/components/configsimulatorcomponent.h b/src/gui/components/configsimulatorcomponent.h index dfd4a90434..54289593e9 100644 --- a/src/gui/components/configsimulatorcomponent.h +++ b/src/gui/components/configsimulatorcomponent.h @@ -31,7 +31,7 @@ namespace swift::gui::components explicit CConfigSimulatorComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CConfigSimulatorComponent(); + ~CConfigSimulatorComponent() override; //! Save data void save(); @@ -69,10 +69,10 @@ namespace swift::gui::components void setConfigComponent(CConfigSimulatorComponent *config) { m_config = config; } //! \copydoc QWizardPage::initializePage - virtual void initializePage() override; + void initializePage() override; //! \copydoc QWizardPage::validatePage - virtual bool validatePage() override; + bool validatePage() override; private: CConfigSimulatorComponent *m_config = nullptr; diff --git a/src/gui/components/configurationwizard.cpp b/src/gui/components/configurationwizard.cpp index 29c6cb4701..ddb00b2512 100644 --- a/src/gui/components/configurationwizard.cpp +++ b/src/gui/components/configurationwizard.cpp @@ -61,7 +61,7 @@ namespace swift::gui::components CGuiUtility::setWizardButtonWidths(this); } - CConfigurationWizard::~CConfigurationWizard() {} + CConfigurationWizard::~CConfigurationWizard() = default; bool CConfigurationWizard::lastStepSkipped() const { return m_skipped; } diff --git a/src/gui/components/configurationwizard.h b/src/gui/components/configurationwizard.h index 711d93cd6b..d20cd60b9d 100644 --- a/src/gui/components/configurationwizard.h +++ b/src/gui/components/configurationwizard.h @@ -42,7 +42,7 @@ namespace swift::gui::components explicit CConfigurationWizard(QWidget *parent = nullptr); //! Destructor - virtual ~CConfigurationWizard() override; + ~CConfigurationWizard() override; //! Was the last step skipped? bool lastStepSkipped() const; diff --git a/src/gui/components/coordinatedialog.cpp b/src/gui/components/coordinatedialog.cpp index 6756382ccf..ea43e14ab6 100644 --- a/src/gui/components/coordinatedialog.cpp +++ b/src/gui/components/coordinatedialog.cpp @@ -22,7 +22,7 @@ namespace swift::gui::components connect(this, &QDialog::accepted, this, &CCoordinateDialog::changedCoordinate); } - CCoordinateDialog::~CCoordinateDialog() {} + CCoordinateDialog::~CCoordinateDialog() = default; CCoordinateGeodetic CCoordinateDialog::getCoordinate() const { return ui->editor_Coordinate->getCoordinate(); } diff --git a/src/gui/components/coordinatedialog.h b/src/gui/components/coordinatedialog.h index a6c932d5c1..67b4cb1d91 100644 --- a/src/gui/components/coordinatedialog.h +++ b/src/gui/components/coordinatedialog.h @@ -29,7 +29,7 @@ namespace swift::gui::components explicit CCoordinateDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CCoordinateDialog(); + ~CCoordinateDialog() override; //! \copydoc swift::gui::editors::CCoordinateForm::getCoordinate swift::misc::geo::CCoordinateGeodetic getCoordinate() const; diff --git a/src/gui/components/copymodelsfromotherswiftversionscomponent.cpp b/src/gui/components/copymodelsfromotherswiftversionscomponent.cpp index 6d68dc7484..5397096481 100644 --- a/src/gui/components/copymodelsfromotherswiftversionscomponent.cpp +++ b/src/gui/components/copymodelsfromotherswiftversionscomponent.cpp @@ -36,7 +36,7 @@ namespace swift::gui::components &CCopyModelsFromOtherSwiftVersionsComponent::onVersionChanged); } - CCopyModelsFromOtherSwiftVersionsComponent::~CCopyModelsFromOtherSwiftVersionsComponent() {} + CCopyModelsFromOtherSwiftVersionsComponent::~CCopyModelsFromOtherSwiftVersionsComponent() = default; void CCopyModelsFromOtherSwiftVersionsComponent::copy() { diff --git a/src/gui/components/copymodelsfromotherswiftversionscomponent.h b/src/gui/components/copymodelsfromotherswiftversionscomponent.h index deb552dba1..ef1917a1ae 100644 --- a/src/gui/components/copymodelsfromotherswiftversionscomponent.h +++ b/src/gui/components/copymodelsfromotherswiftversionscomponent.h @@ -32,7 +32,7 @@ namespace swift::gui::components explicit CCopyModelsFromOtherSwiftVersionsComponent(QWidget *parent = nullptr); //! Dtor - virtual ~CCopyModelsFromOtherSwiftVersionsComponent(); + ~CCopyModelsFromOtherSwiftVersionsComponent() override; //! Reload other versions void reloadOtherVersions(int deferMs = -1); @@ -74,10 +74,10 @@ namespace swift::gui::components void setConfigComponent(CCopyModelsFromOtherSwiftVersionsComponent *config) { m_copyModels = config; } //! \copydoc QWizardPage::initializePage - virtual void initializePage() override; + void initializePage() override; //! \copydoc QWizardPage::validatePage - virtual bool validatePage() override; + bool validatePage() override; private: CCopyModelsFromOtherSwiftVersionsComponent *m_copyModels = nullptr; diff --git a/src/gui/components/copymodelsfromotherswiftversionsdialog.cpp b/src/gui/components/copymodelsfromotherswiftversionsdialog.cpp index bdab6c1528..2f553ffc5a 100644 --- a/src/gui/components/copymodelsfromotherswiftversionsdialog.cpp +++ b/src/gui/components/copymodelsfromotherswiftversionsdialog.cpp @@ -14,5 +14,5 @@ namespace swift::gui::components this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); } - CCopyModelsFromOtherSwiftVersionsDialog::~CCopyModelsFromOtherSwiftVersionsDialog() {} + CCopyModelsFromOtherSwiftVersionsDialog::~CCopyModelsFromOtherSwiftVersionsDialog() = default; } // namespace swift::gui::components diff --git a/src/gui/components/copymodelsfromotherswiftversionsdialog.h b/src/gui/components/copymodelsfromotherswiftversionsdialog.h index 42377abb41..9f2f17c08b 100644 --- a/src/gui/components/copymodelsfromotherswiftversionsdialog.h +++ b/src/gui/components/copymodelsfromotherswiftversionsdialog.h @@ -27,7 +27,7 @@ namespace swift::gui::components explicit CCopyModelsFromOtherSwiftVersionsDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CCopyModelsFromOtherSwiftVersionsDialog(); + ~CCopyModelsFromOtherSwiftVersionsDialog() override; private: QScopedPointer ui; diff --git a/src/gui/components/copysettingsandcachescomponent.cpp b/src/gui/components/copysettingsandcachescomponent.cpp index ee927bc3c9..413449e370 100644 --- a/src/gui/components/copysettingsandcachescomponent.cpp +++ b/src/gui/components/copysettingsandcachescomponent.cpp @@ -44,7 +44,7 @@ namespace swift::gui::components &CCopySettingsAndCachesComponent::onOtherVersionChanged); } - CCopySettingsAndCachesComponent::~CCopySettingsAndCachesComponent() {} + CCopySettingsAndCachesComponent::~CCopySettingsAndCachesComponent() = default; void CCopySettingsAndCachesComponent::reloadOtherVersions(int deferMs) { diff --git a/src/gui/components/copysettingsandcachescomponent.h b/src/gui/components/copysettingsandcachescomponent.h index 30dffad27b..1a3869f32d 100644 --- a/src/gui/components/copysettingsandcachescomponent.h +++ b/src/gui/components/copysettingsandcachescomponent.h @@ -50,7 +50,7 @@ namespace swift::gui::components explicit CCopySettingsAndCachesComponent(QWidget *parent = nullptr); //! Dtor - virtual ~CCopySettingsAndCachesComponent(); + ~CCopySettingsAndCachesComponent() override; //! Reload other versions void reloadOtherVersions(int deferMs = -1); @@ -169,10 +169,10 @@ namespace swift::gui::components void setConfigComponent(CCopySettingsAndCachesComponent *config) { m_copyCachesAndSettings = config; } //! \copydoc QWizardPage::initializePage - virtual void initializePage() override; + void initializePage() override; //! \copydoc QWizardPage::validatePage - virtual bool validatePage() override; + bool validatePage() override; private: CCopySettingsAndCachesComponent *m_copyCachesAndSettings = nullptr; diff --git a/src/gui/components/coreinfoareacomponent.cpp b/src/gui/components/coreinfoareacomponent.cpp index 8e3bc7ebe3..d401599e2d 100644 --- a/src/gui/components/coreinfoareacomponent.cpp +++ b/src/gui/components/coreinfoareacomponent.cpp @@ -21,7 +21,7 @@ namespace swift::gui::components toggleTabBarLocked(true); } - CCoreInfoAreaComponent::~CCoreInfoAreaComponent() {} + CCoreInfoAreaComponent::~CCoreInfoAreaComponent() = default; CLogComponent *CCoreInfoAreaComponent::getLogComponent() { return ui->comp_Log; } diff --git a/src/gui/components/coreinfoareacomponent.h b/src/gui/components/coreinfoareacomponent.h index ccf8973e08..97bc63c08c 100644 --- a/src/gui/components/coreinfoareacomponent.h +++ b/src/gui/components/coreinfoareacomponent.h @@ -36,7 +36,7 @@ namespace swift::gui::components explicit CCoreInfoAreaComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CCoreInfoAreaComponent() override; + ~CCoreInfoAreaComponent() override; //! Info areas enum InfoArea @@ -62,10 +62,10 @@ namespace swift::gui::components protected: //! \copydoc CInfoArea::getPreferredSizeWhenFloating - virtual QSize getPreferredSizeWhenFloating(int areaIndex) const override; + QSize getPreferredSizeWhenFloating(int areaIndex) const override; //! \copydoc CInfoArea::indexToPixmap - virtual const QPixmap &indexToPixmap(int areaIndex) const override; + const QPixmap &indexToPixmap(int areaIndex) const override; private: QScopedPointer ui; diff --git a/src/gui/components/coresettingsdialog.cpp b/src/gui/components/coresettingsdialog.cpp index 2986faf70a..60064bab28 100644 --- a/src/gui/components/coresettingsdialog.cpp +++ b/src/gui/components/coresettingsdialog.cpp @@ -21,7 +21,7 @@ namespace swift::gui::components connect(overview, &QPushButton::released, this, &CCoreSettingsDialog::showOverview); } - CCoreSettingsDialog::~CCoreSettingsDialog() {} + CCoreSettingsDialog::~CCoreSettingsDialog() = default; void CCoreSettingsDialog::showOverview() { ui->comp_SettingsComponent->setSettingsOverviewTab(); } } // namespace swift::gui::components diff --git a/src/gui/components/coresettingsdialog.h b/src/gui/components/coresettingsdialog.h index 764c63d465..a71fbe6515 100644 --- a/src/gui/components/coresettingsdialog.h +++ b/src/gui/components/coresettingsdialog.h @@ -29,7 +29,7 @@ namespace swift::gui::components explicit CCoreSettingsDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CCoreSettingsDialog(); + ~CCoreSettingsDialog() override; private: QScopedPointer ui; diff --git a/src/gui/components/corestatuscomponent.cpp b/src/gui/components/corestatuscomponent.cpp index 2bc1ad95f0..9778f2e8b1 100644 --- a/src/gui/components/corestatuscomponent.cpp +++ b/src/gui/components/corestatuscomponent.cpp @@ -14,6 +14,6 @@ namespace swift::gui::components ui->setupUi(this); } - CCoreStatusComponent::~CCoreStatusComponent() {} + CCoreStatusComponent::~CCoreStatusComponent() = default; } // namespace swift::gui::components diff --git a/src/gui/components/corestatuscomponent.h b/src/gui/components/corestatuscomponent.h index f0765062df..c05dd6f9da 100644 --- a/src/gui/components/corestatuscomponent.h +++ b/src/gui/components/corestatuscomponent.h @@ -31,7 +31,7 @@ namespace swift::gui::components explicit CCoreStatusComponent(QWidget *parent = nullptr); //! Destructor - ~CCoreStatusComponent(); + ~CCoreStatusComponent() override; private: QScopedPointer ui; diff --git a/src/gui/components/countryselector.cpp b/src/gui/components/countryselector.cpp index df3f9b6a99..895d73fcee 100644 --- a/src/gui/components/countryselector.cpp +++ b/src/gui/components/countryselector.cpp @@ -31,7 +31,7 @@ namespace swift::gui::components this->onCountriesLoaded(); } - CCountrySelector::~CCountrySelector() {} + CCountrySelector::~CCountrySelector() = default; void CCountrySelector::setCountry(const CCountry &country) { diff --git a/src/gui/components/countryselector.h b/src/gui/components/countryselector.h index a35aec5b78..e7b285a30c 100644 --- a/src/gui/components/countryselector.h +++ b/src/gui/components/countryselector.h @@ -29,7 +29,7 @@ namespace swift::gui::components explicit CCountrySelector(QWidget *parent = nullptr); //! Destructor - virtual ~CCountrySelector(); + ~CCountrySelector() override; //! Set country void setCountry(const swift::misc::CCountry &country); diff --git a/src/gui/components/datainfoareacomponent.cpp b/src/gui/components/datainfoareacomponent.cpp index 1127115d9d..55c4919df7 100644 --- a/src/gui/components/datainfoareacomponent.cpp +++ b/src/gui/components/datainfoareacomponent.cpp @@ -43,7 +43,7 @@ namespace swift::gui::components this->setTabBarPosition(QTabWidget::North); } - CDataInfoAreaComponent::~CDataInfoAreaComponent() {} + CDataInfoAreaComponent::~CDataInfoAreaComponent() = default; CDbModelComponent *CDataInfoAreaComponent::getModelComponent() const { return ui->comp_DbModels; } diff --git a/src/gui/components/datainfoareacomponent.h b/src/gui/components/datainfoareacomponent.h index 23d4f8fe15..83a3a766a0 100644 --- a/src/gui/components/datainfoareacomponent.h +++ b/src/gui/components/datainfoareacomponent.h @@ -57,7 +57,7 @@ namespace swift::gui::components explicit CDataInfoAreaComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CDataInfoAreaComponent() override; + ~CDataInfoAreaComponent() override; //! DB model component CDbModelComponent *getModelComponent() const; @@ -95,10 +95,10 @@ namespace swift::gui::components protected: //! \copydoc CInfoArea::getPreferredSizeWhenFloating - virtual QSize getPreferredSizeWhenFloating(int areaIndex) const override; + QSize getPreferredSizeWhenFloating(int areaIndex) const override; //! \copydoc CInfoArea::indexToPixmap - virtual const QPixmap &indexToPixmap(int areaIndex) const override; + const QPixmap &indexToPixmap(int areaIndex) const override; private: QScopedPointer ui; diff --git a/src/gui/components/datamaininfoareacomponent.cpp b/src/gui/components/datamaininfoareacomponent.cpp index 45da54171d..9d3867272c 100644 --- a/src/gui/components/datamaininfoareacomponent.cpp +++ b/src/gui/components/datamaininfoareacomponent.cpp @@ -43,7 +43,7 @@ namespace swift::gui::components ui->comp_Log->showFilterBar(); } - CDataMainInfoAreaComponent::~CDataMainInfoAreaComponent() {} + CDataMainInfoAreaComponent::~CDataMainInfoAreaComponent() = default; CLogComponent *CDataMainInfoAreaComponent::getLogComponent() const { return ui->comp_Log; } diff --git a/src/gui/components/datamaininfoareacomponent.h b/src/gui/components/datamaininfoareacomponent.h index b82ed0a987..2f28f2290e 100644 --- a/src/gui/components/datamaininfoareacomponent.h +++ b/src/gui/components/datamaininfoareacomponent.h @@ -50,7 +50,7 @@ namespace swift::gui::components explicit CDataMainInfoAreaComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CDataMainInfoAreaComponent() override; + ~CDataMainInfoAreaComponent() override; //! Log component CLogComponent *getLogComponent() const; @@ -73,10 +73,10 @@ namespace swift::gui::components protected: //! \copydoc CInfoArea::getPreferredSizeWhenFloating - virtual QSize getPreferredSizeWhenFloating(int areaIndex) const override; + QSize getPreferredSizeWhenFloating(int areaIndex) const override; //! \copydoc CInfoArea::indexToPixmap - virtual const QPixmap &indexToPixmap(int areaIndex) const override; + const QPixmap &indexToPixmap(int areaIndex) const override; private: QScopedPointer ui; diff --git a/src/gui/components/datasettingscomponent.cpp b/src/gui/components/datasettingscomponent.cpp index e6c789699f..69c0f3f7bb 100644 --- a/src/gui/components/datasettingscomponent.cpp +++ b/src/gui/components/datasettingscomponent.cpp @@ -17,7 +17,7 @@ namespace swift::gui::components ui->comp_GuiSettings->hideOpacity(true); } - CDataSettingsComponent::~CDataSettingsComponent() {} + CDataSettingsComponent::~CDataSettingsComponent() = default; void CDataSettingsComponent::setBackgroundUpdater(const CBackgroundDataUpdater *updater) { diff --git a/src/gui/components/datasettingscomponent.h b/src/gui/components/datasettingscomponent.h index bd13b464d4..a00b7e3bc4 100644 --- a/src/gui/components/datasettingscomponent.h +++ b/src/gui/components/datasettingscomponent.h @@ -36,7 +36,7 @@ namespace swift::gui::components explicit CDataSettingsComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CDataSettingsComponent(); + ~CDataSettingsComponent() override; //! Background updater void setBackgroundUpdater(const swift::core::db::CBackgroundDataUpdater *updater); diff --git a/src/gui/components/dbaircraftcategorycomponent.cpp b/src/gui/components/dbaircraftcategorycomponent.cpp index 940bed5008..4147ae4485 100644 --- a/src/gui/components/dbaircraftcategorycomponent.cpp +++ b/src/gui/components/dbaircraftcategorycomponent.cpp @@ -38,7 +38,7 @@ namespace swift::gui::components sGui->getWebDataServices()->getAircraftCategoriesCount()); } - CDbAircraftCategoryComponent::~CDbAircraftCategoryComponent() {} + CDbAircraftCategoryComponent::~CDbAircraftCategoryComponent() = default; void CDbAircraftCategoryComponent::onCategoryRead(CEntityFlags::Entity entity, CEntityFlags::ReadState readState, int count) diff --git a/src/gui/components/dbaircraftcategorycomponent.h b/src/gui/components/dbaircraftcategorycomponent.h index d0ee069c9f..181e465f67 100644 --- a/src/gui/components/dbaircraftcategorycomponent.h +++ b/src/gui/components/dbaircraftcategorycomponent.h @@ -35,7 +35,7 @@ namespace swift::gui::components explicit CDbAircraftCategoryComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CDbAircraftCategoryComponent(); + ~CDbAircraftCategoryComponent() override; private: //! ICAO codes have been read diff --git a/src/gui/components/dbaircrafticaocomponent.cpp b/src/gui/components/dbaircrafticaocomponent.cpp index 12cc51e2b4..9cff35193b 100644 --- a/src/gui/components/dbaircrafticaocomponent.cpp +++ b/src/gui/components/dbaircrafticaocomponent.cpp @@ -44,7 +44,7 @@ namespace swift::gui::components sGui->getWebDataServices()->getAircraftIcaoCodesCount()); } - CDbAircraftIcaoComponent::~CDbAircraftIcaoComponent() {} + CDbAircraftIcaoComponent::~CDbAircraftIcaoComponent() = default; swift::gui::views::CAircraftIcaoCodeView *CDbAircraftIcaoComponent::view() const { return ui->tvp_AircraftIcao; } diff --git a/src/gui/components/dbaircrafticaocomponent.h b/src/gui/components/dbaircrafticaocomponent.h index 1b34e86c46..9246608a60 100644 --- a/src/gui/components/dbaircrafticaocomponent.h +++ b/src/gui/components/dbaircrafticaocomponent.h @@ -46,7 +46,7 @@ namespace swift::gui explicit CDbAircraftIcaoComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CDbAircraftIcaoComponent() override; + ~CDbAircraftIcaoComponent() override; //! Get the view swift::gui::views::CAircraftIcaoCodeView *view() const; diff --git a/src/gui/components/dbaircrafticaoselectorcomponent.cpp b/src/gui/components/dbaircrafticaoselectorcomponent.cpp index a89c972d8c..bb47986ac8 100644 --- a/src/gui/components/dbaircrafticaoselectorcomponent.cpp +++ b/src/gui/components/dbaircrafticaoselectorcomponent.cpp @@ -54,7 +54,7 @@ namespace swift::gui::components } } - CDbAircraftIcaoSelectorComponent::~CDbAircraftIcaoSelectorComponent() {} + CDbAircraftIcaoSelectorComponent::~CDbAircraftIcaoSelectorComponent() = default; bool CDbAircraftIcaoSelectorComponent::setAircraftIcao(const CAircraftIcaoCode &icao) { diff --git a/src/gui/components/dbaircrafticaoselectorcomponent.h b/src/gui/components/dbaircrafticaoselectorcomponent.h index 0615392827..7925e4abb3 100644 --- a/src/gui/components/dbaircrafticaoselectorcomponent.h +++ b/src/gui/components/dbaircrafticaoselectorcomponent.h @@ -47,7 +47,7 @@ namespace swift::gui::components explicit CDbAircraftIcaoSelectorComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CDbAircraftIcaoSelectorComponent() override; + ~CDbAircraftIcaoSelectorComponent() override; //! Current aircraft ICAO //! \return changed @@ -84,16 +84,16 @@ namespace swift::gui::components protected: //! \copydoc QWidget::dragEnterEvent - virtual void dragEnterEvent(QDragEnterEvent *event) override; + void dragEnterEvent(QDragEnterEvent *event) override; //! \copydoc QWidget::dragMoveEvent - virtual void dragMoveEvent(QDragMoveEvent *event) override; + void dragMoveEvent(QDragMoveEvent *event) override; //! \copydoc QWidget::dragLeaveEvent - virtual void dragLeaveEvent(QDragLeaveEvent *event) override; + void dragLeaveEvent(QDragLeaveEvent *event) override; //! \copydoc QWidget::dropEvent - virtual void dropEvent(QDropEvent *event) override; + void dropEvent(QDropEvent *event) override; private: //! Distributors have been read diff --git a/src/gui/components/dbairlineicaocomponent.cpp b/src/gui/components/dbairlineicaocomponent.cpp index 0c88554db8..cfad98dc5e 100644 --- a/src/gui/components/dbairlineicaocomponent.cpp +++ b/src/gui/components/dbairlineicaocomponent.cpp @@ -45,7 +45,7 @@ namespace swift::gui::components sGui->getWebDataServices()->getAirlineIcaoCodesCount(), {}); } - CDbAirlineIcaoComponent::~CDbAirlineIcaoComponent() {} + CDbAirlineIcaoComponent::~CDbAirlineIcaoComponent() = default; swift::gui::views::CAirlineIcaoCodeView *CDbAirlineIcaoComponent::view() const { return ui->tvp_AirlineIcao; } diff --git a/src/gui/components/dbairlineicaocomponent.h b/src/gui/components/dbairlineicaocomponent.h index 8ea1584f3d..f5c8026bcf 100644 --- a/src/gui/components/dbairlineicaocomponent.h +++ b/src/gui/components/dbairlineicaocomponent.h @@ -43,7 +43,7 @@ namespace swift::gui explicit CDbAirlineIcaoComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CDbAirlineIcaoComponent(); + ~CDbAirlineIcaoComponent() override; //! Get the view swift::gui::views::CAirlineIcaoCodeView *view() const; diff --git a/src/gui/components/dbairlineicaoselectorbase.cpp b/src/gui/components/dbairlineicaoselectorbase.cpp index 3ea43da8bb..7adf26d4e4 100644 --- a/src/gui/components/dbairlineicaoselectorbase.cpp +++ b/src/gui/components/dbairlineicaoselectorbase.cpp @@ -52,7 +52,7 @@ namespace swift::gui::components } } - CDbAirlineIcaoSelectorBase::~CDbAirlineIcaoSelectorBase() {} + CDbAirlineIcaoSelectorBase::~CDbAirlineIcaoSelectorBase() = default; bool CDbAirlineIcaoSelectorBase::setAirlineIcao(const CAirlineIcaoCode &icao) { diff --git a/src/gui/components/dbairlineicaoselectorbase.h b/src/gui/components/dbairlineicaoselectorbase.h index 6ab6c53f32..87d9f17869 100644 --- a/src/gui/components/dbairlineicaoselectorbase.h +++ b/src/gui/components/dbairlineicaoselectorbase.h @@ -34,7 +34,7 @@ namespace swift::gui::components public: //! Destructor - virtual ~CDbAirlineIcaoSelectorBase() override; + ~CDbAirlineIcaoSelectorBase() override; //! Current airline ICAO virtual bool setAirlineIcao(const swift::misc::aviation::CAirlineIcaoCode &icao); @@ -66,16 +66,16 @@ namespace swift::gui::components virtual QCompleter *createCompleter() = 0; //! \copydoc QWidget::dragEnterEvent - virtual void dragEnterEvent(QDragEnterEvent *event) override; + void dragEnterEvent(QDragEnterEvent *event) override; //! \copydoc QWidget::dragMoveEvent - virtual void dragMoveEvent(QDragMoveEvent *event) override; + void dragMoveEvent(QDragMoveEvent *event) override; //! \copydoc QWidget::dragLeaveEvent - virtual void dragLeaveEvent(QDragLeaveEvent *event) override; + void dragLeaveEvent(QDragLeaveEvent *event) override; //! \copydoc QWidget::dropEvent - virtual void dropEvent(QDropEvent *event) override; + void dropEvent(QDropEvent *event) override; QScopedPointer m_completer; //!< completer used swift::misc::aviation::CAirlineIcaoCode m_currentIcao; //!< current ICAO object diff --git a/src/gui/components/dbairlineicaoselectorcomponent.cpp b/src/gui/components/dbairlineicaoselectorcomponent.cpp index 0c1efd3735..16685ae688 100644 --- a/src/gui/components/dbairlineicaoselectorcomponent.cpp +++ b/src/gui/components/dbairlineicaoselectorcomponent.cpp @@ -35,7 +35,7 @@ namespace swift::gui::components connect(ui->le_Airline, &QLineEdit::editingFinished, this, &CDbAirlineIcaoSelectorComponent::onDataChanged); } - CDbAirlineIcaoSelectorComponent::~CDbAirlineIcaoSelectorComponent() {} + CDbAirlineIcaoSelectorComponent::~CDbAirlineIcaoSelectorComponent() = default; void CDbAirlineIcaoSelectorComponent::setReadOnly(bool readOnly) { ui->le_Airline->setReadOnly(readOnly); } diff --git a/src/gui/components/dbairlineicaoselectorcomponent.h b/src/gui/components/dbairlineicaoselectorcomponent.h index 0344ed2700..740aa0cd96 100644 --- a/src/gui/components/dbairlineicaoselectorcomponent.h +++ b/src/gui/components/dbairlineicaoselectorcomponent.h @@ -43,13 +43,13 @@ namespace swift::gui::components //! Destructor //! \note needed for forward declared QScopedPointer and needs to be in .cpp - virtual ~CDbAirlineIcaoSelectorComponent() override; + ~CDbAirlineIcaoSelectorComponent() override; //! \name Base class overrides //! @{ - virtual void setReadOnly(bool readOnly) override; - virtual bool setAirlineIcao(const swift::misc::aviation::CAirlineIcaoCode &icao) override; - virtual void clear() override; + void setReadOnly(bool readOnly) override; + bool setAirlineIcao(const swift::misc::aviation::CAirlineIcaoCode &icao) override; + void clear() override; //! @} //! Raw text designator @@ -63,7 +63,7 @@ namespace swift::gui::components protected: //! \copydoc CDbAirlineIcaoSelectorBase::createCompleter - virtual QCompleter *createCompleter() override; + QCompleter *createCompleter() override; private: //! Get the completer strings diff --git a/src/gui/components/dbairlinenameselectorcomponent.cpp b/src/gui/components/dbairlinenameselectorcomponent.cpp index 87de024695..ea749697cc 100644 --- a/src/gui/components/dbairlinenameselectorcomponent.cpp +++ b/src/gui/components/dbairlinenameselectorcomponent.cpp @@ -32,10 +32,7 @@ namespace swift::gui::components &CDbAirlineNameSelectorComponent::ps_dataChanged); } - CDbAirlineNameSelectorComponent::~CDbAirlineNameSelectorComponent() - { - // no inline destructor, read QScopedPointer Forward Declared Pointers - } + CDbAirlineNameSelectorComponent::~CDbAirlineNameSelectorComponent() = default; bool CDbAirlineNameSelectorComponent::setAirlineIcao(const CAirlineIcaoCode &icao) { diff --git a/src/gui/components/dbairlinenameselectorcomponent.h b/src/gui/components/dbairlinenameselectorcomponent.h index 5a8046d421..877651ca11 100644 --- a/src/gui/components/dbairlinenameselectorcomponent.h +++ b/src/gui/components/dbairlinenameselectorcomponent.h @@ -35,18 +35,18 @@ namespace swift::gui::components //! Destructor //! \note needed for forward declared QScopedPointer and needs to be in .cpp - virtual ~CDbAirlineNameSelectorComponent() override; + ~CDbAirlineNameSelectorComponent() override; //! \name Base class overrides //! @{ - virtual void setReadOnly(bool readOnly) override; - virtual bool setAirlineIcao(const swift::misc::aviation::CAirlineIcaoCode &icao) override; - virtual void clear() override; + void setReadOnly(bool readOnly) override; + bool setAirlineIcao(const swift::misc::aviation::CAirlineIcaoCode &icao) override; + void clear() override; //! @} protected: //! \copydoc CDbAirlineIcaoSelectorBase::createCompleter - virtual QCompleter *createCompleter() override; + QCompleter *createCompleter() override; private: QScopedPointer ui; diff --git a/src/gui/components/dbautosimulatorstashingcomponent.cpp b/src/gui/components/dbautosimulatorstashingcomponent.cpp index e0abfa23c8..56c9442a24 100644 --- a/src/gui/components/dbautosimulatorstashingcomponent.cpp +++ b/src/gui/components/dbautosimulatorstashingcomponent.cpp @@ -61,7 +61,7 @@ namespace swift::gui::components } } - CDbAutoSimulatorStashingComponent::~CDbAutoSimulatorStashingComponent() {} + CDbAutoSimulatorStashingComponent::~CDbAutoSimulatorStashingComponent() = default; void CDbAutoSimulatorStashingComponent::updateProgressIndicator(int percent) { diff --git a/src/gui/components/dbautosimulatorstashingcomponent.h b/src/gui/components/dbautosimulatorstashingcomponent.h index dc9b5df4ba..dfcfdaba14 100644 --- a/src/gui/components/dbautosimulatorstashingcomponent.h +++ b/src/gui/components/dbautosimulatorstashingcomponent.h @@ -47,20 +47,20 @@ namespace swift::gui::components explicit CDbAutoSimulatorStashingComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CDbAutoSimulatorStashingComponent() override; + ~CDbAutoSimulatorStashingComponent() override; //! At least run once and completed bool isCompleted() const { return m_state == Completed; } //! \copydoc swift::core::IProgressIndicator::updateProgressIndicator - virtual void updateProgressIndicator(int percent) override; + void updateProgressIndicator(int percent) override; public slots: //! \copydoc QDialog::accept - virtual void accept() override; + void accept() override; //! \copydoc QDialog::exec - virtual int exec() override; + int exec() override; private: //! Init the GUI diff --git a/src/gui/components/dbautostashingcomponent.cpp b/src/gui/components/dbautostashingcomponent.cpp index 5c21680a39..fe449f5ca5 100644 --- a/src/gui/components/dbautostashingcomponent.cpp +++ b/src/gui/components/dbautostashingcomponent.cpp @@ -62,7 +62,7 @@ namespace swift::gui::components this->resetDescription(); } - CDbAutoStashingComponent::~CDbAutoStashingComponent() {} + CDbAutoStashingComponent::~CDbAutoStashingComponent() = default; void CDbAutoStashingComponent::accept() { diff --git a/src/gui/components/dbautostashingcomponent.h b/src/gui/components/dbautostashingcomponent.h index 5b1671bd7c..40aaf053ce 100644 --- a/src/gui/components/dbautostashingcomponent.h +++ b/src/gui/components/dbautostashingcomponent.h @@ -64,20 +64,20 @@ namespace swift::gui explicit CDbAutoStashingComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CDbAutoStashingComponent() override; + ~CDbAutoStashingComponent() override; //! At least run once and completed bool isCompleted() const { return m_state == Completed; } //! \copydoc swift::core::IProgressIndicator::updateProgressIndicator - virtual void updateProgressIndicator(int percent) override; + void updateProgressIndicator(int percent) override; public slots: //! \copydoc QDialog::accept - virtual void accept() override; + void accept() override; //! \copydoc QDialog::exec - virtual int exec() override; + int exec() override; //! Show last result void showLastResults(); diff --git a/src/gui/components/dbcountrycomponent.cpp b/src/gui/components/dbcountrycomponent.cpp index b7a609df7e..5daceb1b21 100644 --- a/src/gui/components/dbcountrycomponent.cpp +++ b/src/gui/components/dbcountrycomponent.cpp @@ -37,7 +37,7 @@ namespace swift::gui::components sGui->getWebDataServices()->getCountriesCount(), {}); } - CDbCountryComponent::~CDbCountryComponent() {} + CDbCountryComponent::~CDbCountryComponent() = default; void CDbCountryComponent::onCountriesRead(CEntityFlags::Entity entity, CEntityFlags::ReadState readState, int count, const QUrl &url) diff --git a/src/gui/components/dbcountrycomponent.h b/src/gui/components/dbcountrycomponent.h index 883ea42f99..55773a1ac5 100644 --- a/src/gui/components/dbcountrycomponent.h +++ b/src/gui/components/dbcountrycomponent.h @@ -38,7 +38,7 @@ namespace swift::gui::components explicit CDbCountryComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CDbCountryComponent() override; + ~CDbCountryComponent() override; private: //! Countries have been read diff --git a/src/gui/components/dbcountryselectorcomponent.cpp b/src/gui/components/dbcountryselectorcomponent.cpp index c51819e550..71bd9dbd66 100644 --- a/src/gui/components/dbcountryselectorcomponent.cpp +++ b/src/gui/components/dbcountryselectorcomponent.cpp @@ -51,7 +51,7 @@ namespace swift::gui::components sGui->getWebDataServices()->getCountriesCount()); } - CDbCountrySelectorComponent::~CDbCountrySelectorComponent() {} + CDbCountrySelectorComponent::~CDbCountrySelectorComponent() = default; void CDbCountrySelectorComponent::setCountry(const swift::misc::CCountry &country) { diff --git a/src/gui/components/dbcountryselectorcomponent.h b/src/gui/components/dbcountryselectorcomponent.h index 89f9c058c9..1fbdf22488 100644 --- a/src/gui/components/dbcountryselectorcomponent.h +++ b/src/gui/components/dbcountryselectorcomponent.h @@ -67,16 +67,16 @@ namespace swift::gui::components protected: //! \copydoc QWidget::dragEnterEvent - virtual void dragEnterEvent(QDragEnterEvent *event) override; + void dragEnterEvent(QDragEnterEvent *event) override; //! \copydoc QWidget::dragMoveEvent - virtual void dragMoveEvent(QDragMoveEvent *event) override; + void dragMoveEvent(QDragMoveEvent *event) override; //! \copydoc QWidget::dragLeaveEvent - virtual void dragLeaveEvent(QDragLeaveEvent *event) override; + void dragLeaveEvent(QDragLeaveEvent *event) override; //! \copydoc QWidget::dropEvent - virtual void dropEvent(QDropEvent *event) override; + void dropEvent(QDropEvent *event) override; private: //! Countries have been read diff --git a/src/gui/components/dbdistributorcomponent.cpp b/src/gui/components/dbdistributorcomponent.cpp index 35442b7b22..3c92f0d66d 100644 --- a/src/gui/components/dbdistributorcomponent.cpp +++ b/src/gui/components/dbdistributorcomponent.cpp @@ -45,7 +45,7 @@ namespace swift::gui::components } } - CDbDistributorComponent::~CDbDistributorComponent() {} + CDbDistributorComponent::~CDbDistributorComponent() = default; CDistributorView *CDbDistributorComponent::view() const { return ui->tvp_Distributors; } diff --git a/src/gui/components/dbdistributorcomponent.h b/src/gui/components/dbdistributorcomponent.h index 8f58056836..3e46743ae7 100644 --- a/src/gui/components/dbdistributorcomponent.h +++ b/src/gui/components/dbdistributorcomponent.h @@ -47,7 +47,7 @@ namespace swift::gui explicit CDbDistributorComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CDbDistributorComponent() override; + ~CDbDistributorComponent() override; //! Get the view swift::gui::views::CDistributorView *view() const; diff --git a/src/gui/components/dbdistributorselectorcomponent.cpp b/src/gui/components/dbdistributorselectorcomponent.cpp index e06495989d..f91c62c1b5 100644 --- a/src/gui/components/dbdistributorselectorcomponent.cpp +++ b/src/gui/components/dbdistributorselectorcomponent.cpp @@ -59,10 +59,7 @@ namespace swift::gui::components sApp->getWebDataServices()->getDistributorsCount()); } - CDbDistributorSelectorComponent::~CDbDistributorSelectorComponent() - { - // void - } + CDbDistributorSelectorComponent::~CDbDistributorSelectorComponent() = default; void CDbDistributorSelectorComponent::setDistributor(const CDistributor &distributor) { diff --git a/src/gui/components/dbdistributorselectorcomponent.h b/src/gui/components/dbdistributorselectorcomponent.h index 5bdc9a46fc..9f5d948740 100644 --- a/src/gui/components/dbdistributorselectorcomponent.h +++ b/src/gui/components/dbdistributorselectorcomponent.h @@ -42,7 +42,7 @@ namespace swift::gui::components explicit CDbDistributorSelectorComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CDbDistributorSelectorComponent() override; + ~CDbDistributorSelectorComponent() override; //! Current distributor void setDistributor(const swift::misc::simulation::CDistributor &distributor); @@ -71,16 +71,16 @@ namespace swift::gui::components protected: //! \copydoc QWidget::dragEnterEvent - virtual void dragEnterEvent(QDragEnterEvent *event) override; + void dragEnterEvent(QDragEnterEvent *event) override; //! \copydoc QWidget::dragMoveEvent - virtual void dragMoveEvent(QDragMoveEvent *event) override; + void dragMoveEvent(QDragMoveEvent *event) override; //! \copydoc QWidget::dragLeaveEvent - virtual void dragLeaveEvent(QDragLeaveEvent *event) override; + void dragLeaveEvent(QDragLeaveEvent *event) override; //! \copydoc QWidget::dropEvent - virtual void dropEvent(QDropEvent *event) override; + void dropEvent(QDropEvent *event) override; private: //! Distributors have been read diff --git a/src/gui/components/dbliverycolorsearch.cpp b/src/gui/components/dbliverycolorsearch.cpp index 269eccb237..7ac2cbff57 100644 --- a/src/gui/components/dbliverycolorsearch.cpp +++ b/src/gui/components/dbliverycolorsearch.cpp @@ -20,7 +20,7 @@ namespace swift::gui::components this->setFocusProxy(ui->comp_FuselageSelector); } - CDbLiveryColorSearch::~CDbLiveryColorSearch() {} + CDbLiveryColorSearch::~CDbLiveryColorSearch() = default; CLivery CDbLiveryColorSearch::getLivery() const { diff --git a/src/gui/components/dbliverycolorsearch.h b/src/gui/components/dbliverycolorsearch.h index d747218aac..f03167dda0 100644 --- a/src/gui/components/dbliverycolorsearch.h +++ b/src/gui/components/dbliverycolorsearch.h @@ -29,7 +29,7 @@ namespace swift::gui::components explicit CDbLiveryColorSearch(QWidget *parent = nullptr); //! Destructor - ~CDbLiveryColorSearch(); + ~CDbLiveryColorSearch() override; //! Found livery if any, otherwise default swift::misc::aviation::CLivery getLivery() const; diff --git a/src/gui/components/dbliverycolorsearchdialog.cpp b/src/gui/components/dbliverycolorsearchdialog.cpp index 4403a844fb..852162dcd2 100644 --- a/src/gui/components/dbliverycolorsearchdialog.cpp +++ b/src/gui/components/dbliverycolorsearchdialog.cpp @@ -21,7 +21,7 @@ namespace swift::gui::components connect(this, &CDbLiveryColorSearchDialog::accepted, this, &CDbLiveryColorSearchDialog::onAccepted); } - CDbLiveryColorSearchDialog::~CDbLiveryColorSearchDialog() {} + CDbLiveryColorSearchDialog::~CDbLiveryColorSearchDialog() = default; const CLivery &CDbLiveryColorSearchDialog::getLivery() const { return m_foundLivery; } diff --git a/src/gui/components/dbliverycolorsearchdialog.h b/src/gui/components/dbliverycolorsearchdialog.h index eba1aab551..d90dd94d9e 100644 --- a/src/gui/components/dbliverycolorsearchdialog.h +++ b/src/gui/components/dbliverycolorsearchdialog.h @@ -29,7 +29,7 @@ namespace swift::gui::components explicit CDbLiveryColorSearchDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CDbLiveryColorSearchDialog(); + ~CDbLiveryColorSearchDialog() override; //! Found livery if any, otherwise default const swift::misc::aviation::CLivery &getLivery() const; diff --git a/src/gui/components/dbliverycomponent.cpp b/src/gui/components/dbliverycomponent.cpp index 17f26e8ea2..95e3b25e0d 100644 --- a/src/gui/components/dbliverycomponent.cpp +++ b/src/gui/components/dbliverycomponent.cpp @@ -40,7 +40,7 @@ namespace swift::gui::components sGui->getWebDataServices()->getLiveriesCount()); } - CDbLiveryComponent::~CDbLiveryComponent() {} + CDbLiveryComponent::~CDbLiveryComponent() = default; CLiveryView *CDbLiveryComponent::view() { return ui->tvp_Liveries; } diff --git a/src/gui/components/dbliverycomponent.h b/src/gui/components/dbliverycomponent.h index e9fee75ad8..a62034eb84 100644 --- a/src/gui/components/dbliverycomponent.h +++ b/src/gui/components/dbliverycomponent.h @@ -48,7 +48,7 @@ namespace swift::gui explicit CDbLiveryComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CDbLiveryComponent(); + ~CDbLiveryComponent() override; //! The livery view swift::gui::views::CLiveryView *view(); diff --git a/src/gui/components/dbliveryselectorcomponent.cpp b/src/gui/components/dbliveryselectorcomponent.cpp index 076e74309b..c988d2b5a7 100644 --- a/src/gui/components/dbliveryselectorcomponent.cpp +++ b/src/gui/components/dbliveryselectorcomponent.cpp @@ -55,10 +55,7 @@ namespace swift::gui::components sGui->getWebDataServices()->getLiveriesCount(), {}); } - CDbLiverySelectorComponent::~CDbLiverySelectorComponent() - { - // void - } + CDbLiverySelectorComponent::~CDbLiverySelectorComponent() = default; void CDbLiverySelectorComponent::setLivery(const CLivery &livery) { diff --git a/src/gui/components/dbliveryselectorcomponent.h b/src/gui/components/dbliveryselectorcomponent.h index 291d5b1720..20a6fa3726 100644 --- a/src/gui/components/dbliveryselectorcomponent.h +++ b/src/gui/components/dbliveryselectorcomponent.h @@ -43,7 +43,7 @@ namespace swift::gui::components explicit CDbLiverySelectorComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CDbLiverySelectorComponent(); + ~CDbLiverySelectorComponent() override; //! Current livery void setLivery(const swift::misc::aviation::CLivery &livery); @@ -75,16 +75,16 @@ namespace swift::gui::components protected: //! \copydoc QWidget::dragEnterEvent - virtual void dragEnterEvent(QDragEnterEvent *event) override; + void dragEnterEvent(QDragEnterEvent *event) override; //! \copydoc QWidget::dragMoveEvent - virtual void dragMoveEvent(QDragMoveEvent *event) override; + void dragMoveEvent(QDragMoveEvent *event) override; //! \copydoc QWidget::dragLeaveEvent - virtual void dragLeaveEvent(QDragLeaveEvent *event) override; + void dragLeaveEvent(QDragLeaveEvent *event) override; //! \copydoc QWidget::dropEvent - virtual void dropEvent(QDropEvent *event) override; + void dropEvent(QDropEvent *event) override; private: //! Data have been changed diff --git a/src/gui/components/dbloaddatadialog.cpp b/src/gui/components/dbloaddatadialog.cpp index 3376e2c13e..d87b3a0c59 100644 --- a/src/gui/components/dbloaddatadialog.cpp +++ b/src/gui/components/dbloaddatadialog.cpp @@ -46,7 +46,7 @@ namespace swift::gui::components connect(this, &CDbLoadDataDialog::rejected, this, &CDbLoadDataDialog::onRejected); } - CDbLoadDataDialog::~CDbLoadDataDialog() {} + CDbLoadDataDialog::~CDbLoadDataDialog() = default; bool CDbLoadDataDialog::newerOrEmptyEntitiesDetected(CEntityFlags::Entity loadEntities) { diff --git a/src/gui/components/dbloaddatadialog.h b/src/gui/components/dbloaddatadialog.h index 10f90b9574..c4e515c897 100644 --- a/src/gui/components/dbloaddatadialog.h +++ b/src/gui/components/dbloaddatadialog.h @@ -34,7 +34,7 @@ namespace swift::gui::components explicit CDbLoadDataDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CDbLoadDataDialog(); + ~CDbLoadDataDialog() override; //! Newer or empty entities detected bool newerOrEmptyEntitiesDetected(swift::misc::network::CEntityFlags::Entity loadEntities); diff --git a/src/gui/components/dbloadoverviewcomponent.cpp b/src/gui/components/dbloadoverviewcomponent.cpp index 746a43fa7d..eb935263bb 100644 --- a/src/gui/components/dbloadoverviewcomponent.cpp +++ b/src/gui/components/dbloadoverviewcomponent.cpp @@ -84,7 +84,7 @@ namespace swift::gui::components } } - CDbLoadOverviewComponent::~CDbLoadOverviewComponent() {} + CDbLoadOverviewComponent::~CDbLoadOverviewComponent() = default; void CDbLoadOverviewComponent::display() { m_dsTriggerGuiUpdate.inputSignal(); } diff --git a/src/gui/components/dbloadoverviewcomponent.h b/src/gui/components/dbloadoverviewcomponent.h index 55856a81c8..f79511bb05 100644 --- a/src/gui/components/dbloadoverviewcomponent.h +++ b/src/gui/components/dbloadoverviewcomponent.h @@ -32,7 +32,7 @@ namespace swift::gui::components explicit CDbLoadOverviewComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CDbLoadOverviewComponent() override; + ~CDbLoadOverviewComponent() override; //! Initialize void display(); @@ -60,7 +60,7 @@ namespace swift::gui::components protected: //! \copydoc QWidget::resizeEvent - virtual void resizeEvent(QResizeEvent *event) override; + void resizeEvent(QResizeEvent *event) override; private: QScopedPointer ui; diff --git a/src/gui/components/dblogincomponent.cpp b/src/gui/components/dblogincomponent.cpp index d640d3aa2d..89f7deac16 100644 --- a/src/gui/components/dblogincomponent.cpp +++ b/src/gui/components/dblogincomponent.cpp @@ -72,7 +72,7 @@ namespace swift::gui::components this->setUserInfo(this->getDbUser()); } - CDbLoginComponent::~CDbLoginComponent() {} + CDbLoginComponent::~CDbLoginComponent() = default; CAuthenticatedUser CDbLoginComponent::getDbUser() const { return m_loginService.getDbUser(); } diff --git a/src/gui/components/dblogincomponent.h b/src/gui/components/dblogincomponent.h index 72eda38717..f31a0e0813 100644 --- a/src/gui/components/dblogincomponent.h +++ b/src/gui/components/dblogincomponent.h @@ -39,7 +39,7 @@ namespace swift::gui::components explicit CDbLoginComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CDbLoginComponent() override; + ~CDbLoginComponent() override; //! DB user swift::misc::network::CAuthenticatedUser getDbUser() const; diff --git a/src/gui/components/dbmappingcomponent.h b/src/gui/components/dbmappingcomponent.h index 85e416c851..4889be02c2 100644 --- a/src/gui/components/dbmappingcomponent.h +++ b/src/gui/components/dbmappingcomponent.h @@ -87,7 +87,7 @@ namespace swift::gui explicit CDbMappingComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CDbMappingComponent() override; + ~CDbMappingComponent() override; //! Graceful shutdown void gracefulShutdown(); @@ -375,7 +375,7 @@ namespace swift::gui CMappingVPilotMenu(CDbMappingComponent *mappingComponent) : menus::IMenuDelegate(mappingComponent) {} //! \copydoc IMenuDelegate::customMenu - virtual void customMenu(menus::CMenuActions &menuActions) override; + void customMenu(menus::CMenuActions &menuActions) override; private: //! Mapping component @@ -398,7 +398,7 @@ namespace swift::gui CStashToolsMenu(CDbMappingComponent *mappingComponent); //! \copydoc IMenuDelegate::customMenu - virtual void customMenu(menus::CMenuActions &menuActions) override; + void customMenu(menus::CMenuActions &menuActions) override; private: //! Mapping component @@ -421,7 +421,7 @@ namespace swift::gui COwnModelSetMenu(CDbMappingComponent *mappingComponent) : menus::IMenuDelegate(mappingComponent) {} //! \copydoc IMenuDelegate::customMenu - virtual void customMenu(menus::CMenuActions &menuActions) override; + void customMenu(menus::CMenuActions &menuActions) override; private: //! Mapping component @@ -439,7 +439,7 @@ namespace swift::gui CRemovedModelsMenu(CDbMappingComponent *mappingComponent) : menus::IMenuDelegate(mappingComponent) {} //! \copydoc IMenuDelegate::customMenu - virtual void customMenu(menus::CMenuActions &menuActions) override; + void customMenu(menus::CMenuActions &menuActions) override; private: //! Mapping component @@ -457,7 +457,7 @@ namespace swift::gui CApplyDbDataMenu(CDbMappingComponent *mappingComponent) : menus::IMenuDelegate(mappingComponent) {} //! \copydoc IMenuDelegate::customMenu - virtual void customMenu(menus::CMenuActions &menuActions) override; + void customMenu(menus::CMenuActions &menuActions) override; private: //! Mapping component @@ -476,7 +476,7 @@ namespace swift::gui CMergeWithVPilotMenu(CDbMappingComponent *mappingComponent); //! \copydoc IMenuDelegate::customMenu - virtual void customMenu(menus::CMenuActions &menuActions) override; + void customMenu(menus::CMenuActions &menuActions) override; //! Mapping component CDbMappingComponent *mappingComponent() const; diff --git a/src/gui/components/dbmappingcomponentaware.h b/src/gui/components/dbmappingcomponentaware.h index dee6baabe8..9ba1560e70 100644 --- a/src/gui/components/dbmappingcomponentaware.h +++ b/src/gui/components/dbmappingcomponentaware.h @@ -30,7 +30,7 @@ namespace swift::gui::components CDbMappingComponentAware(QObject *parent); //! Destructor - virtual ~CDbMappingComponentAware() {} + virtual ~CDbMappingComponentAware() = default; //! Copy constructor CDbMappingComponentAware(const CDbMappingComponentAware &) = default; diff --git a/src/gui/components/dbmodelcomponent.cpp b/src/gui/components/dbmodelcomponent.cpp index fb28874d51..417053de6f 100644 --- a/src/gui/components/dbmodelcomponent.cpp +++ b/src/gui/components/dbmodelcomponent.cpp @@ -56,10 +56,7 @@ namespace swift::gui::components sApp->getWebDataServices()->getModelsCount(), {}); } - CDbModelComponent::~CDbModelComponent() - { - // void - } + CDbModelComponent::~CDbModelComponent() = default; bool CDbModelComponent::hasModels() const { return !ui->tvp_AircraftModel->isEmpty(); } diff --git a/src/gui/components/dbmodelcomponent.h b/src/gui/components/dbmodelcomponent.h index bfae328197..3070554bb4 100644 --- a/src/gui/components/dbmodelcomponent.h +++ b/src/gui/components/dbmodelcomponent.h @@ -40,7 +40,7 @@ namespace swift::gui::components explicit CDbModelComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CDbModelComponent(); + ~CDbModelComponent() override; //! Get latest model if any swift::misc::simulation::CAircraftModel getLatestModel() const; diff --git a/src/gui/components/dbmodelmappingmodifydialog.cpp b/src/gui/components/dbmodelmappingmodifydialog.cpp index 7f54351a84..4685b4dfbd 100644 --- a/src/gui/components/dbmodelmappingmodifydialog.cpp +++ b/src/gui/components/dbmodelmappingmodifydialog.cpp @@ -21,10 +21,7 @@ namespace swift::gui::components this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); } - CDbModelMappingModifyDialog::~CDbModelMappingModifyDialog() - { - // void - } + CDbModelMappingModifyDialog::~CDbModelMappingModifyDialog() = default; CPropertyIndexVariantMap CDbModelMappingModifyDialog::getValues() const { diff --git a/src/gui/components/dbmodelmappingmodifydialog.h b/src/gui/components/dbmodelmappingmodifydialog.h index 097fbbedd7..f223c3595b 100644 --- a/src/gui/components/dbmodelmappingmodifydialog.h +++ b/src/gui/components/dbmodelmappingmodifydialog.h @@ -36,7 +36,7 @@ namespace swift::gui::components explicit CDbModelMappingModifyDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CDbModelMappingModifyDialog(); + ~CDbModelMappingModifyDialog() override; //! Get the values swift::misc::CPropertyIndexVariantMap getValues() const; diff --git a/src/gui/components/dbmodelworkbenchcomponent.cpp b/src/gui/components/dbmodelworkbenchcomponent.cpp index 2c804ad3d8..499b473940 100644 --- a/src/gui/components/dbmodelworkbenchcomponent.cpp +++ b/src/gui/components/dbmodelworkbenchcomponent.cpp @@ -50,10 +50,7 @@ namespace swift::gui::components ui->tvp_Models->setCustomMenu(new CConsolidateWithDbDataMenu(ui->tvp_Models, this)); } - CDbModelWorkbenchComponent::~CDbModelWorkbenchComponent() - { - // void - } + CDbModelWorkbenchComponent::~CDbModelWorkbenchComponent() = default; const QStringList &CDbModelWorkbenchComponent::getLogCategories() { diff --git a/src/gui/components/dbmodelworkbenchcomponent.h b/src/gui/components/dbmodelworkbenchcomponent.h index 6c3192e425..b5b56514bf 100644 --- a/src/gui/components/dbmodelworkbenchcomponent.h +++ b/src/gui/components/dbmodelworkbenchcomponent.h @@ -59,7 +59,7 @@ namespace swift::gui explicit CDbModelWorkbenchComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CDbModelWorkbenchComponent() override; + ~CDbModelWorkbenchComponent() override; //! Log categories static const QStringList &getLogCategories(); @@ -84,18 +84,18 @@ namespace swift::gui //! \name Implementations of the models interfaces //! @{ - virtual void setModels(const swift::misc::simulation::CAircraftModelList &models) override + void setModels(const swift::misc::simulation::CAircraftModelList &models) override { this->setModelsForSimulator(models, swift::misc::simulation::CSimulatorInfo()); } - virtual void setModelsForSimulator(const swift::misc::simulation::CAircraftModelList &models, - const swift::misc::simulation::CSimulatorInfo &simulator) override; - virtual int updateModels(const swift::misc::simulation::CAircraftModelList &models) override + void setModelsForSimulator(const swift::misc::simulation::CAircraftModelList &models, + const swift::misc::simulation::CSimulatorInfo &simulator) override; + int updateModels(const swift::misc::simulation::CAircraftModelList &models) override { return this->updateModelsForSimulator(models, swift::misc::simulation::CSimulatorInfo()); } - virtual int updateModelsForSimulator(const swift::misc::simulation::CAircraftModelList &models, - const swift::misc::simulation::CSimulatorInfo &simulator) override; + int updateModelsForSimulator(const swift::misc::simulation::CAircraftModelList &models, + const swift::misc::simulation::CSimulatorInfo &simulator) override; //! @} private: diff --git a/src/gui/components/dbownmodelscomponent.cpp b/src/gui/components/dbownmodelscomponent.cpp index 1a24f7f472..ba55a51d06 100644 --- a/src/gui/components/dbownmodelscomponent.cpp +++ b/src/gui/components/dbownmodelscomponent.cpp @@ -97,10 +97,7 @@ namespace swift::gui::components ui->tvp_OwnAircraftModels->setCustomMenu(new CConsolidateWithDbDataMenu(ui->tvp_OwnAircraftModels, this)); } - CDbOwnModelsComponent::~CDbOwnModelsComponent() - { - // void - } + CDbOwnModelsComponent::~CDbOwnModelsComponent() = default; const QStringList &CDbOwnModelsComponent::getLogCategories() { diff --git a/src/gui/components/dbownmodelscomponent.h b/src/gui/components/dbownmodelscomponent.h index b470513504..22f099d5b4 100644 --- a/src/gui/components/dbownmodelscomponent.h +++ b/src/gui/components/dbownmodelscomponent.h @@ -71,7 +71,7 @@ namespace swift::gui explicit CDbOwnModelsComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CDbOwnModelsComponent() override; + ~CDbOwnModelsComponent() override; //! Log categories static const QStringList &getLogCategories(); @@ -131,18 +131,18 @@ namespace swift::gui //! \name Implementations of the models interfaces //! @{ - virtual void setModels(const swift::misc::simulation::CAircraftModelList &models) override + void setModels(const swift::misc::simulation::CAircraftModelList &models) override { this->setModelsForSimulator(models, this->getOwnModelsSimulator()); } - virtual void setModelsForSimulator(const swift::misc::simulation::CAircraftModelList &models, - const swift::misc::simulation::CSimulatorInfo &simulator) override; - virtual int updateModels(const swift::misc::simulation::CAircraftModelList &models) override + void setModelsForSimulator(const swift::misc::simulation::CAircraftModelList &models, + const swift::misc::simulation::CSimulatorInfo &simulator) override; + int updateModels(const swift::misc::simulation::CAircraftModelList &models) override { return this->updateModelsForSimulator(models, this->getOwnModelsSimulator()); } - virtual int updateModelsForSimulator(const swift::misc::simulation::CAircraftModelList &models, - const swift::misc::simulation::CSimulatorInfo &simulator) override; + int updateModelsForSimulator(const swift::misc::simulation::CAircraftModelList &models, + const swift::misc::simulation::CSimulatorInfo &simulator) override; //! @} signals: @@ -240,7 +240,7 @@ namespace swift::gui {} //! \copydoc IMenuDelegate::customMenu - virtual void customMenu(menus::CMenuActions &menuActions) override; + void customMenu(menus::CMenuActions &menuActions) override; private: QAction *m_csl2xsbAction = nullptr; //!< run csl2xsb script diff --git a/src/gui/components/dbownmodelsdialog.cpp b/src/gui/components/dbownmodelsdialog.cpp index 48a1719b23..ed52b3bfe3 100644 --- a/src/gui/components/dbownmodelsdialog.cpp +++ b/src/gui/components/dbownmodelsdialog.cpp @@ -20,7 +20,7 @@ namespace swift::gui::components &CDbOwnModelsDialog::successfullyLoadedModels); } - CDbOwnModelsDialog::~CDbOwnModelsDialog() {} + CDbOwnModelsDialog::~CDbOwnModelsDialog() = default; void CDbOwnModelsDialog::setSimulator(const CSimulatorInfo &simulator) { diff --git a/src/gui/components/dbownmodelsdialog.h b/src/gui/components/dbownmodelsdialog.h index 3f62cce87c..232301e758 100644 --- a/src/gui/components/dbownmodelsdialog.h +++ b/src/gui/components/dbownmodelsdialog.h @@ -30,7 +30,7 @@ namespace swift::gui::components explicit CDbOwnModelsDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CDbOwnModelsDialog() override; + ~CDbOwnModelsDialog() override; //! \copydoc CDbOwnModelsComponent::setSimulator void setSimulator(const swift::misc::simulation::CSimulatorInfo &simulator); diff --git a/src/gui/components/dbownmodelsetcomponent.cpp b/src/gui/components/dbownmodelsetcomponent.cpp index 4c39cb7f05..d158ecf95c 100644 --- a/src/gui/components/dbownmodelsetcomponent.cpp +++ b/src/gui/components/dbownmodelsetcomponent.cpp @@ -107,10 +107,7 @@ namespace swift::gui::components this->triggerSetSimulatorDeferred(simulator); } - CDbOwnModelSetComponent::~CDbOwnModelSetComponent() - { - // void - } + CDbOwnModelSetComponent::~CDbOwnModelSetComponent() = default; views::CAircraftModelView *CDbOwnModelSetComponent::view() const { return ui->tvp_OwnModelSet; } diff --git a/src/gui/components/dbownmodelsetcomponent.h b/src/gui/components/dbownmodelsetcomponent.h index 827cd7440f..494dbe63bc 100644 --- a/src/gui/components/dbownmodelsetcomponent.h +++ b/src/gui/components/dbownmodelsetcomponent.h @@ -75,7 +75,7 @@ namespace swift::gui explicit CDbOwnModelSetComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CDbOwnModelSetComponent() override; + ~CDbOwnModelSetComponent() override; //! Corresponding view views::CAircraftModelView *view() const; @@ -118,22 +118,22 @@ namespace swift::gui void setSimulatorSelectorMode(CSimulatorSelector::Mode mode); //! \copydoc CDbMappingComponentAware::setMappingComponent - virtual void setMappingComponent(CDbMappingComponent *component) override; + void setMappingComponent(CDbMappingComponent *component) override; //! Model set is for simulator swift::misc::simulation::CSimulatorInfo getModelSetSimulator() const { return m_simulator; } //! \name Implementations of the models interfaces //! @{ - virtual void setModels(const swift::misc::simulation::CAircraftModelList &models) override + void setModels(const swift::misc::simulation::CAircraftModelList &models) override { this->setModelSet(models, this->getModelSetSimulator()); } - virtual int updateModels(const swift::misc::simulation::CAircraftModelList &models) override + int updateModels(const swift::misc::simulation::CAircraftModelList &models) override { return this->replaceOrAddModelSet(models, this->getModelSetSimulator()); } - virtual swift::misc::simulation::CSimulatorInfo getSelectedSimulator() const override + swift::misc::simulation::CSimulatorInfo getSelectedSimulator() const override { return this->getModelSetSimulator(); } @@ -235,7 +235,7 @@ namespace swift::gui {} //! \copydoc IMenuDelegate::customMenu - virtual void customMenu(swift::gui::menus::CMenuActions &menuActions) override; + void customMenu(swift::gui::menus::CMenuActions &menuActions) override; private: QList m_setActions; diff --git a/src/gui/components/dbownmodelsetdialog.cpp b/src/gui/components/dbownmodelsetdialog.cpp index c635fb5502..c89111ef3a 100644 --- a/src/gui/components/dbownmodelsetdialog.cpp +++ b/src/gui/components/dbownmodelsetdialog.cpp @@ -16,7 +16,7 @@ namespace swift::gui::components this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); } - CDbOwnModelSetDialog::~CDbOwnModelSetDialog() {} + CDbOwnModelSetDialog::~CDbOwnModelSetDialog() = default; void CDbOwnModelSetDialog::setSimulator(const CSimulatorInfo &simulator) { diff --git a/src/gui/components/dbownmodelsetdialog.h b/src/gui/components/dbownmodelsetdialog.h index d8fe5374e1..42a433b92b 100644 --- a/src/gui/components/dbownmodelsetdialog.h +++ b/src/gui/components/dbownmodelsetdialog.h @@ -29,7 +29,7 @@ namespace swift::gui::components explicit CDbOwnModelSetDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CDbOwnModelSetDialog() override; + ~CDbOwnModelSetDialog() override; //! \copydoc CDbOwnModelSetComponent::setSimulator void setSimulator(const swift::misc::simulation::CSimulatorInfo &simulator); diff --git a/src/gui/components/dbownmodelsetformdialog.cpp b/src/gui/components/dbownmodelsetformdialog.cpp index d5ac96d4b8..d071c60c02 100644 --- a/src/gui/components/dbownmodelsetformdialog.cpp +++ b/src/gui/components/dbownmodelsetformdialog.cpp @@ -40,10 +40,7 @@ namespace swift::gui::components &CDbOwnModelSetFormDialog::simulatorChanged); } - CDbOwnModelSetFormDialog::~CDbOwnModelSetFormDialog() - { - // void - } + CDbOwnModelSetFormDialog::~CDbOwnModelSetFormDialog() = default; void CDbOwnModelSetFormDialog::reloadData() { diff --git a/src/gui/components/dbownmodelsetformdialog.h b/src/gui/components/dbownmodelsetformdialog.h index 02efb65c2b..8a53d52c45 100644 --- a/src/gui/components/dbownmodelsetformdialog.h +++ b/src/gui/components/dbownmodelsetformdialog.h @@ -39,7 +39,7 @@ namespace swift::gui::components explicit CDbOwnModelSetFormDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CDbOwnModelSetFormDialog() override; + ~CDbOwnModelSetFormDialog() override; //! Last build set const swift::misc::simulation::CAircraftModelList &getModelSet() const { return m_modelSet; } @@ -54,7 +54,7 @@ namespace swift::gui::components void reloadData(); //! Exec and display simulator - virtual int exec() override; + int exec() override; private: QScopedPointer ui; diff --git a/src/gui/components/dbquickmappingwizard.cpp b/src/gui/components/dbquickmappingwizard.cpp index b9c0257a69..ccf5e40918 100644 --- a/src/gui/components/dbquickmappingwizard.cpp +++ b/src/gui/components/dbquickmappingwizard.cpp @@ -67,7 +67,7 @@ namespace swift::gui::components this->onWebDataRead(); } - CDbQuickMappingWizard::~CDbQuickMappingWizard() {} + CDbQuickMappingWizard::~CDbQuickMappingWizard() = default; const QStringList &CDbQuickMappingWizard::getLogCategories() { diff --git a/src/gui/components/dbreducemodelduplicates.cpp b/src/gui/components/dbreducemodelduplicates.cpp index ec14d08749..6587f6a124 100644 --- a/src/gui/components/dbreducemodelduplicates.cpp +++ b/src/gui/components/dbreducemodelduplicates.cpp @@ -37,7 +37,7 @@ namespace swift::gui::components connect(this, &QDialog::finished, this, &CDbReduceModelDuplicates::stop); } - CDbReduceModelDuplicates::~CDbReduceModelDuplicates() {} + CDbReduceModelDuplicates::~CDbReduceModelDuplicates() = default; void CDbReduceModelDuplicates::setModels(const CAircraftModelList &models, const CSimulatorInfo &simulator) { diff --git a/src/gui/components/dbreducemodelduplicates.h b/src/gui/components/dbreducemodelduplicates.h index 406dbaf3d1..2a96258d59 100644 --- a/src/gui/components/dbreducemodelduplicates.h +++ b/src/gui/components/dbreducemodelduplicates.h @@ -30,7 +30,7 @@ namespace swift::gui::components explicit CDbReduceModelDuplicates(QWidget *parent = nullptr); //! Destructor - virtual ~CDbReduceModelDuplicates() override; + ~CDbReduceModelDuplicates() override; //! Set the models void setModels(const swift::misc::simulation::CAircraftModelList &models, @@ -40,7 +40,7 @@ namespace swift::gui::components void process(); //! \copydoc swift::core::IProgressIndicator::updateProgressIndicator - virtual void updateProgressIndicator(int percentage) override; + void updateProgressIndicator(int percentage) override; //! The models to be removed const swift::misc::simulation::CAircraftModelList &getRemoveCandidates() const { return m_removeCandidates; } diff --git a/src/gui/components/dbstashcomponent.cpp b/src/gui/components/dbstashcomponent.cpp index c1996bf6a4..4876f48de4 100644 --- a/src/gui/components/dbstashcomponent.cpp +++ b/src/gui/components/dbstashcomponent.cpp @@ -80,7 +80,7 @@ namespace swift::gui::components this->onUserChanged(); } - CDbStashComponent::~CDbStashComponent() {} + CDbStashComponent::~CDbStashComponent() = default; CStatusMessage CDbStashComponent::validateStashModel(const CAircraftModel &model, bool allowReplace) const { diff --git a/src/gui/components/dbstashcomponent.h b/src/gui/components/dbstashcomponent.h index d35709b39b..5f88987916 100644 --- a/src/gui/components/dbstashcomponent.h +++ b/src/gui/components/dbstashcomponent.h @@ -69,7 +69,7 @@ namespace swift::gui explicit CDbStashComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CDbStashComponent(); + ~CDbStashComponent() override; //! Test the given model if it can be stashed swift::misc::CStatusMessage validateStashModel(const swift::misc::simulation::CAircraftModel &model, diff --git a/src/gui/components/dbusserveraddressselector.cpp b/src/gui/components/dbusserveraddressselector.cpp index cb85c30a97..81306db579 100644 --- a/src/gui/components/dbusserveraddressselector.cpp +++ b/src/gui/components/dbusserveraddressselector.cpp @@ -39,7 +39,7 @@ namespace swift::gui::components &CDBusServerAddressSelector::editingFinished); } - CDBusServerAddressSelector::~CDBusServerAddressSelector() {} + CDBusServerAddressSelector::~CDBusServerAddressSelector() = default; QString CDBusServerAddressSelector::getP2PAddress() const { diff --git a/src/gui/components/dbusserveraddressselector.h b/src/gui/components/dbusserveraddressselector.h index a484d9e2a9..9d6b35e78a 100644 --- a/src/gui/components/dbusserveraddressselector.h +++ b/src/gui/components/dbusserveraddressselector.h @@ -27,7 +27,7 @@ namespace swift::gui::components explicit CDBusServerAddressSelector(QWidget *parent = nullptr); //! Dtor - virtual ~CDBusServerAddressSelector() override; + ~CDBusServerAddressSelector() override; //! DBus address for P2P or empty QString getP2PAddress() const; diff --git a/src/gui/components/distributorpreferencescomponent.cpp b/src/gui/components/distributorpreferencescomponent.cpp index f9973f4ef9..e45c3ded0a 100644 --- a/src/gui/components/distributorpreferencescomponent.cpp +++ b/src/gui/components/distributorpreferencescomponent.cpp @@ -64,7 +64,7 @@ namespace swift::gui::components this->triggerDeferredSimulatorChange(); } - CDistributorPreferencesComponent::~CDistributorPreferencesComponent() {} + CDistributorPreferencesComponent::~CDistributorPreferencesComponent() = default; void CDistributorPreferencesComponent::onPreferencesChanged() { diff --git a/src/gui/components/distributorpreferencescomponent.h b/src/gui/components/distributorpreferencescomponent.h index 3f5d44975d..3c013b857e 100644 --- a/src/gui/components/distributorpreferencescomponent.h +++ b/src/gui/components/distributorpreferencescomponent.h @@ -36,7 +36,7 @@ namespace swift::gui explicit CDistributorPreferencesComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CDistributorPreferencesComponent(); + ~CDistributorPreferencesComponent() override; private: //! Changed preferences diff --git a/src/gui/components/downloadcomponent.cpp b/src/gui/components/downloadcomponent.cpp index 23fdc7f76f..ea4a7d8e9e 100644 --- a/src/gui/components/downloadcomponent.cpp +++ b/src/gui/components/downloadcomponent.cpp @@ -52,7 +52,7 @@ namespace swift::gui::components connect(ui->pb_Launch, &QPushButton::pressed, this, &CDownloadComponent::startDownloadedExecutable); } - CDownloadComponent::~CDownloadComponent() {} + CDownloadComponent::~CDownloadComponent() = default; bool CDownloadComponent::setDownloadFile(const CRemoteFile &remoteFile) { diff --git a/src/gui/components/downloadcomponent.h b/src/gui/components/downloadcomponent.h index 0fb351d81b..3979e3a545 100644 --- a/src/gui/components/downloadcomponent.h +++ b/src/gui/components/downloadcomponent.h @@ -45,7 +45,7 @@ namespace swift::gui::components explicit CDownloadComponent(QWidget *parent = nullptr); //! Dtor - virtual ~CDownloadComponent(); + ~CDownloadComponent() override; //! Set file to be downloaded bool setDownloadFile(const swift::misc::network::CRemoteFile &remoteFile); diff --git a/src/gui/components/downloaddialog.cpp b/src/gui/components/downloaddialog.cpp index 8807576fbf..bec320e838 100644 --- a/src/gui/components/downloaddialog.cpp +++ b/src/gui/components/downloaddialog.cpp @@ -17,7 +17,7 @@ namespace swift::gui::components this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); } - CDownloadDialog::~CDownloadDialog() {} + CDownloadDialog::~CDownloadDialog() = default; void CDownloadDialog::setDownloadFile(const CRemoteFile &remoteFile) { diff --git a/src/gui/components/downloaddialog.h b/src/gui/components/downloaddialog.h index 64ef971601..e8ff948b6e 100644 --- a/src/gui/components/downloaddialog.h +++ b/src/gui/components/downloaddialog.h @@ -35,7 +35,7 @@ namespace swift::gui::components explicit CDownloadDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CDownloadDialog() override; + ~CDownloadDialog() override; //! \copydoc CDownloadComponent::setDownloadFile void setDownloadFile(const swift::misc::network::CRemoteFile &remoteFile); @@ -54,7 +54,7 @@ namespace swift::gui::components protected: //! \copydoc QDialog::accept - virtual void accept() override; + void accept() override; private: QScopedPointer ui; diff --git a/src/gui/components/firstmodelsetcomponent.cpp b/src/gui/components/firstmodelsetcomponent.cpp index 3deafc38ea..49c54b5378 100644 --- a/src/gui/components/firstmodelsetcomponent.cpp +++ b/src/gui/components/firstmodelsetcomponent.cpp @@ -66,7 +66,7 @@ namespace swift::gui::components connect(ui->pb_CreateModelSet, &QPushButton::clicked, this, &CFirstModelSetComponent::createModelSet); } - CFirstModelSetComponent::~CFirstModelSetComponent() {} + CFirstModelSetComponent::~CFirstModelSetComponent() = default; void CFirstModelSetComponent::onSimulatorChanged(const CSimulatorInfo &simulator) { diff --git a/src/gui/components/firstmodelsetcomponent.h b/src/gui/components/firstmodelsetcomponent.h index 62a3149f3b..f898fc3c3a 100644 --- a/src/gui/components/firstmodelsetcomponent.h +++ b/src/gui/components/firstmodelsetcomponent.h @@ -41,7 +41,7 @@ namespace swift::gui::components explicit CFirstModelSetComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CFirstModelSetComponent(); + ~CFirstModelSetComponent() override; private: QScopedPointer ui; @@ -99,7 +99,7 @@ namespace swift::gui::components void setFirstModelSet(CFirstModelSetComponent *firstModelSet) { m_firstModelSet = firstModelSet; } //! \copydoc QWizardPage::validatePage - virtual bool validatePage() override; + bool validatePage() override; private: CFirstModelSetComponent *m_firstModelSet = nullptr; diff --git a/src/gui/components/firstmodelsetdialog.cpp b/src/gui/components/firstmodelsetdialog.cpp index 79a3c3f921..9ab7d672b4 100644 --- a/src/gui/components/firstmodelsetdialog.cpp +++ b/src/gui/components/firstmodelsetdialog.cpp @@ -13,5 +13,5 @@ namespace swift::gui::components this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); } - CFirstModelSetDialog::~CFirstModelSetDialog() {} + CFirstModelSetDialog::~CFirstModelSetDialog() = default; } // namespace swift::gui::components diff --git a/src/gui/components/firstmodelsetdialog.h b/src/gui/components/firstmodelsetdialog.h index e08ed94f6b..9430d41846 100644 --- a/src/gui/components/firstmodelsetdialog.h +++ b/src/gui/components/firstmodelsetdialog.h @@ -27,7 +27,7 @@ namespace swift::gui::components explicit CFirstModelSetDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CFirstModelSetDialog(); + ~CFirstModelSetDialog() override; private: QScopedPointer ui; diff --git a/src/gui/components/flightplancomponent.cpp b/src/gui/components/flightplancomponent.cpp index 053eedf788..bd5e7ca976 100644 --- a/src/gui/components/flightplancomponent.cpp +++ b/src/gui/components/flightplancomponent.cpp @@ -221,7 +221,7 @@ namespace swift::gui::components }); } - CFlightPlanComponent::~CFlightPlanComponent() {} + CFlightPlanComponent::~CFlightPlanComponent() = default; void CFlightPlanComponent::loginDataSet() { diff --git a/src/gui/components/flightplancomponent.h b/src/gui/components/flightplancomponent.h index 0d77aaa2b1..aa45bc5273 100644 --- a/src/gui/components/flightplancomponent.h +++ b/src/gui/components/flightplancomponent.h @@ -83,7 +83,7 @@ namespace swift::gui::components explicit CFlightPlanComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CFlightPlanComponent() override; + ~CFlightPlanComponent() override; //! Login data were set void loginDataSet(); diff --git a/src/gui/components/hotkeydialog.cpp b/src/gui/components/hotkeydialog.cpp index 02389b3f25..54fb0abf0f 100644 --- a/src/gui/components/hotkeydialog.cpp +++ b/src/gui/components/hotkeydialog.cpp @@ -113,7 +113,7 @@ namespace swift::gui::components initStyleSheet(); } - CHotkeyDialog::~CHotkeyDialog() {} + CHotkeyDialog::~CHotkeyDialog() = default; CKeySelectionBox::CKeySelectionBox(QWidget *parent) : QComboBox(parent) { diff --git a/src/gui/components/hotkeydialog.h b/src/gui/components/hotkeydialog.h index 5f3b719d22..36cb88d7f7 100644 --- a/src/gui/components/hotkeydialog.h +++ b/src/gui/components/hotkeydialog.h @@ -70,7 +70,7 @@ namespace swift::gui::components const swift::misc::CIdentifierList &identifiers, QWidget *parent = nullptr); //! Destructor - virtual ~CHotkeyDialog() override; + ~CHotkeyDialog() override; //! Get hotkey selected by user swift::misc::input::CActionHotkey getSelectedActionHotkey() const { return m_actionHotkey; } @@ -79,7 +79,7 @@ namespace swift::gui::components void initStyleSheet(); //! \copydoc QDialog::accept - virtual void accept() override; + void accept() override; //! Runs the hotkey dialog and returns the result static swift::misc::input::CActionHotkey getActionHotkey(const swift::misc::input::CActionHotkey &initial, diff --git a/src/gui/components/infobarstatuscomponent.cpp b/src/gui/components/infobarstatuscomponent.cpp index 81a957f99a..411b8127ec 100644 --- a/src/gui/components/infobarstatuscomponent.cpp +++ b/src/gui/components/infobarstatuscomponent.cpp @@ -96,7 +96,7 @@ namespace swift::gui::components }); } - CInfoBarStatusComponent::~CInfoBarStatusComponent() {} + CInfoBarStatusComponent::~CInfoBarStatusComponent() = default; void CInfoBarStatusComponent::initLeds() { diff --git a/src/gui/components/infobarstatuscomponent.h b/src/gui/components/infobarstatuscomponent.h index 367f242ef9..6a8aec066d 100644 --- a/src/gui/components/infobarstatuscomponent.h +++ b/src/gui/components/infobarstatuscomponent.h @@ -36,7 +36,7 @@ namespace swift::gui::components explicit CInfoBarStatusComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CInfoBarStatusComponent() override; + ~CInfoBarStatusComponent() override; //! DBus used? void setDBusStatus(bool dbus); @@ -53,7 +53,7 @@ namespace swift::gui::components protected: //! \copydoc QWidget::resizeEvent - virtual void resizeEvent(QResizeEvent *event) override; + void resizeEvent(QResizeEvent *event) override; private: QScopedPointer ui; diff --git a/src/gui/components/infobarwebreadersstatuscomponent.cpp b/src/gui/components/infobarwebreadersstatuscomponent.cpp index 215266123c..3d10a5dbb3 100644 --- a/src/gui/components/infobarwebreadersstatuscomponent.cpp +++ b/src/gui/components/infobarwebreadersstatuscomponent.cpp @@ -165,7 +165,7 @@ namespace swift::gui::components this->init(); } - CInfoBarWebReadersStatusComponent::~CInfoBarWebReadersStatusComponent() {} + CInfoBarWebReadersStatusComponent::~CInfoBarWebReadersStatusComponent() = default; void CInfoBarWebReadersStatusComponent::showConsolidationStatus(bool show) { diff --git a/src/gui/components/infobarwebreadersstatuscomponent.h b/src/gui/components/infobarwebreadersstatuscomponent.h index 1d429599ba..17daedaa7f 100644 --- a/src/gui/components/infobarwebreadersstatuscomponent.h +++ b/src/gui/components/infobarwebreadersstatuscomponent.h @@ -33,7 +33,7 @@ namespace swift::gui public: //! Destructor - virtual ~CInfoBarWebReadersStatusBase(); + ~CInfoBarWebReadersStatusBase() override; //! Consolidation is running virtual void consolidationRunning(bool running); @@ -99,10 +99,10 @@ namespace swift::gui explicit CInfoBarWebReadersStatusComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CInfoBarWebReadersStatusComponent() override; + ~CInfoBarWebReadersStatusComponent() override; //! Show the consolidation status - virtual void showConsolidationStatus(bool show) override; + void showConsolidationStatus(bool show) override; private: QScopedPointer ui; diff --git a/src/gui/components/infobarwebreadersstatussmallcomponent.cpp b/src/gui/components/infobarwebreadersstatussmallcomponent.cpp index 384c2a847b..afcb3a69d3 100644 --- a/src/gui/components/infobarwebreadersstatussmallcomponent.cpp +++ b/src/gui/components/infobarwebreadersstatussmallcomponent.cpp @@ -16,5 +16,5 @@ namespace swift::gui::components this->init(); } - CInfoBarWebReadersStatusSmallComponent::~CInfoBarWebReadersStatusSmallComponent() {} + CInfoBarWebReadersStatusSmallComponent::~CInfoBarWebReadersStatusSmallComponent() = default; } // namespace swift::gui::components diff --git a/src/gui/components/infobarwebreadersstatussmallcomponent.h b/src/gui/components/infobarwebreadersstatussmallcomponent.h index 13a37dbc89..d5d63d09b4 100644 --- a/src/gui/components/infobarwebreadersstatussmallcomponent.h +++ b/src/gui/components/infobarwebreadersstatussmallcomponent.h @@ -28,7 +28,7 @@ namespace swift::gui::components explicit CInfoBarWebReadersStatusSmallComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CInfoBarWebReadersStatusSmallComponent() override; + ~CInfoBarWebReadersStatusSmallComponent() override; private: QScopedPointer ui; diff --git a/src/gui/components/initialdataloadcomponent.cpp b/src/gui/components/initialdataloadcomponent.cpp index b10c3eff1d..2fc7316e7e 100644 --- a/src/gui/components/initialdataloadcomponent.cpp +++ b/src/gui/components/initialdataloadcomponent.cpp @@ -14,7 +14,7 @@ namespace swift::gui::components ui->comp_DataUpdates->showVisibleLoadAllButtons(true, false, true); } - CInitialDataLoadComponent::~CInitialDataLoadComponent() {} + CInitialDataLoadComponent::~CInitialDataLoadComponent() = default; void CInitialDataLoadComponent::loadAllFromShared() { ui->comp_DataUpdates->loadAllFromShared(); } diff --git a/src/gui/components/initialdataloadcomponent.h b/src/gui/components/initialdataloadcomponent.h index 239e938c53..297d0a672a 100644 --- a/src/gui/components/initialdataloadcomponent.h +++ b/src/gui/components/initialdataloadcomponent.h @@ -29,7 +29,7 @@ namespace swift::gui::components explicit CInitialDataLoadComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CInitialDataLoadComponent(); + ~CInitialDataLoadComponent() override; //! \copydoc swift::gui::components::CDbLoadOverviewComponent::loadAllFromShared void loadAllFromShared(); @@ -59,10 +59,10 @@ namespace swift::gui::components void setConfigComponent(CInitialDataLoadComponent *config) { m_config = config; } //! \copydoc QWizardPage::initializePage - virtual void initializePage() override; + void initializePage() override; //! \copydoc QWizardPage::validatePage - virtual bool validatePage() override; + bool validatePage() override; private: CInitialDataLoadComponent *m_config = nullptr; diff --git a/src/gui/components/installfsxterrainprobecomponent.cpp b/src/gui/components/installfsxterrainprobecomponent.cpp index 5de2af1ea4..872311f776 100644 --- a/src/gui/components/installfsxterrainprobecomponent.cpp +++ b/src/gui/components/installfsxterrainprobecomponent.cpp @@ -47,7 +47,7 @@ namespace swift::gui::components }); } - CInstallFsxTerrainProbeComponent::~CInstallFsxTerrainProbeComponent() {} + CInstallFsxTerrainProbeComponent::~CInstallFsxTerrainProbeComponent() = default; void CInstallFsxTerrainProbeComponent::copyProbe() { diff --git a/src/gui/components/installfsxterrainprobecomponent.h b/src/gui/components/installfsxterrainprobecomponent.h index 5a38ccad37..749f17c2d3 100644 --- a/src/gui/components/installfsxterrainprobecomponent.h +++ b/src/gui/components/installfsxterrainprobecomponent.h @@ -27,7 +27,7 @@ namespace swift::gui::components explicit CInstallFsxTerrainProbeComponent(QWidget *parent = nullptr); //! Destructors - virtual ~CInstallFsxTerrainProbeComponent(); + ~CInstallFsxTerrainProbeComponent() override; private: QScopedPointer ui; diff --git a/src/gui/components/installsimulatorspecificwizardpage.h b/src/gui/components/installsimulatorspecificwizardpage.h index 254f49bda9..c6b5cf9fe5 100644 --- a/src/gui/components/installsimulatorspecificwizardpage.h +++ b/src/gui/components/installsimulatorspecificwizardpage.h @@ -34,7 +34,7 @@ namespace swift::gui::components } //! \copydoc QWizardPage::validatePage - virtual bool validatePage() override { return true; } + bool validatePage() override { return true; } private: CInstallXSwiftBusComponent *m_xSwiftBusConfig = nullptr; diff --git a/src/gui/components/installxswiftbuscomponent.cpp b/src/gui/components/installxswiftbuscomponent.cpp index 40e9c33445..c6701a0d60 100644 --- a/src/gui/components/installxswiftbuscomponent.cpp +++ b/src/gui/components/installxswiftbuscomponent.cpp @@ -55,7 +55,7 @@ namespace swift::gui::components this->updatesChanged(); } - CInstallXSwiftBusComponent::~CInstallXSwiftBusComponent() {} + CInstallXSwiftBusComponent::~CInstallXSwiftBusComponent() = default; void CInstallXSwiftBusComponent::setDefaultDownloadName(const QString &defaultDownload) { diff --git a/src/gui/components/installxswiftbuscomponent.h b/src/gui/components/installxswiftbuscomponent.h index 33b563c537..273ce5f6c0 100644 --- a/src/gui/components/installxswiftbuscomponent.h +++ b/src/gui/components/installxswiftbuscomponent.h @@ -37,7 +37,7 @@ namespace swift::gui::components explicit CInstallXSwiftBusComponent(QWidget *parent = nullptr); //! Dtor - virtual ~CInstallXSwiftBusComponent(); + ~CInstallXSwiftBusComponent() override; //! Set a default name for download void setDefaultDownloadName(const QString &defaultDownload); @@ -120,7 +120,7 @@ namespace swift::gui::components void setConfigComponent(CInstallXSwiftBusComponent *config) { m_config = config; } //! \copydoc QWizardPage::validatePage - virtual bool validatePage() override; + bool validatePage() override; private: CInstallXSwiftBusComponent *m_config = nullptr; diff --git a/src/gui/components/installxswiftbusdialog.cpp b/src/gui/components/installxswiftbusdialog.cpp index 12c0e0374b..06e18ab8fe 100644 --- a/src/gui/components/installxswiftbusdialog.cpp +++ b/src/gui/components/installxswiftbusdialog.cpp @@ -13,7 +13,7 @@ namespace swift::gui::components ui->setupUi(this); } - CInstallXSwiftBusDialog::~CInstallXSwiftBusDialog() {} + CInstallXSwiftBusDialog::~CInstallXSwiftBusDialog() = default; void CInstallXSwiftBusDialog::setDefaultDownloadName(const QString &defaultName) { diff --git a/src/gui/components/installxswiftbusdialog.h b/src/gui/components/installxswiftbusdialog.h index c6fc11c289..eff08e3ec1 100644 --- a/src/gui/components/installxswiftbusdialog.h +++ b/src/gui/components/installxswiftbusdialog.h @@ -27,7 +27,7 @@ namespace swift::gui::components explicit CInstallXSwiftBusDialog(QWidget *parent = nullptr); //! Dtor - virtual ~CInstallXSwiftBusDialog() override; + ~CInstallXSwiftBusDialog() override; //! \copydoc CInstallXSwiftBusComponent::setDefaultDownloadName void setDefaultDownloadName(const QString &defaultName); diff --git a/src/gui/components/internalscomponent.cpp b/src/gui/components/internalscomponent.cpp index 503a27d433..31afa88573 100644 --- a/src/gui/components/internalscomponent.cpp +++ b/src/gui/components/internalscomponent.cpp @@ -95,7 +95,7 @@ namespace swift::gui::components this->contextFlagsToGui(); } - CInternalsComponent::~CInternalsComponent() {} + CInternalsComponent::~CInternalsComponent() = default; void CInternalsComponent::showEvent(QShowEvent *event) { diff --git a/src/gui/components/internalscomponent.h b/src/gui/components/internalscomponent.h index 5aaf1b4269..3174b28f37 100644 --- a/src/gui/components/internalscomponent.h +++ b/src/gui/components/internalscomponent.h @@ -31,11 +31,11 @@ namespace swift::gui::components explicit CInternalsComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CInternalsComponent() override; + ~CInternalsComponent() override; protected: //! \copydoc QWidget::showEvent - virtual void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent *event) override; private: //! Enable / disable debugging diff --git a/src/gui/components/interpolationcomponent.cpp b/src/gui/components/interpolationcomponent.cpp index 27a06c384d..c139f3367e 100644 --- a/src/gui/components/interpolationcomponent.cpp +++ b/src/gui/components/interpolationcomponent.cpp @@ -27,7 +27,7 @@ namespace swift::gui::components &CInterpolationComponent::displayInterpolationMessages); } - CInterpolationComponent::~CInterpolationComponent() {} + CInterpolationComponent::~CInterpolationComponent() = default; void CInterpolationComponent::displayInterpolationMessages() { diff --git a/src/gui/components/interpolationcomponent.h b/src/gui/components/interpolationcomponent.h index f10e8348a0..9e829fc783 100644 --- a/src/gui/components/interpolationcomponent.h +++ b/src/gui/components/interpolationcomponent.h @@ -27,7 +27,7 @@ namespace swift::gui::components explicit CInterpolationComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CInterpolationComponent() override; + ~CInterpolationComponent() override; private: QScopedPointer ui; diff --git a/src/gui/components/interpolationlogdisplay.cpp b/src/gui/components/interpolationlogdisplay.cpp index 6d7bc1a2e6..c08c9a01c3 100644 --- a/src/gui/components/interpolationlogdisplay.cpp +++ b/src/gui/components/interpolationlogdisplay.cpp @@ -98,10 +98,7 @@ namespace swift::gui::components Qt::QueuedConnection); } - CInterpolationLogDisplay::~CInterpolationLogDisplay() - { - // void - } + CInterpolationLogDisplay::~CInterpolationLogDisplay() = default; void CInterpolationLogDisplay::setSimulator(ISimulator *simulator) { diff --git a/src/gui/components/interpolationlogdisplay.h b/src/gui/components/interpolationlogdisplay.h index 1e0b225e1a..62b60fe6f8 100644 --- a/src/gui/components/interpolationlogdisplay.h +++ b/src/gui/components/interpolationlogdisplay.h @@ -57,7 +57,7 @@ namespace swift::gui::components explicit CInterpolationLogDisplay(QWidget *parent = nullptr); //! Destructor - virtual ~CInterpolationLogDisplay() override; + ~CInterpolationLogDisplay() override; //! Set simulator void setSimulator(swift::core::ISimulator *simulator); diff --git a/src/gui/components/interpolationlogdisplaydialog.h b/src/gui/components/interpolationlogdisplaydialog.h index 42c1e62e65..e0815f1791 100644 --- a/src/gui/components/interpolationlogdisplaydialog.h +++ b/src/gui/components/interpolationlogdisplaydialog.h @@ -36,7 +36,7 @@ namespace swift::gui::components QWidget *parent = nullptr); //! Destructor - virtual ~CInterpolationLogDisplayDialog() override; + ~CInterpolationLogDisplayDialog() override; //! Set simulator void setSimulator(swift::core::ISimulator *simulator); diff --git a/src/gui/components/interpolationsetupcomponent.cpp b/src/gui/components/interpolationsetupcomponent.cpp index 7769189b82..4b3adba964 100644 --- a/src/gui/components/interpolationsetupcomponent.cpp +++ b/src/gui/components/interpolationsetupcomponent.cpp @@ -64,7 +64,7 @@ namespace swift::gui::components }); } - CInterpolationSetupComponent::~CInterpolationSetupComponent() {} + CInterpolationSetupComponent::~CInterpolationSetupComponent() = default; CInterpolationSetupComponent::Mode CInterpolationSetupComponent::getSetupMode() const { diff --git a/src/gui/components/interpolationsetupcomponent.h b/src/gui/components/interpolationsetupcomponent.h index 9fba889356..3b95a41691 100644 --- a/src/gui/components/interpolationsetupcomponent.h +++ b/src/gui/components/interpolationsetupcomponent.h @@ -36,7 +36,7 @@ namespace swift::gui::components explicit CInterpolationSetupComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CInterpolationSetupComponent() override; + ~CInterpolationSetupComponent() override; //! Setup mode Mode getSetupMode() const; diff --git a/src/gui/components/legalinfocomponent.cpp b/src/gui/components/legalinfocomponent.cpp index ba192201b1..863b6820ce 100644 --- a/src/gui/components/legalinfocomponent.cpp +++ b/src/gui/components/legalinfocomponent.cpp @@ -34,7 +34,7 @@ namespace swift::gui::components connect(ui->cb_CrashDumps, &QCheckBox::toggled, this, &CLegalInfoComponent::onAllowCrashDumps); } - CLegalInfoComponent::~CLegalInfoComponent() {} + CLegalInfoComponent::~CLegalInfoComponent() = default; bool CLegalInfoComponent::isAgreedTo() const { return ui->cb_Agree->isChecked(); } diff --git a/src/gui/components/legalinfocomponent.h b/src/gui/components/legalinfocomponent.h index 5e099199f8..706c618ac9 100644 --- a/src/gui/components/legalinfocomponent.h +++ b/src/gui/components/legalinfocomponent.h @@ -31,7 +31,7 @@ namespace swift::gui::components explicit CLegalInfoComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CLegalInfoComponent(); + ~CLegalInfoComponent() override; //! Agreed with? bool isAgreedTo() const; @@ -65,7 +65,7 @@ namespace swift::gui::components void setConfigComponent(CLegalInfoComponent *config) { m_legalInfo = config; } //! \copydoc QWizardPage::validatePage - virtual bool validatePage() override; + bool validatePage() override; private: CLegalInfoComponent *m_legalInfo = nullptr; diff --git a/src/gui/components/logcomponent.cpp b/src/gui/components/logcomponent.cpp index 24d69545a3..101b74a7e5 100644 --- a/src/gui/components/logcomponent.cpp +++ b/src/gui/components/logcomponent.cpp @@ -62,7 +62,7 @@ namespace swift::gui::components m_history.initialize(sApp->getDataLinkDBus()); } - CLogComponent::~CLogComponent() {} + CLogComponent::~CLogComponent() = default; void CLogComponent::displayLog(bool attention) { diff --git a/src/gui/components/logcomponent.h b/src/gui/components/logcomponent.h index a91b617c45..70406ca94f 100644 --- a/src/gui/components/logcomponent.h +++ b/src/gui/components/logcomponent.h @@ -50,7 +50,7 @@ namespace swift::gui::components explicit CLogComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CLogComponent(); + ~CLogComponent() override; //! Display log void displayLog(bool attention = false); diff --git a/src/gui/components/logincomponent.cpp b/src/gui/components/logincomponent.cpp index 8a083a58c6..0daf2baf4f 100644 --- a/src/gui/components/logincomponent.cpp +++ b/src/gui/components/logincomponent.cpp @@ -134,7 +134,7 @@ namespace swift::gui::components }); } - CLoginComponent::~CLoginComponent() {} + CLoginComponent::~CLoginComponent() = default; void CLoginComponent::mainInfoAreaChanged(const QWidget *currentWidget) { diff --git a/src/gui/components/logincomponent.h b/src/gui/components/logincomponent.h index d432dd3acf..e798f22379 100644 --- a/src/gui/components/logincomponent.h +++ b/src/gui/components/logincomponent.h @@ -63,7 +63,7 @@ namespace swift::gui::components explicit CLoginComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CLoginComponent() override; + ~CLoginComponent() override; //! Automatically popup void setAutoPopupWizad(bool autoPopup); diff --git a/src/gui/components/maininfoareacomponent.cpp b/src/gui/components/maininfoareacomponent.cpp index e07abca16e..84ac64b92e 100644 --- a/src/gui/components/maininfoareacomponent.cpp +++ b/src/gui/components/maininfoareacomponent.cpp @@ -27,7 +27,7 @@ namespace swift::gui::components connect(this->getLogComponent(), &CLogComponent::requestAttention, this, &CMainInfoAreaComponent::selectLog); } - CMainInfoAreaComponent::~CMainInfoAreaComponent() {} + CMainInfoAreaComponent::~CMainInfoAreaComponent() = default; CAtcStationComponent *CMainInfoAreaComponent::getAtcStationComponent() { return ui->comp_AtcStations; } diff --git a/src/gui/components/maininfoareacomponent.h b/src/gui/components/maininfoareacomponent.h index 703fbafe8d..b4b577d8da 100644 --- a/src/gui/components/maininfoareacomponent.h +++ b/src/gui/components/maininfoareacomponent.h @@ -46,7 +46,7 @@ namespace swift::gui::components explicit CMainInfoAreaComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CMainInfoAreaComponent() override; + ~CMainInfoAreaComponent() override; //! Info areas enum InfoArea @@ -123,8 +123,8 @@ namespace swift::gui::components protected: // CInfoArea overrides - virtual QSize getPreferredSizeWhenFloating(int areaIndex) const override; - virtual const QPixmap &indexToPixmap(int areaIndex) const override; + QSize getPreferredSizeWhenFloating(int areaIndex) const override; + const QPixmap &indexToPixmap(int areaIndex) const override; private: QScopedPointer ui; diff --git a/src/gui/components/mainkeypadareacomponent.cpp b/src/gui/components/mainkeypadareacomponent.cpp index 54573393c1..3480d389f6 100644 --- a/src/gui/components/mainkeypadareacomponent.cpp +++ b/src/gui/components/mainkeypadareacomponent.cpp @@ -79,7 +79,7 @@ namespace swift::gui::components }); } - CMainKeypadAreaComponent::~CMainKeypadAreaComponent() {} + CMainKeypadAreaComponent::~CMainKeypadAreaComponent() = default; void CMainKeypadAreaComponent::onMainInfoAreaChanged(int currentTabIndex, const QList &dockedIndexes, const QList &floatingIndexes) diff --git a/src/gui/components/mainkeypadareacomponent.h b/src/gui/components/mainkeypadareacomponent.h index 93aaa89861..d7f95bdc66 100644 --- a/src/gui/components/mainkeypadareacomponent.h +++ b/src/gui/components/mainkeypadareacomponent.h @@ -40,7 +40,7 @@ namespace swift::gui::components explicit CMainKeypadAreaComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CMainKeypadAreaComponent() override; + ~CMainKeypadAreaComponent() override; //! Main info area changed void onMainInfoAreaChanged(int currentTabIndex, const QList &dockedIndexes, diff --git a/src/gui/components/mappingcomponent.cpp b/src/gui/components/mappingcomponent.cpp index 6fc561cc83..ab20b2108a 100644 --- a/src/gui/components/mappingcomponent.cpp +++ b/src/gui/components/mappingcomponent.cpp @@ -178,7 +178,7 @@ namespace swift::gui::components }); } - CMappingComponent::~CMappingComponent() {} + CMappingComponent::~CMappingComponent() = default; int CMappingComponent::countCurrentMappings() const { diff --git a/src/gui/components/mappingcomponent.h b/src/gui/components/mappingcomponent.h index 8e6a901bec..f5ca6f1a3c 100644 --- a/src/gui/components/mappingcomponent.h +++ b/src/gui/components/mappingcomponent.h @@ -79,7 +79,7 @@ namespace swift::gui explicit CMappingComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CMappingComponent() override; + ~CMappingComponent() override; //! Number of current mappings int countCurrentMappings() const; diff --git a/src/gui/components/marginsinput.cpp b/src/gui/components/marginsinput.cpp index 0b6f2f91b0..8a9c298d2c 100644 --- a/src/gui/components/marginsinput.cpp +++ b/src/gui/components/marginsinput.cpp @@ -28,7 +28,7 @@ namespace swift::gui::components this->setMargins(QMargins()); } - CMarginsInput::~CMarginsInput() {} + CMarginsInput::~CMarginsInput() = default; void CMarginsInput::setMargins(const QMargins &margins) { diff --git a/src/gui/components/marginsinput.h b/src/gui/components/marginsinput.h index 9cc7766ae1..6d736e960d 100644 --- a/src/gui/components/marginsinput.h +++ b/src/gui/components/marginsinput.h @@ -29,7 +29,7 @@ namespace swift::gui::components explicit CMarginsInput(QWidget *parent = nullptr); //! Destructor - virtual ~CMarginsInput() override; + ~CMarginsInput() override; //! Set margins void setMargins(const QMargins &margins); diff --git a/src/gui/components/matchingstatisticscomponent.cpp b/src/gui/components/matchingstatisticscomponent.cpp index 91f59d13fd..73fd2c1079 100644 --- a/src/gui/components/matchingstatisticscomponent.cpp +++ b/src/gui/components/matchingstatisticscomponent.cpp @@ -25,7 +25,7 @@ namespace swift::gui::components &CMatchingStatisticsComponent::onGenerateClicked); } - CMatchingStatisticsComponent::~CMatchingStatisticsComponent() {} + CMatchingStatisticsComponent::~CMatchingStatisticsComponent() = default; void CMatchingStatisticsComponent::onGenerateClicked() { diff --git a/src/gui/components/matchingstatisticscomponent.h b/src/gui/components/matchingstatisticscomponent.h index af8a0e3adb..2a6b446a9b 100644 --- a/src/gui/components/matchingstatisticscomponent.h +++ b/src/gui/components/matchingstatisticscomponent.h @@ -27,7 +27,7 @@ namespace swift::gui::components explicit CMatchingStatisticsComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CMatchingStatisticsComponent(); + ~CMatchingStatisticsComponent() override; private: //! Show statistics diff --git a/src/gui/components/modelbrowsercomponent.cpp b/src/gui/components/modelbrowsercomponent.cpp index b26841131f..cc78d4dd65 100644 --- a/src/gui/components/modelbrowsercomponent.cpp +++ b/src/gui/components/modelbrowsercomponent.cpp @@ -56,10 +56,7 @@ namespace swift::gui::components this->onSetRelativePosition(); } - CModelBrowserComponent::~CModelBrowserComponent() - { - // void - } + CModelBrowserComponent::~CModelBrowserComponent() = default; void CModelBrowserComponent::close() { this->remove(); } diff --git a/src/gui/components/modelbrowsercomponent.h b/src/gui/components/modelbrowsercomponent.h index d938812d7e..38e5aaaedb 100644 --- a/src/gui/components/modelbrowsercomponent.h +++ b/src/gui/components/modelbrowsercomponent.h @@ -29,7 +29,7 @@ namespace swift::gui::components explicit CModelBrowserComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CModelBrowserComponent() override; + ~CModelBrowserComponent() override; //! Browser has been closed void close(); diff --git a/src/gui/components/modelbrowserdialog.cpp b/src/gui/components/modelbrowserdialog.cpp index afea73f836..f624d3003b 100644 --- a/src/gui/components/modelbrowserdialog.cpp +++ b/src/gui/components/modelbrowserdialog.cpp @@ -14,10 +14,7 @@ namespace swift::gui::components ui->setupUi(this); } - CModelBrowserDialog::~CModelBrowserDialog() - { - // void; - } + CModelBrowserDialog::~CModelBrowserDialog() = default; void CModelBrowserDialog::done(int r) { diff --git a/src/gui/components/modelbrowserdialog.h b/src/gui/components/modelbrowserdialog.h index 0d4b0f0dd8..4f2b089be3 100644 --- a/src/gui/components/modelbrowserdialog.h +++ b/src/gui/components/modelbrowserdialog.h @@ -27,10 +27,10 @@ namespace swift::gui::components explicit CModelBrowserDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CModelBrowserDialog() override; + ~CModelBrowserDialog() override; //! \copydoc QDialog::closeEvent - virtual void done(int r) override; + void done(int r) override; private: QScopedPointer ui; diff --git a/src/gui/components/modelconverterxsetupcomponent.cpp b/src/gui/components/modelconverterxsetupcomponent.cpp index 69d348dd16..0cb513f8dd 100644 --- a/src/gui/components/modelconverterxsetupcomponent.cpp +++ b/src/gui/components/modelconverterxsetupcomponent.cpp @@ -23,7 +23,7 @@ namespace swift::gui::components ui->le_McxBinary->setText(m_setting.get()); } - CModelConverterXSetupComponent::~CModelConverterXSetupComponent() {} + CModelConverterXSetupComponent::~CModelConverterXSetupComponent() = default; void CModelConverterXSetupComponent::selectBinary() { diff --git a/src/gui/components/modelconverterxsetupcomponent.h b/src/gui/components/modelconverterxsetupcomponent.h index c2dba3c2c1..408fc2d162 100644 --- a/src/gui/components/modelconverterxsetupcomponent.h +++ b/src/gui/components/modelconverterxsetupcomponent.h @@ -28,7 +28,7 @@ namespace swift::gui::components explicit CModelConverterXSetupComponent(QWidget *parent = nullptr); //! Dtor - virtual ~CModelConverterXSetupComponent(); + ~CModelConverterXSetupComponent() override; private: //! File dialog diff --git a/src/gui/components/modelmatchercomponent.cpp b/src/gui/components/modelmatchercomponent.cpp index 0e1c443d1f..7528e379be 100644 --- a/src/gui/components/modelmatchercomponent.cpp +++ b/src/gui/components/modelmatchercomponent.cpp @@ -85,7 +85,7 @@ namespace swift::gui::components ui->cb_UseWorkbench->setVisible(false); } - CModelMatcherComponent::~CModelMatcherComponent() {} + CModelMatcherComponent::~CModelMatcherComponent() = default; void CModelMatcherComponent::tabIndexChanged(int index) { diff --git a/src/gui/components/modelmatchercomponent.h b/src/gui/components/modelmatchercomponent.h index d2d000b821..1d754a2e1e 100644 --- a/src/gui/components/modelmatchercomponent.h +++ b/src/gui/components/modelmatchercomponent.h @@ -46,7 +46,7 @@ namespace swift::gui explicit CModelMatcherComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CModelMatcherComponent() override; + ~CModelMatcherComponent() override; //! Tab (where this component is embedded) has been changed void tabIndexChanged(int index); diff --git a/src/gui/components/modelmatcherlogcomponent.cpp b/src/gui/components/modelmatcherlogcomponent.cpp index 30374f5266..59793a2b1d 100644 --- a/src/gui/components/modelmatcherlogcomponent.cpp +++ b/src/gui/components/modelmatcherlogcomponent.cpp @@ -31,7 +31,7 @@ namespace swift::gui::components &CModelMatcherLogComponent::callsignEntered); } - CModelMatcherLogComponent::~CModelMatcherLogComponent() {} + CModelMatcherLogComponent::~CModelMatcherLogComponent() = default; bool CModelMatcherLogComponent::hasContexts() const { diff --git a/src/gui/components/modelmatcherlogcomponent.h b/src/gui/components/modelmatcherlogcomponent.h index 86375840d7..8d5a45c0c4 100644 --- a/src/gui/components/modelmatcherlogcomponent.h +++ b/src/gui/components/modelmatcherlogcomponent.h @@ -29,7 +29,7 @@ namespace swift::gui::components explicit CModelMatcherLogComponent(QWidget *parent = nullptr); //! Constructor - virtual ~CModelMatcherLogComponent() override; + ~CModelMatcherLogComponent() override; private: QScopedPointer ui; diff --git a/src/gui/components/modelmatcherlogenable.cpp b/src/gui/components/modelmatcherlogenable.cpp index e5c51d49fd..50c1e53636 100644 --- a/src/gui/components/modelmatcherlogenable.cpp +++ b/src/gui/components/modelmatcherlogenable.cpp @@ -46,7 +46,7 @@ namespace swift::gui::components }); } - CModelMatcherLogEnable::~CModelMatcherLogEnable() {} + CModelMatcherLogEnable::~CModelMatcherLogEnable() = default; bool CModelMatcherLogEnable::isReverseLookupLogEnabled() const { return ui->cb_LogReverseLookup->isChecked(); } diff --git a/src/gui/components/modelmatcherlogenable.h b/src/gui/components/modelmatcherlogenable.h index d531a3ec3b..cb650ff5f6 100644 --- a/src/gui/components/modelmatcherlogenable.h +++ b/src/gui/components/modelmatcherlogenable.h @@ -27,7 +27,7 @@ namespace swift::gui::components explicit CModelMatcherLogEnable(QWidget *parent = nullptr); //! Destructor - virtual ~CModelMatcherLogEnable() override; + ~CModelMatcherLogEnable() override; //! Reverse lookup enabled? bool isReverseLookupLogEnabled() const; diff --git a/src/gui/components/modelmodeselector.cpp b/src/gui/components/modelmodeselector.cpp index 11593ddb76..a78636ad09 100644 --- a/src/gui/components/modelmodeselector.cpp +++ b/src/gui/components/modelmodeselector.cpp @@ -17,10 +17,7 @@ namespace swift::gui::components connect(ui->rb_Include, &QRadioButton::released, this, &CModelModeSelector::changed); } - CModelModeSelector::~CModelModeSelector() - { - // void - } + CModelModeSelector::~CModelModeSelector() = default; swift::misc::simulation::CAircraftModel::ModelMode CModelModeSelector::getMode() const { diff --git a/src/gui/components/modelmodeselector.h b/src/gui/components/modelmodeselector.h index c76e2f79d6..82fe7b9e38 100644 --- a/src/gui/components/modelmodeselector.h +++ b/src/gui/components/modelmodeselector.h @@ -34,7 +34,7 @@ namespace swift::gui::components explicit CModelModeSelector(QWidget *parent = nullptr); //! Destructor - ~CModelModeSelector(); + ~CModelModeSelector() override; //! Get mode swift::misc::simulation::CAircraftModel::ModelMode getMode() const; diff --git a/src/gui/components/navigatordialog.cpp b/src/gui/components/navigatordialog.cpp index ff0825442b..582ecd3d92 100644 --- a/src/gui/components/navigatordialog.cpp +++ b/src/gui/components/navigatordialog.cpp @@ -73,7 +73,7 @@ namespace swift::gui::components this->onStyleSheetsChanged(); } - CNavigatorDialog::~CNavigatorDialog() {} + CNavigatorDialog::~CNavigatorDialog() = default; void CNavigatorDialog::buildNavigator(int columns) { diff --git a/src/gui/components/navigatordialog.h b/src/gui/components/navigatordialog.h index 5bda7780e3..bcb47b3ade 100644 --- a/src/gui/components/navigatordialog.h +++ b/src/gui/components/navigatordialog.h @@ -43,13 +43,13 @@ namespace swift::gui::components CNavigatorDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CNavigatorDialog() override; + ~CNavigatorDialog() override; //! Navigator void buildNavigator(int columns); //! Called when dialog is closed - virtual void reject() override; + void reject() override; //! Toggle frameless mode void toggleFrameless(); @@ -78,25 +78,25 @@ namespace swift::gui::components //! @{ //! \copydoc QDialog::mouseMoveEvent - virtual void mouseMoveEvent(QMouseEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; //! \copydoc QDialog::mousePressEvent - virtual void mousePressEvent(QMouseEvent *event) override; + void mousePressEvent(QMouseEvent *event) override; //! \copydoc QDialog::mouseReleaseEvent - virtual void mouseReleaseEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; //! \copydoc QDialog::changeEvent - virtual void changeEvent(QEvent *evt) override; + void changeEvent(QEvent *evt) override; //! \copydoc CEnableForFramelessWindow::windowFlagsChanged - virtual void windowFlagsChanged() override; + void windowFlagsChanged() override; //! \copydoc QDialog::paintEvent - virtual void paintEvent(QPaintEvent *event) override; + void paintEvent(QPaintEvent *event) override; //! \copydoc QDialog::enterEvent - virtual void enterEvent(QEnterEvent *event) override; + void enterEvent(QEnterEvent *event) override; //! @} private: diff --git a/src/gui/components/networkaircraftvaluescomponent.cpp b/src/gui/components/networkaircraftvaluescomponent.cpp index 2cea3a5391..27e27be339 100644 --- a/src/gui/components/networkaircraftvaluescomponent.cpp +++ b/src/gui/components/networkaircraftvaluescomponent.cpp @@ -19,10 +19,7 @@ namespace swift::gui::components ui->setupUi(this); } - CNetworkAircraftValuesComponent::~CNetworkAircraftValuesComponent() - { - // void - } + CNetworkAircraftValuesComponent::~CNetworkAircraftValuesComponent() = default; void CNetworkAircraftValuesComponent::showValues() { diff --git a/src/gui/components/networkaircraftvaluescomponent.h b/src/gui/components/networkaircraftvaluescomponent.h index 8c9f5430db..a8e7a43566 100644 --- a/src/gui/components/networkaircraftvaluescomponent.h +++ b/src/gui/components/networkaircraftvaluescomponent.h @@ -25,7 +25,7 @@ namespace swift::gui::components explicit CNetworkAircraftValuesComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CNetworkAircraftValuesComponent() override; + ~CNetworkAircraftValuesComponent() override; //! Show the current values void showValues(); diff --git a/src/gui/components/networkdetailscomponent.cpp b/src/gui/components/networkdetailscomponent.cpp index f564da719c..c94d687ef0 100644 --- a/src/gui/components/networkdetailscomponent.cpp +++ b/src/gui/components/networkdetailscomponent.cpp @@ -63,7 +63,7 @@ namespace swift::gui::components this->onWebServiceDataRead(CEntityFlags::VatsimDataFile, CEntityFlags::ReadFinished, -1, {}); } - CNetworkDetailsComponent::~CNetworkDetailsComponent() {} + CNetworkDetailsComponent::~CNetworkDetailsComponent() = default; CLoginMode CNetworkDetailsComponent::getLoginMode() const { diff --git a/src/gui/components/networkdetailscomponent.h b/src/gui/components/networkdetailscomponent.h index 2ebd8b3d99..c3f71186ad 100644 --- a/src/gui/components/networkdetailscomponent.h +++ b/src/gui/components/networkdetailscomponent.h @@ -37,7 +37,7 @@ namespace swift::gui::components explicit CNetworkDetailsComponent(QWidget *parent = nullptr); //! Dtor - virtual ~CNetworkDetailsComponent() override; + ~CNetworkDetailsComponent() override; //! Login mode swift::misc::network::CLoginMode getLoginMode() const; diff --git a/src/gui/components/otherswiftversionscomponent.cpp b/src/gui/components/otherswiftversionscomponent.cpp index aac00a3e7e..009caa15d3 100644 --- a/src/gui/components/otherswiftversionscomponent.cpp +++ b/src/gui/components/otherswiftversionscomponent.cpp @@ -36,7 +36,7 @@ namespace swift::gui::components &COtherSwiftVersionsComponent::reloadOtherVersions); } - COtherSwiftVersionsComponent::~COtherSwiftVersionsComponent() {} + COtherSwiftVersionsComponent::~COtherSwiftVersionsComponent() = default; bool COtherSwiftVersionsComponent::hasSelection() const { return (ui->tvp_ApplicationInfo->hasSelection()); } diff --git a/src/gui/components/otherswiftversionscomponent.h b/src/gui/components/otherswiftversionscomponent.h index f59c6903ed..2019c995b1 100644 --- a/src/gui/components/otherswiftversionscomponent.h +++ b/src/gui/components/otherswiftversionscomponent.h @@ -29,7 +29,7 @@ namespace swift::gui::components explicit COtherSwiftVersionsComponent(QWidget *parent = nullptr); //! Destructor - virtual ~COtherSwiftVersionsComponent(); + ~COtherSwiftVersionsComponent() override; //! Any version selected? bool hasSelection() const; diff --git a/src/gui/components/otherswiftversionsdialog.cpp b/src/gui/components/otherswiftversionsdialog.cpp index cd46e4a7c9..c2f3893166 100644 --- a/src/gui/components/otherswiftversionsdialog.cpp +++ b/src/gui/components/otherswiftversionsdialog.cpp @@ -13,5 +13,5 @@ namespace swift::gui::components ui->setupUi(this); } - COtherSwiftVersionsDialog::~COtherSwiftVersionsDialog() {} + COtherSwiftVersionsDialog::~COtherSwiftVersionsDialog() = default; } // namespace swift::gui::components diff --git a/src/gui/components/otherswiftversionsdialog.h b/src/gui/components/otherswiftversionsdialog.h index 9dfa1fbe87..01bc52d98c 100644 --- a/src/gui/components/otherswiftversionsdialog.h +++ b/src/gui/components/otherswiftversionsdialog.h @@ -27,7 +27,7 @@ namespace swift::gui::components explicit COtherSwiftVersionsDialog(QWidget *parent = nullptr); //! Destructor - virtual ~COtherSwiftVersionsDialog(); + ~COtherSwiftVersionsDialog() override; private: QScopedPointer ui; diff --git a/src/gui/components/ownaircraftcomponent.cpp b/src/gui/components/ownaircraftcomponent.cpp index 87be26428c..2a9f40c14c 100644 --- a/src/gui/components/ownaircraftcomponent.cpp +++ b/src/gui/components/ownaircraftcomponent.cpp @@ -82,7 +82,7 @@ namespace swift::gui::components } } - COwnAircraftComponent::~COwnAircraftComponent() {} + COwnAircraftComponent::~COwnAircraftComponent() = default; void COwnAircraftComponent::setUser(const CUser &user) { diff --git a/src/gui/components/ownaircraftcomponent.h b/src/gui/components/ownaircraftcomponent.h index 1f29009330..999a62f907 100644 --- a/src/gui/components/ownaircraftcomponent.h +++ b/src/gui/components/ownaircraftcomponent.h @@ -46,7 +46,7 @@ namespace swift::gui::components explicit COwnAircraftComponent(QWidget *parent = nullptr); //! Destructor - virtual ~COwnAircraftComponent() override; + ~COwnAircraftComponent() override; //! Validate aircaft swift::misc::CStatusMessageList validate() const; diff --git a/src/gui/components/radarcomponent.cpp b/src/gui/components/radarcomponent.cpp index 975f2b9d12..893ba6d64f 100644 --- a/src/gui/components/radarcomponent.cpp +++ b/src/gui/components/radarcomponent.cpp @@ -58,7 +58,7 @@ namespace swift::gui::components m_headingTimer.start(50); } - CRadarComponent::~CRadarComponent() {} + CRadarComponent::~CRadarComponent() = default; bool CRadarComponent::setParentDockWidgetInfoArea(CDockWidgetInfoArea *parentDockableWidget) { diff --git a/src/gui/components/radarcomponent.h b/src/gui/components/radarcomponent.h index 63cdb0b97a..40e798fdb5 100644 --- a/src/gui/components/radarcomponent.h +++ b/src/gui/components/radarcomponent.h @@ -33,10 +33,10 @@ namespace swift::gui::components explicit CRadarComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CRadarComponent() override; + ~CRadarComponent() override; //! \copydoc CEnableForDockWidgetInfoArea::setParentDockWidgetInfoArea - virtual bool setParentDockWidgetInfoArea(swift::gui::CDockWidgetInfoArea *parentDockableWidget) override; + bool setParentDockWidgetInfoArea(swift::gui::CDockWidgetInfoArea *parentDockableWidget) override; private: void prepareScene(); diff --git a/src/gui/components/rawfsdmessagescomponent.cpp b/src/gui/components/rawfsdmessagescomponent.cpp index fbd02fddff..96a668ea8d 100644 --- a/src/gui/components/rawfsdmessagescomponent.cpp +++ b/src/gui/components/rawfsdmessagescomponent.cpp @@ -44,7 +44,7 @@ namespace swift::gui::components expandWritingToFile(false); } - CRawFsdMessagesComponent::~CRawFsdMessagesComponent() {} + CRawFsdMessagesComponent::~CRawFsdMessagesComponent() = default; void CRawFsdMessagesComponent::setupConnections() { diff --git a/src/gui/components/rawfsdmessagescomponent.h b/src/gui/components/rawfsdmessagescomponent.h index f91ca45275..e1225aff2b 100644 --- a/src/gui/components/rawfsdmessagescomponent.h +++ b/src/gui/components/rawfsdmessagescomponent.h @@ -29,7 +29,7 @@ namespace swift::gui::components explicit CRawFsdMessagesComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CRawFsdMessagesComponent(); + ~CRawFsdMessagesComponent() override; private: void setupConnections(); diff --git a/src/gui/components/rawfsdmessagesdialog.cpp b/src/gui/components/rawfsdmessagesdialog.cpp index 4147f0206a..29cda0a01b 100644 --- a/src/gui/components/rawfsdmessagesdialog.cpp +++ b/src/gui/components/rawfsdmessagesdialog.cpp @@ -12,5 +12,5 @@ namespace swift::gui::components ui->setupUi(this); } - CRawFsdMessagesDialog::~CRawFsdMessagesDialog() {} + CRawFsdMessagesDialog::~CRawFsdMessagesDialog() = default; } // namespace swift::gui::components diff --git a/src/gui/components/rawfsdmessagesdialog.h b/src/gui/components/rawfsdmessagesdialog.h index 40ce2e2555..af33b5750e 100644 --- a/src/gui/components/rawfsdmessagesdialog.h +++ b/src/gui/components/rawfsdmessagesdialog.h @@ -28,7 +28,7 @@ namespace swift::gui::components explicit CRawFsdMessagesDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CRawFsdMessagesDialog(); + ~CRawFsdMessagesDialog() override; private: QScopedPointer ui; diff --git a/src/gui/components/registercomponent.cpp b/src/gui/components/registercomponent.cpp index 2bf111bfef..7628d61c49 100644 --- a/src/gui/components/registercomponent.cpp +++ b/src/gui/components/registercomponent.cpp @@ -35,7 +35,7 @@ namespace swift::gui::components m_updateTimer.start(); } - CRegisterComponent::~CRegisterComponent() {} + CRegisterComponent::~CRegisterComponent() = default; void CRegisterComponent::update() { diff --git a/src/gui/components/registercomponent.h b/src/gui/components/registercomponent.h index f29e3583f6..027b90427a 100644 --- a/src/gui/components/registercomponent.h +++ b/src/gui/components/registercomponent.h @@ -28,7 +28,7 @@ namespace swift::gui::components explicit CRegisterComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CRegisterComponent(); + ~CRegisterComponent() override; private: QScopedPointer ui; diff --git a/src/gui/components/remoteaircraftselector.cpp b/src/gui/components/remoteaircraftselector.cpp index 08d612a2f7..3f102ce392 100644 --- a/src/gui/components/remoteaircraftselector.cpp +++ b/src/gui/components/remoteaircraftselector.cpp @@ -41,7 +41,7 @@ namespace swift::gui::components Q_UNUSED(s); } - CRemoteAircraftSelector::~CRemoteAircraftSelector() {} + CRemoteAircraftSelector::~CRemoteAircraftSelector() = default; swift::misc::aviation::CCallsign CRemoteAircraftSelector::getSelectedCallsign() const { diff --git a/src/gui/components/remoteaircraftselector.h b/src/gui/components/remoteaircraftselector.h index 41b0a9bd8c..e6e0bed6b1 100644 --- a/src/gui/components/remoteaircraftselector.h +++ b/src/gui/components/remoteaircraftselector.h @@ -40,7 +40,7 @@ namespace swift::gui::components explicit CRemoteAircraftSelector(QWidget *parent = nullptr); //! Destructor - virtual ~CRemoteAircraftSelector() override; + ~CRemoteAircraftSelector() override; //! Selected callsign swift::misc::aviation::CCallsign getSelectedCallsign() const; @@ -54,7 +54,7 @@ namespace swift::gui::components protected: //! \copydoc QWidget::showEvent - virtual void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent *event) override; private: //! Added aircraft, change content of combobox diff --git a/src/gui/components/selcalcodeselector.cpp b/src/gui/components/selcalcodeselector.cpp index c86bd3db92..fb7f278745 100644 --- a/src/gui/components/selcalcodeselector.cpp +++ b/src/gui/components/selcalcodeselector.cpp @@ -34,7 +34,7 @@ namespace swift::gui::components &CSelcalCodeSelector::selcalIndexChanged); } - CSelcalCodeSelector::~CSelcalCodeSelector() {} + CSelcalCodeSelector::~CSelcalCodeSelector() = default; QString CSelcalCodeSelector::getSelcalCode() const { diff --git a/src/gui/components/selcalcodeselector.h b/src/gui/components/selcalcodeselector.h index ad356c0bbb..966cab4253 100644 --- a/src/gui/components/selcalcodeselector.h +++ b/src/gui/components/selcalcodeselector.h @@ -32,7 +32,7 @@ namespace swift::gui::components explicit CSelcalCodeSelector(QWidget *parent = nullptr); //! Destructor - virtual ~CSelcalCodeSelector(); + ~CSelcalCodeSelector() override; //! SELCAL code QString getSelcalCode() const; diff --git a/src/gui/components/settingsadvancedcomponent.cpp b/src/gui/components/settingsadvancedcomponent.cpp index 00e339d10d..c9a7b57cf7 100644 --- a/src/gui/components/settingsadvancedcomponent.cpp +++ b/src/gui/components/settingsadvancedcomponent.cpp @@ -20,7 +20,7 @@ namespace swift::gui::components &CSettingsAdvancedComponent::crashDumpUploadEnabledChanged); } - CSettingsAdvancedComponent::~CSettingsAdvancedComponent() {} + CSettingsAdvancedComponent::~CSettingsAdvancedComponent() = default; void CSettingsAdvancedComponent::crashDumpUploadEnabledChanged(Qt::CheckState state) { diff --git a/src/gui/components/settingsadvancedcomponent.h b/src/gui/components/settingsadvancedcomponent.h index b38284a5b6..778b763e86 100644 --- a/src/gui/components/settingsadvancedcomponent.h +++ b/src/gui/components/settingsadvancedcomponent.h @@ -30,7 +30,7 @@ namespace swift::gui::components CSettingsAdvancedComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CSettingsAdvancedComponent(); + ~CSettingsAdvancedComponent() override; private: void crashDumpUploadEnabledChanged(Qt::CheckState state); diff --git a/src/gui/components/settingsfontcomponent.cpp b/src/gui/components/settingsfontcomponent.cpp index ea512824f1..f18642f65b 100644 --- a/src/gui/components/settingsfontcomponent.cpp +++ b/src/gui/components/settingsfontcomponent.cpp @@ -36,7 +36,7 @@ namespace swift::gui::components connect(sGui, &CGuiApplication::startUpCompleted, this, &CSettingsFontComponent::initValues); } - CSettingsFontComponent::~CSettingsFontComponent() {} + CSettingsFontComponent::~CSettingsFontComponent() = default; void CSettingsFontComponent::setMode(CSettingsFontComponent::Mode m) { diff --git a/src/gui/components/settingsfontcomponent.h b/src/gui/components/settingsfontcomponent.h index 2356f7bd24..03db0e21a1 100644 --- a/src/gui/components/settingsfontcomponent.h +++ b/src/gui/components/settingsfontcomponent.h @@ -33,7 +33,7 @@ namespace swift::gui::components explicit CSettingsFontComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CSettingsFontComponent() override; + ~CSettingsFontComponent() override; //! Set mode void setMode(Mode m); diff --git a/src/gui/components/settingsfontdialog.cpp b/src/gui/components/settingsfontdialog.cpp index 2ba8ce609c..26af138e38 100644 --- a/src/gui/components/settingsfontdialog.cpp +++ b/src/gui/components/settingsfontdialog.cpp @@ -17,7 +17,7 @@ namespace swift::gui::components connect(ui->comp_FontSettings, &CSettingsFontComponent::reject, this, &CSettingsFontDialog::reject); } - CSettingsFontDialog::~CSettingsFontDialog() {} + CSettingsFontDialog::~CSettingsFontDialog() = default; const QString &CSettingsFontDialog::getQss() const { return ui->comp_FontSettings->getQss(); } diff --git a/src/gui/components/settingsfontdialog.h b/src/gui/components/settingsfontdialog.h index e256d2d49b..4be4116f8e 100644 --- a/src/gui/components/settingsfontdialog.h +++ b/src/gui/components/settingsfontdialog.h @@ -29,7 +29,7 @@ namespace swift::gui::components explicit CSettingsFontDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CSettingsFontDialog() override; + ~CSettingsFontDialog() override; //! Get stylesheet const QString &getQss() const; diff --git a/src/gui/components/settingsguicomponent.cpp b/src/gui/components/settingsguicomponent.cpp index 0eef9bb7b2..da697662ad 100644 --- a/src/gui/components/settingsguicomponent.cpp +++ b/src/gui/components/settingsguicomponent.cpp @@ -43,7 +43,7 @@ namespace swift::gui::components this->guiSettingsChanged(); } - CSettingsGuiComponent::~CSettingsGuiComponent() {} + CSettingsGuiComponent::~CSettingsGuiComponent() = default; void CSettingsGuiComponent::hideOpacity(bool hide) { diff --git a/src/gui/components/settingsguicomponent.h b/src/gui/components/settingsguicomponent.h index 68eaa16851..c4733b9783 100644 --- a/src/gui/components/settingsguicomponent.h +++ b/src/gui/components/settingsguicomponent.h @@ -29,7 +29,7 @@ namespace swift::gui::components explicit CSettingsGuiComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CSettingsGuiComponent(); + ~CSettingsGuiComponent() override; //! Hide opacity elements void hideOpacity(bool hide); diff --git a/src/gui/components/settingshotkeycomponent.cpp b/src/gui/components/settingshotkeycomponent.cpp index 92f2630728..63aaf04946 100644 --- a/src/gui/components/settingshotkeycomponent.cpp +++ b/src/gui/components/settingshotkeycomponent.cpp @@ -51,7 +51,7 @@ namespace swift::gui::components ui->tv_Hotkeys->selectRow(0); } - CSettingsHotkeyComponent::~CSettingsHotkeyComponent() {} + CSettingsHotkeyComponent::~CSettingsHotkeyComponent() = default; void CSettingsHotkeyComponent::saveSettings() { diff --git a/src/gui/components/settingshotkeycomponent.h b/src/gui/components/settingshotkeycomponent.h index 41a111ca5f..75bdacdebe 100644 --- a/src/gui/components/settingshotkeycomponent.h +++ b/src/gui/components/settingshotkeycomponent.h @@ -35,7 +35,7 @@ namespace swift::gui::components CSettingsHotkeyComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CSettingsHotkeyComponent() override; + ~CSettingsHotkeyComponent() override; //! Save settings void saveSettings(); @@ -84,10 +84,10 @@ namespace swift::gui::components void setConfigComponent(CSettingsHotkeyComponent *config) { m_config = config; } //! \copydoc QWizardPage::validatePage - virtual bool validatePage() override; + bool validatePage() override; //! \copydoc QWizardPage::initializePage - virtual void initializePage() override; + void initializePage() override; private: CSettingsHotkeyComponent *m_config = nullptr; diff --git a/src/gui/components/settingsmatchingcomponent.cpp b/src/gui/components/settingsmatchingcomponent.cpp index 036bd8caa8..aa5a0738e8 100644 --- a/src/gui/components/settingsmatchingcomponent.cpp +++ b/src/gui/components/settingsmatchingcomponent.cpp @@ -38,7 +38,7 @@ namespace swift::gui::components else { this->showButtons(false); } } - CSettingsMatchingComponent::~CSettingsMatchingComponent() {} + CSettingsMatchingComponent::~CSettingsMatchingComponent() = default; CAircraftMatcherSetup CSettingsMatchingComponent::getMatchingSetup() const { return ui->form_Matching->value(); } diff --git a/src/gui/components/settingsmatchingcomponent.h b/src/gui/components/settingsmatchingcomponent.h index 84a3035a66..f2dda8501b 100644 --- a/src/gui/components/settingsmatchingcomponent.h +++ b/src/gui/components/settingsmatchingcomponent.h @@ -31,7 +31,7 @@ namespace swift::gui::components explicit CSettingsMatchingComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CSettingsMatchingComponent() override; + ~CSettingsMatchingComponent() override; //! Get setup swift::misc::simulation::CAircraftMatcherSetup getMatchingSetup() const; diff --git a/src/gui/components/settingsmatchingdialog.cpp b/src/gui/components/settingsmatchingdialog.cpp index 02f963463c..c77b6e553b 100644 --- a/src/gui/components/settingsmatchingdialog.cpp +++ b/src/gui/components/settingsmatchingdialog.cpp @@ -15,7 +15,7 @@ namespace swift::gui::components ui->setupUi(this); } - CSettingsMatchingDialog::~CSettingsMatchingDialog() {} + CSettingsMatchingDialog::~CSettingsMatchingDialog() = default; CAircraftMatcherSetup CSettingsMatchingDialog::getMatchingSetup() const { diff --git a/src/gui/components/settingsmatchingdialog.h b/src/gui/components/settingsmatchingdialog.h index 8ad88150a8..f2b57bb660 100644 --- a/src/gui/components/settingsmatchingdialog.h +++ b/src/gui/components/settingsmatchingdialog.h @@ -27,7 +27,7 @@ namespace swift::gui::components explicit CSettingsMatchingDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CSettingsMatchingDialog(); + ~CSettingsMatchingDialog() override; //! Get setup swift::misc::simulation::CAircraftMatcherSetup getMatchingSetup() const; diff --git a/src/gui/components/settingsmodelcomponent.cpp b/src/gui/components/settingsmodelcomponent.cpp index 3a2d4d2831..703c76b87b 100644 --- a/src/gui/components/settingsmodelcomponent.cpp +++ b/src/gui/components/settingsmodelcomponent.cpp @@ -43,7 +43,7 @@ namespace swift::gui::components }); } - CSettingsModelComponent::~CSettingsModelComponent() {} + CSettingsModelComponent::~CSettingsModelComponent() = default; int CSettingsModelComponent::getBackgroundUpdaterIntervallSecs() const { diff --git a/src/gui/components/settingsmodelcomponent.h b/src/gui/components/settingsmodelcomponent.h index 84bc59d346..14e1a88f80 100644 --- a/src/gui/components/settingsmodelcomponent.h +++ b/src/gui/components/settingsmodelcomponent.h @@ -33,7 +33,7 @@ namespace swift::gui::components explicit CSettingsModelComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CSettingsModelComponent(); + ~CSettingsModelComponent() override; //! Interval, -1 for disabled int getBackgroundUpdaterIntervallSecs() const; diff --git a/src/gui/components/settingsnetworkcomponent.cpp b/src/gui/components/settingsnetworkcomponent.cpp index 6aea9b3282..626a2c0f3e 100644 --- a/src/gui/components/settingsnetworkcomponent.cpp +++ b/src/gui/components/settingsnetworkcomponent.cpp @@ -20,5 +20,5 @@ namespace swift::gui::components ui->setupUi(this); } - CSettingsNetworkComponent::~CSettingsNetworkComponent() {} + CSettingsNetworkComponent::~CSettingsNetworkComponent() = default; } // namespace swift::gui::components diff --git a/src/gui/components/settingsnetworkcomponent.h b/src/gui/components/settingsnetworkcomponent.h index 95e416f5e3..96e4759e7d 100644 --- a/src/gui/components/settingsnetworkcomponent.h +++ b/src/gui/components/settingsnetworkcomponent.h @@ -29,7 +29,7 @@ namespace swift::gui::components explicit CSettingsNetworkComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CSettingsNetworkComponent(); + ~CSettingsNetworkComponent() override; private: QScopedPointer ui; diff --git a/src/gui/components/settingsnetworkserverscomponent.cpp b/src/gui/components/settingsnetworkserverscomponent.cpp index b3c19c1ccb..79503a2faf 100644 --- a/src/gui/components/settingsnetworkserverscomponent.cpp +++ b/src/gui/components/settingsnetworkserverscomponent.cpp @@ -44,7 +44,7 @@ namespace swift::gui::components this->reloadSettings(); } - CSettingsNetworkServersComponent::~CSettingsNetworkServersComponent() {} + CSettingsNetworkServersComponent::~CSettingsNetworkServersComponent() = default; void CSettingsNetworkServersComponent::reloadSettings() { diff --git a/src/gui/components/settingsnetworkserverscomponent.h b/src/gui/components/settingsnetworkserverscomponent.h index ff03b4de46..11cf347e71 100644 --- a/src/gui/components/settingsnetworkserverscomponent.h +++ b/src/gui/components/settingsnetworkserverscomponent.h @@ -29,7 +29,7 @@ namespace swift::gui::components explicit CSettingsNetworkServersComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CSettingsNetworkServersComponent(); + ~CSettingsNetworkServersComponent() override; private: //! Reload settings diff --git a/src/gui/components/settingssimulatorbasicscomponent.cpp b/src/gui/components/settingssimulatorbasicscomponent.cpp index 44577e1750..d3f012a310 100644 --- a/src/gui/components/settingssimulatorbasicscomponent.cpp +++ b/src/gui/components/settingssimulatorbasicscomponent.cpp @@ -58,7 +58,7 @@ namespace swift::gui::components this->onSimulatorChanged(); } - CSettingsSimulatorBasicsComponent::~CSettingsSimulatorBasicsComponent() {} + CSettingsSimulatorBasicsComponent::~CSettingsSimulatorBasicsComponent() = default; void CSettingsSimulatorBasicsComponent::hideSelector(bool show) { ui->comp_SimulatorSelector->setVisible(show); } diff --git a/src/gui/components/settingssimulatorbasicscomponent.h b/src/gui/components/settingssimulatorbasicscomponent.h index 9385c0feef..fffacc0311 100644 --- a/src/gui/components/settingssimulatorbasicscomponent.h +++ b/src/gui/components/settingssimulatorbasicscomponent.h @@ -36,7 +36,7 @@ namespace swift::gui::components explicit CSettingsSimulatorBasicsComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CSettingsSimulatorBasicsComponent() override; + ~CSettingsSimulatorBasicsComponent() override; //! Show / hide selector void hideSelector(bool show); diff --git a/src/gui/components/settingssimulatorcomponent.cpp b/src/gui/components/settingssimulatorcomponent.cpp index 6d04a9580e..c2f4c8c24b 100644 --- a/src/gui/components/settingssimulatorcomponent.cpp +++ b/src/gui/components/settingssimulatorcomponent.cpp @@ -120,7 +120,7 @@ namespace swift::gui::components } } - CSettingsSimulatorComponent::~CSettingsSimulatorComponent() {} + CSettingsSimulatorComponent::~CSettingsSimulatorComponent() = default; void CSettingsSimulatorComponent::setGuiValues() { diff --git a/src/gui/components/settingssimulatorcomponent.h b/src/gui/components/settingssimulatorcomponent.h index 6ea9acf4a4..a533df38c6 100644 --- a/src/gui/components/settingssimulatorcomponent.h +++ b/src/gui/components/settingssimulatorcomponent.h @@ -41,7 +41,7 @@ namespace swift::gui::components explicit CSettingsSimulatorComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CSettingsSimulatorComponent() override; + ~CSettingsSimulatorComponent() override; private: //! Driver plugin enabled/disabled diff --git a/src/gui/components/settingssimulatormessagescomponent.cpp b/src/gui/components/settingssimulatormessagescomponent.cpp index 6b851449b2..8648f59b85 100644 --- a/src/gui/components/settingssimulatormessagescomponent.cpp +++ b/src/gui/components/settingssimulatormessagescomponent.cpp @@ -25,7 +25,7 @@ namespace swift::gui::components this->load(); } - CSettingsSimulatorMessagesComponent::~CSettingsSimulatorMessagesComponent() {} + CSettingsSimulatorMessagesComponent::~CSettingsSimulatorMessagesComponent() = default; void CSettingsSimulatorMessagesComponent::save() { diff --git a/src/gui/components/settingssimulatormessagescomponent.h b/src/gui/components/settingssimulatormessagescomponent.h index e905630f26..6b82b33dd9 100644 --- a/src/gui/components/settingssimulatormessagescomponent.h +++ b/src/gui/components/settingssimulatormessagescomponent.h @@ -29,7 +29,7 @@ namespace swift::gui::components explicit CSettingsSimulatorMessagesComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CSettingsSimulatorMessagesComponent() override; + ~CSettingsSimulatorMessagesComponent() override; private: //! Save the data diff --git a/src/gui/components/settingsswiftplugin.cpp b/src/gui/components/settingsswiftplugin.cpp index b3a0022637..0bec9e94b1 100644 --- a/src/gui/components/settingsswiftplugin.cpp +++ b/src/gui/components/settingsswiftplugin.cpp @@ -22,7 +22,7 @@ namespace swift::gui::components connect(ui->pb_Save, &QPushButton::clicked, this, &CSettingsSwiftPlugin::save); } - CSettingsSwiftPlugin::~CSettingsSwiftPlugin() {} + CSettingsSwiftPlugin::~CSettingsSwiftPlugin() = default; swift::misc::simulation::settings::CSwiftPluginSettings CSettingsSwiftPlugin::getPluginSettings() const { diff --git a/src/gui/components/settingsswiftplugin.h b/src/gui/components/settingsswiftplugin.h index 5ff2287e32..1a5ee303ff 100644 --- a/src/gui/components/settingsswiftplugin.h +++ b/src/gui/components/settingsswiftplugin.h @@ -29,7 +29,7 @@ namespace swift::gui::components explicit CSettingsSwiftPlugin(QWidget *parent = nullptr); //! Dtor - virtual ~CSettingsSwiftPlugin(); + ~CSettingsSwiftPlugin() override; //! Get the plugin settings swift::misc::simulation::settings::CSwiftPluginSettings getPluginSettings() const; diff --git a/src/gui/components/settingstextmessageinlinecomponent.cpp b/src/gui/components/settingstextmessageinlinecomponent.cpp index 22a866abcb..c6885e8f87 100644 --- a/src/gui/components/settingstextmessageinlinecomponent.cpp +++ b/src/gui/components/settingstextmessageinlinecomponent.cpp @@ -34,7 +34,7 @@ namespace swift::gui::components this->settingsChanged(); } - CSettingsTextMessageInlineComponent::~CSettingsTextMessageInlineComponent() {} + CSettingsTextMessageInlineComponent::~CSettingsTextMessageInlineComponent() = default; void CSettingsTextMessageInlineComponent::settingsChanged() { diff --git a/src/gui/components/settingstextmessageinlinecomponent.h b/src/gui/components/settingstextmessageinlinecomponent.h index 3c7d17f072..e1a21c7247 100644 --- a/src/gui/components/settingstextmessageinlinecomponent.h +++ b/src/gui/components/settingstextmessageinlinecomponent.h @@ -29,7 +29,7 @@ namespace swift::gui::components explicit CSettingsTextMessageInlineComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CSettingsTextMessageInlineComponent(); + ~CSettingsTextMessageInlineComponent() override; private: //! Settings have been changed diff --git a/src/gui/components/settingstextmessagestyle.cpp b/src/gui/components/settingstextmessagestyle.cpp index 47d839cbbf..615eb281ea 100644 --- a/src/gui/components/settingstextmessagestyle.cpp +++ b/src/gui/components/settingstextmessagestyle.cpp @@ -36,7 +36,7 @@ namespace swift::gui::components // &CSettingsTextMessageStyle::fontSizePlus); } - CSettingsTextMessageStyle::~CSettingsTextMessageStyle() {} + CSettingsTextMessageStyle::~CSettingsTextMessageStyle() = default; QStringList CSettingsTextMessageStyle::getFamilySizeStyle() const { diff --git a/src/gui/components/settingstextmessagestyle.h b/src/gui/components/settingstextmessagestyle.h index 806f9ab388..5f6d362005 100644 --- a/src/gui/components/settingstextmessagestyle.h +++ b/src/gui/components/settingstextmessagestyle.h @@ -29,7 +29,7 @@ namespace swift::gui::components explicit CSettingsTextMessageStyle(QWidget *parent = nullptr); //! Destructor - virtual ~CSettingsTextMessageStyle() override; + ~CSettingsTextMessageStyle() override; //! Fmily, size and style QStringList getFamilySizeStyle() const; diff --git a/src/gui/components/settingsvatsimreaderscomponent.cpp b/src/gui/components/settingsvatsimreaderscomponent.cpp index bcc142cd79..4af8103d30 100644 --- a/src/gui/components/settingsvatsimreaderscomponent.cpp +++ b/src/gui/components/settingsvatsimreaderscomponent.cpp @@ -21,7 +21,7 @@ namespace swift::gui::components this->initValues(); } - CSettingsVatsimReadersComponent::~CSettingsVatsimReadersComponent() {} + CSettingsVatsimReadersComponent::~CSettingsVatsimReadersComponent() = default; void CSettingsVatsimReadersComponent::onSettingsChanged() { this->initValues(); } diff --git a/src/gui/components/settingsvatsimreaderscomponent.h b/src/gui/components/settingsvatsimreaderscomponent.h index 6e761707ed..37054f2ecd 100644 --- a/src/gui/components/settingsvatsimreaderscomponent.h +++ b/src/gui/components/settingsvatsimreaderscomponent.h @@ -30,7 +30,7 @@ namespace swift::gui::components explicit CSettingsVatsimReadersComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CSettingsVatsimReadersComponent(); + ~CSettingsVatsimReadersComponent() override; private: void onSettingsChanged(); diff --git a/src/gui/components/settingsviewupdatetimes.cpp b/src/gui/components/settingsviewupdatetimes.cpp index 341705984d..3127819cbb 100644 --- a/src/gui/components/settingsviewupdatetimes.cpp +++ b/src/gui/components/settingsviewupdatetimes.cpp @@ -24,7 +24,7 @@ namespace swift::gui::components this->ps_settingsChanged(); } - CSettingsViewUpdateTimes::~CSettingsViewUpdateTimes() {} + CSettingsViewUpdateTimes::~CSettingsViewUpdateTimes() = default; void CSettingsViewUpdateTimes::ps_sliderChanged() { diff --git a/src/gui/components/settingsviewupdatetimes.h b/src/gui/components/settingsviewupdatetimes.h index fc8bfba0e0..dea20a88b8 100644 --- a/src/gui/components/settingsviewupdatetimes.h +++ b/src/gui/components/settingsviewupdatetimes.h @@ -28,7 +28,7 @@ namespace swift::gui::components explicit CSettingsViewUpdateTimes(QWidget *parent = nullptr); //! Destructor - virtual ~CSettingsViewUpdateTimes(); + ~CSettingsViewUpdateTimes() override; private slots: //! Slider changed diff --git a/src/gui/components/settingsxswiftbuscomponent.cpp b/src/gui/components/settingsxswiftbuscomponent.cpp index 245aec21d3..a8c5925723 100644 --- a/src/gui/components/settingsxswiftbuscomponent.cpp +++ b/src/gui/components/settingsxswiftbuscomponent.cpp @@ -36,7 +36,7 @@ namespace swift::gui::components ui->comp_DBusServer->set(dBusAddress); } - CSettingsXSwiftBusComponent::~CSettingsXSwiftBusComponent() {} + CSettingsXSwiftBusComponent::~CSettingsXSwiftBusComponent() = default; void CSettingsXSwiftBusComponent::resetServer() { diff --git a/src/gui/components/settingsxswiftbuscomponent.h b/src/gui/components/settingsxswiftbuscomponent.h index d58c6ad05b..9a699d70d4 100644 --- a/src/gui/components/settingsxswiftbuscomponent.h +++ b/src/gui/components/settingsxswiftbuscomponent.h @@ -35,7 +35,7 @@ namespace swift::gui::components explicit CSettingsXSwiftBusComponent(QWidget *parent = nullptr); //! Dtor - virtual ~CSettingsXSwiftBusComponent() override; + ~CSettingsXSwiftBusComponent() override; private: QScopedPointer ui; diff --git a/src/gui/components/setuploadingdialog.cpp b/src/gui/components/setuploadingdialog.cpp index 1984674297..a1816fef99 100644 --- a/src/gui/components/setuploadingdialog.cpp +++ b/src/gui/components/setuploadingdialog.cpp @@ -40,5 +40,5 @@ namespace swift::gui::components ui->comp_Messages->appendStatusMessagesToList(msgs); } - CSetupLoadingDialog::~CSetupLoadingDialog() {} + CSetupLoadingDialog::~CSetupLoadingDialog() = default; } // namespace swift::gui::components diff --git a/src/gui/components/setuploadingdialog.h b/src/gui/components/setuploadingdialog.h index 64af8dc123..122f23b30f 100644 --- a/src/gui/components/setuploadingdialog.h +++ b/src/gui/components/setuploadingdialog.h @@ -28,7 +28,7 @@ namespace swift::gui::components CSetupLoadingDialog(const swift::misc::CStatusMessageList &msgs, QWidget *parent = nullptr); //! Dtor - virtual ~CSetupLoadingDialog(); + ~CSetupLoadingDialog() override; private: QScopedPointer ui; diff --git a/src/gui/components/simbriefdownloaddialog.cpp b/src/gui/components/simbriefdownloaddialog.cpp index 4256dbf759..e4f0de6996 100644 --- a/src/gui/components/simbriefdownloaddialog.cpp +++ b/src/gui/components/simbriefdownloaddialog.cpp @@ -16,7 +16,7 @@ namespace swift::gui::components this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); } - CSimBriefDownloadDialog::~CSimBriefDownloadDialog() {} + CSimBriefDownloadDialog::~CSimBriefDownloadDialog() = default; CSimBriefData CSimBriefDownloadDialog::getSimBriefData() const { diff --git a/src/gui/components/simbriefdownloaddialog.h b/src/gui/components/simbriefdownloaddialog.h index f358cf197a..bf0c005d2f 100644 --- a/src/gui/components/simbriefdownloaddialog.h +++ b/src/gui/components/simbriefdownloaddialog.h @@ -27,7 +27,7 @@ namespace swift::gui::components explicit CSimBriefDownloadDialog(QWidget *parent = nullptr); //! Dtor - virtual ~CSimBriefDownloadDialog() override; + ~CSimBriefDownloadDialog() override; //! SimBrief data swift::misc::aviation::CSimBriefData getSimBriefData() const; @@ -36,7 +36,7 @@ namespace swift::gui::components void setSimBriefData(const swift::misc::aviation::CSimBriefData &data); //! \copydoc QDialog::exec - virtual int exec() override; + int exec() override; private: QScopedPointer ui; diff --git a/src/gui/components/simulatorcomponent.cpp b/src/gui/components/simulatorcomponent.cpp index 332d3c158a..7a38bc8e51 100644 --- a/src/gui/components/simulatorcomponent.cpp +++ b/src/gui/components/simulatorcomponent.cpp @@ -71,7 +71,7 @@ namespace swift::gui::components this->onSimulatorStatusChanged(sGui->getIContextSimulator()->getSimulatorStatus()); } - CSimulatorComponent::~CSimulatorComponent() {} + CSimulatorComponent::~CSimulatorComponent() = default; void CSimulatorComponent::addOrUpdateLiveDataByName(const QString &name, const QString &value, const CIcon &icon) { diff --git a/src/gui/components/simulatorcomponent.h b/src/gui/components/simulatorcomponent.h index 733f50c7db..0a10bacffb 100644 --- a/src/gui/components/simulatorcomponent.h +++ b/src/gui/components/simulatorcomponent.h @@ -47,7 +47,7 @@ namespace swift::gui::components explicit CSimulatorComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CSimulatorComponent(); + ~CSimulatorComponent() override; //! Number of entries int rowCount() const; diff --git a/src/gui/components/simulatorselector.cpp b/src/gui/components/simulatorselector.cpp index 5377ed2bae..a96a5ecfaf 100644 --- a/src/gui/components/simulatorselector.cpp +++ b/src/gui/components/simulatorselector.cpp @@ -51,7 +51,7 @@ namespace swift::gui::components connect(ui->cb_Simulators, &QComboBox::currentTextChanged, this, &CSimulatorSelector::comboBoxChanged); } - CSimulatorSelector::~CSimulatorSelector() {} + CSimulatorSelector::~CSimulatorSelector() = default; void CSimulatorSelector::setMode(CSimulatorSelector::Mode mode, bool forced) { diff --git a/src/gui/components/simulatorselector.h b/src/gui/components/simulatorselector.h index a9fff16b1a..ceabdc3cb4 100644 --- a/src/gui/components/simulatorselector.h +++ b/src/gui/components/simulatorselector.h @@ -41,7 +41,7 @@ namespace swift::gui::components explicit CSimulatorSelector(QWidget *parent = nullptr); //! Destructor - virtual ~CSimulatorSelector() override; + ~CSimulatorSelector() override; //! How to display void setMode(Mode mode, bool forced = false); diff --git a/src/gui/components/statusmessageform.cpp b/src/gui/components/statusmessageform.cpp index e5f9eac07a..dc3d47704a 100644 --- a/src/gui/components/statusmessageform.cpp +++ b/src/gui/components/statusmessageform.cpp @@ -21,7 +21,7 @@ namespace swift::gui::components ui->setupUi(this); } - CStatusMessageForm::~CStatusMessageForm() {} + CStatusMessageForm::~CStatusMessageForm() = default; void CStatusMessageForm::setVariant(const CVariant &messageVariant) { diff --git a/src/gui/components/statusmessageform.h b/src/gui/components/statusmessageform.h index 79c548eade..70dd1d415a 100644 --- a/src/gui/components/statusmessageform.h +++ b/src/gui/components/statusmessageform.h @@ -34,7 +34,7 @@ namespace swift::gui::components explicit CStatusMessageForm(QWidget *parent = nullptr); //! Destructor - virtual ~CStatusMessageForm(); + ~CStatusMessageForm() override; //! Set message void setVariant(const swift::misc::CVariant &messageVariant); diff --git a/src/gui/components/statusmessageformsmall.cpp b/src/gui/components/statusmessageformsmall.cpp index ae8c483520..0c7edb4deb 100644 --- a/src/gui/components/statusmessageformsmall.cpp +++ b/src/gui/components/statusmessageformsmall.cpp @@ -21,7 +21,7 @@ namespace swift::gui::components ui->setupUi(this); } - CStatusMessageFormSmall::~CStatusMessageFormSmall() {} + CStatusMessageFormSmall::~CStatusMessageFormSmall() = default; void CStatusMessageFormSmall::setVariant(const CVariant &messageVariant) { diff --git a/src/gui/components/statusmessageformsmall.h b/src/gui/components/statusmessageformsmall.h index 4c27a4d558..f45816e46d 100644 --- a/src/gui/components/statusmessageformsmall.h +++ b/src/gui/components/statusmessageformsmall.h @@ -32,7 +32,7 @@ namespace swift::gui::components explicit CStatusMessageFormSmall(QWidget *parent = nullptr); //! Destructor - virtual ~CStatusMessageFormSmall(); + ~CStatusMessageFormSmall() override; //! Set message void setVariant(const swift::misc::CVariant &messageVariant); diff --git a/src/gui/components/statusmessagesdetail.cpp b/src/gui/components/statusmessagesdetail.cpp index 355decb534..338fd92f2e 100644 --- a/src/gui/components/statusmessagesdetail.cpp +++ b/src/gui/components/statusmessagesdetail.cpp @@ -33,7 +33,7 @@ namespace swift::gui::components }); } - CStatusMessagesDetail::~CStatusMessagesDetail() {} + CStatusMessagesDetail::~CStatusMessagesDetail() = default; void CStatusMessagesDetail::appendStatusMessageToList(const CStatusMessage &message) { diff --git a/src/gui/components/statusmessagesdetail.h b/src/gui/components/statusmessagesdetail.h index abe6990653..e334de2507 100644 --- a/src/gui/components/statusmessagesdetail.h +++ b/src/gui/components/statusmessagesdetail.h @@ -32,7 +32,7 @@ namespace swift::gui::components explicit CStatusMessagesDetail(QWidget *parent = nullptr); //! Destructor - virtual ~CStatusMessagesDetail() override; + ~CStatusMessagesDetail() override; //! Add message void appendStatusMessageToList(const swift::misc::CStatusMessage &message); @@ -97,7 +97,7 @@ namespace swift::gui::components CMessageMenu(CStatusMessagesDetail *parent) : IMenuDelegate(parent) {} //! \copydoc IMenuDelegate::customMenu - virtual void customMenu(menus::CMenuActions &menuActions) override; + void customMenu(menus::CMenuActions &menuActions) override; private: QAction *m_action = nullptr; diff --git a/src/gui/components/stringlistdialog.cpp b/src/gui/components/stringlistdialog.cpp index abd9d72883..a2db013d5c 100644 --- a/src/gui/components/stringlistdialog.cpp +++ b/src/gui/components/stringlistdialog.cpp @@ -14,7 +14,7 @@ namespace swift::gui::components ui->lw_StringList->setSelectionMode(QAbstractItemView::SingleSelection); } - CStringListDialog::~CStringListDialog() {} + CStringListDialog::~CStringListDialog() = default; void CStringListDialog::setStrings(const QStringList &strings) { diff --git a/src/gui/components/stringlistdialog.h b/src/gui/components/stringlistdialog.h index 39d66d5be7..9f7ad69a85 100644 --- a/src/gui/components/stringlistdialog.h +++ b/src/gui/components/stringlistdialog.h @@ -27,7 +27,7 @@ namespace swift::gui::components explicit CStringListDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CStringListDialog() override; + ~CStringListDialog() override; //! Strings void setStrings(const QStringList &strings); diff --git a/src/gui/components/texteditdialog.cpp b/src/gui/components/texteditdialog.cpp index aa05e962d3..51296dab2d 100644 --- a/src/gui/components/texteditdialog.cpp +++ b/src/gui/components/texteditdialog.cpp @@ -13,7 +13,7 @@ namespace swift::gui::components this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); } - CTextEditDialog::~CTextEditDialog() {} + CTextEditDialog::~CTextEditDialog() = default; QTextEdit *CTextEditDialog::textEdit() const { return ui->te_TextEdit; } diff --git a/src/gui/components/texteditdialog.h b/src/gui/components/texteditdialog.h index f08353e22c..06a4ad0cda 100644 --- a/src/gui/components/texteditdialog.h +++ b/src/gui/components/texteditdialog.h @@ -29,7 +29,7 @@ namespace swift::gui::components explicit CTextEditDialog(QWidget *parent = nullptr); //! Dtor - virtual ~CTextEditDialog() override; + ~CTextEditDialog() override; //! Access to text edit QTextEdit *textEdit() const; diff --git a/src/gui/components/textmessagecomponent.cpp b/src/gui/components/textmessagecomponent.cpp index 87c24172c2..5e2cc00c30 100644 --- a/src/gui/components/textmessagecomponent.cpp +++ b/src/gui/components/textmessagecomponent.cpp @@ -125,7 +125,7 @@ namespace swift::gui::components }); } - CTextMessageComponent::~CTextMessageComponent() {} + CTextMessageComponent::~CTextMessageComponent() = default; bool CTextMessageComponent::setParentDockWidgetInfoArea(CDockWidgetInfoArea *parentDockableWidget) { diff --git a/src/gui/components/textmessagecomponent.h b/src/gui/components/textmessagecomponent.h index 6ec78e6cc3..dac152a465 100644 --- a/src/gui/components/textmessagecomponent.h +++ b/src/gui/components/textmessagecomponent.h @@ -43,10 +43,10 @@ namespace swift::gui explicit CTextMessageComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CTextMessageComponent() override; + ~CTextMessageComponent() override; //! \copydoc CEnableForDockWidgetInfoArea::setParentDockWidgetInfoArea - virtual bool setParentDockWidgetInfoArea(CDockWidgetInfoArea *parentDockableWidget) override; + bool setParentDockWidgetInfoArea(CDockWidgetInfoArea *parentDockableWidget) override; //! Used to allow direct input from global command line when visible //! \remark takes the messages, turns it into a ".msg" command, and emits it diff --git a/src/gui/components/transpondercodespinbox.h b/src/gui/components/transpondercodespinbox.h index e02b8ba245..c5c192f2ff 100644 --- a/src/gui/components/transpondercodespinbox.h +++ b/src/gui/components/transpondercodespinbox.h @@ -23,7 +23,7 @@ namespace swift::gui::components explicit CTransponderCodeSpinBox(QWidget *parent = nullptr); //! \copydoc QDoubleSpinBox::textFromValue - virtual QString textFromValue(int value) const override; + QString textFromValue(int value) const override; }; } // namespace swift::gui::components diff --git a/src/gui/components/transpondermodecomponent.cpp b/src/gui/components/transpondermodecomponent.cpp index 9efcd03644..577fdcafb7 100644 --- a/src/gui/components/transpondermodecomponent.cpp +++ b/src/gui/components/transpondermodecomponent.cpp @@ -42,7 +42,7 @@ namespace swift::gui::components }); } - CTransponderModeComponent::~CTransponderModeComponent() {} + CTransponderModeComponent::~CTransponderModeComponent() = default; void CTransponderModeComponent::init() { diff --git a/src/gui/components/transpondermodecomponent.h b/src/gui/components/transpondermodecomponent.h index 219083d30f..693af33704 100644 --- a/src/gui/components/transpondermodecomponent.h +++ b/src/gui/components/transpondermodecomponent.h @@ -38,7 +38,7 @@ namespace swift::gui::components explicit CTransponderModeComponent(QWidget *parent = nullptr); //! Dtor - virtual ~CTransponderModeComponent() override; + ~CTransponderModeComponent() override; signals: //! value has been changed diff --git a/src/gui/components/updateinfocomponent.cpp b/src/gui/components/updateinfocomponent.cpp index cc8f4fac8e..02f89df923 100644 --- a/src/gui/components/updateinfocomponent.cpp +++ b/src/gui/components/updateinfocomponent.cpp @@ -43,7 +43,7 @@ namespace swift::gui::components if (!m_updateInfo.get().isEmpty()) { this->changedUpdateInfo(); } } - CUpdateInfoComponent::~CUpdateInfoComponent() {} + CUpdateInfoComponent::~CUpdateInfoComponent() = default; CArtifact CUpdateInfoComponent::getLatestAvailablePilotClientArtifactForSelection() const { diff --git a/src/gui/components/updateinfocomponent.h b/src/gui/components/updateinfocomponent.h index 92147126ed..9d75f29943 100644 --- a/src/gui/components/updateinfocomponent.h +++ b/src/gui/components/updateinfocomponent.h @@ -36,7 +36,7 @@ namespace swift::gui::components explicit CUpdateInfoComponent(QWidget *parent = nullptr); //! Dtor - virtual ~CUpdateInfoComponent() override; + ~CUpdateInfoComponent() override; //! Is there a new version available return version, else empty string swift::misc::db::CArtifact getLatestAvailablePilotClientArtifactForSelection() const; diff --git a/src/gui/components/updateinfodialog.cpp b/src/gui/components/updateinfodialog.cpp index 0643ec32c5..84e782b5ec 100644 --- a/src/gui/components/updateinfodialog.cpp +++ b/src/gui/components/updateinfodialog.cpp @@ -25,7 +25,7 @@ namespace swift::gui::components connect(ui->cb_DontShowAgain, &QCheckBox::toggled, this, &CUpdateInfoDialog::onDontShowAgain); } - CUpdateInfoDialog::~CUpdateInfoDialog() {} + CUpdateInfoDialog::~CUpdateInfoDialog() = default; bool CUpdateInfoDialog::isNewVersionAvailable() const { diff --git a/src/gui/components/updateinfodialog.h b/src/gui/components/updateinfodialog.h index e5c7af1c42..0459f94946 100644 --- a/src/gui/components/updateinfodialog.h +++ b/src/gui/components/updateinfodialog.h @@ -29,13 +29,13 @@ namespace swift::gui::components explicit CUpdateInfoDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CUpdateInfoDialog() override; + ~CUpdateInfoDialog() override; //! A new version existing? bool isNewVersionAvailable() const; //! \copydoc QDialog::exec - virtual int exec() override; + int exec() override; private: QScopedPointer ui; diff --git a/src/gui/components/usercomponent.cpp b/src/gui/components/usercomponent.cpp index 9e01ab05a8..612cf329e7 100644 --- a/src/gui/components/usercomponent.cpp +++ b/src/gui/components/usercomponent.cpp @@ -42,7 +42,7 @@ namespace swift::gui::components this->onSettingsChanged(); } - CUserComponent::~CUserComponent() {} + CUserComponent::~CUserComponent() = default; int CUserComponent::countClients() const { diff --git a/src/gui/components/usercomponent.h b/src/gui/components/usercomponent.h index bc0cf6bb73..bb21631a93 100644 --- a/src/gui/components/usercomponent.h +++ b/src/gui/components/usercomponent.h @@ -34,7 +34,7 @@ namespace swift::gui::components explicit CUserComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CUserComponent() override; + ~CUserComponent() override; //! Number of clients int countClients() const; diff --git a/src/gui/dockwidget.h b/src/gui/dockwidget.h index cbb20f5ce2..f42b89ae38 100644 --- a/src/gui/dockwidget.h +++ b/src/gui/dockwidget.h @@ -97,7 +97,7 @@ namespace swift::gui void setOffsetWhenFloating(const QPoint &point, bool frameless); //! \copydoc CEnableForFramelessWindow::setFrameless - virtual void setFrameless(bool frameless) override; + void setFrameless(bool frameless) override; //! Toggle floating void toggleFloating(); @@ -198,19 +198,19 @@ namespace swift::gui void setAlwaysOnTopFlag(bool onTop); //! \copydoc QWidget::closeEvent - virtual void closeEvent(QCloseEvent *event) override; + void closeEvent(QCloseEvent *event) override; //! \copydoc QWidget::paintEvent - virtual void paintEvent(QPaintEvent *event) override; + void paintEvent(QPaintEvent *event) override; //! \copydoc QWidget::mouseMoveEvent - virtual void mouseMoveEvent(QMouseEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; //! \copydoc QWidget::mouseMoveEvent - virtual void keyPressEvent(QKeyEvent *event) override; + void keyPressEvent(QKeyEvent *event) override; //! \copydoc QWidget::mousePressEvent - virtual void mousePressEvent(QMouseEvent *event) override; + void mousePressEvent(QMouseEvent *event) override; //! Contribute to menu virtual void addToContextMenu(QMenu *contextMenu) const; diff --git a/src/gui/dockwidgetinfoarea.h b/src/gui/dockwidgetinfoarea.h index 6942f96895..17397ccbba 100644 --- a/src/gui/dockwidgetinfoarea.h +++ b/src/gui/dockwidgetinfoarea.h @@ -45,10 +45,10 @@ namespace swift::gui //! Contribute to menu //! \remarks made public so other classes can nest this submenu - virtual void addToContextMenu(QMenu *contextMenu) const override; + void addToContextMenu(QMenu *contextMenu) const override; //! \copydoc CDockWidget::initialFloating - virtual void initialFloating() override; + void initialFloating() override; private: //! Find all embedded dock widget components. These are components marked as CDockWidgetInfoAreaComponent diff --git a/src/gui/dockwidgetinfobar.h b/src/gui/dockwidgetinfobar.h index e88dcf873f..705cbcf0b0 100644 --- a/src/gui/dockwidgetinfobar.h +++ b/src/gui/dockwidgetinfobar.h @@ -31,15 +31,15 @@ namespace swift::gui //! \copydoc CDockWidget::initialFloating //! \remark special case to allow init - virtual void initialFloating() override { CDockWidget::initialFloating(); } + void initialFloating() override { CDockWidget::initialFloating(); } protected: //! Contribute to menu - virtual void addToContextMenu(QMenu *contextMenu) const override; + void addToContextMenu(QMenu *contextMenu) const override; protected: //! \copydoc CDockWidget::onStyleSheetsChanged - virtual void onStyleSheetsChanged() override; + void onStyleSheetsChanged() override; }; } // namespace swift::gui diff --git a/src/gui/dropbase.cpp b/src/gui/dropbase.cpp index 4f06ed112a..5d73e4739e 100644 --- a/src/gui/dropbase.cpp +++ b/src/gui/dropbase.cpp @@ -13,10 +13,6 @@ using namespace swift::misc; namespace swift::gui { - CDropBase::CDropBase() {} - - CDropBase::~CDropBase() {} - void CDropBase::setAcceptedMetaTypeIds(const QList &ids) { m_acceptedMetaTypes = ids; } void CDropBase::addAcceptedMetaTypeId(int id) { m_acceptedMetaTypes.append(id); } diff --git a/src/gui/dropbase.h b/src/gui/dropbase.h index a7af6c897b..cf4e69910c 100644 --- a/src/gui/dropbase.h +++ b/src/gui/dropbase.h @@ -19,7 +19,7 @@ namespace swift::gui { public: //! Dtor - virtual ~CDropBase(); + virtual ~CDropBase() = default; //! Accepted ids void setAcceptedMetaTypeIds(const QList &ids); @@ -47,7 +47,7 @@ namespace swift::gui protected: //! Ctor - CDropBase(); + CDropBase() = default; private: bool m_allowDrop = true; //!< dropping allowed? diff --git a/src/gui/dropsite.h b/src/gui/dropsite.h index 1949f847fe..b986ef14bd 100644 --- a/src/gui/dropsite.h +++ b/src/gui/dropsite.h @@ -48,16 +48,16 @@ namespace swift::gui protected: //! \copydoc QWidget::dragEnterEvent - virtual void dragEnterEvent(QDragEnterEvent *event) override; + void dragEnterEvent(QDragEnterEvent *event) override; //! \copydoc QWidget::dragMoveEvent - virtual void dragMoveEvent(QDragMoveEvent *event) override; + void dragMoveEvent(QDragMoveEvent *event) override; //! \copydoc QWidget::dragLeaveEvent - virtual void dragLeaveEvent(QDragLeaveEvent *event) override; + void dragLeaveEvent(QDragLeaveEvent *event) override; //! \copydoc QWidget::dropEvent - virtual void dropEvent(QDropEvent *event) override; + void dropEvent(QDropEvent *event) override; private: //! Style has been changed diff --git a/src/gui/ecosystemcombobox.h b/src/gui/ecosystemcombobox.h index 52fed57147..009885bdf7 100644 --- a/src/gui/ecosystemcombobox.h +++ b/src/gui/ecosystemcombobox.h @@ -25,7 +25,7 @@ namespace swift::gui CEcosystemComboBox(const swift::misc::network::CEcosystemList &systems, QWidget *parent = nullptr); //! Destructor - virtual ~CEcosystemComboBox() {} + ~CEcosystemComboBox() override = default; //! The selected ecosystem swift::misc::network::CEcosystem getSelectedEcosystem() const; diff --git a/src/gui/editors/aircrafticaoform.cpp b/src/gui/editors/aircrafticaoform.cpp index d84eb56927..fbef4b9c8f 100644 --- a/src/gui/editors/aircrafticaoform.cpp +++ b/src/gui/editors/aircrafticaoform.cpp @@ -54,7 +54,7 @@ namespace swift::gui::editors { qMetaTypeId(), qMetaTypeId() }); } - CAircraftIcaoForm::~CAircraftIcaoForm() {} + CAircraftIcaoForm::~CAircraftIcaoForm() = default; bool CAircraftIcaoForm::setValue(const swift::misc::aviation::CAircraftIcaoCode &icao) { diff --git a/src/gui/editors/aircrafticaoform.h b/src/gui/editors/aircrafticaoform.h index aa84977964..5df133b938 100644 --- a/src/gui/editors/aircrafticaoform.h +++ b/src/gui/editors/aircrafticaoform.h @@ -33,7 +33,7 @@ namespace swift::gui::editors explicit CAircraftIcaoForm(QWidget *parent = nullptr); //! Destructor - virtual ~CAircraftIcaoForm() override; + ~CAircraftIcaoForm() override; //! Get value swift::misc::aviation::CAircraftIcaoCode getValue() const; @@ -46,9 +46,9 @@ namespace swift::gui::editors //! \name Form class implementations //! @{ - virtual void setReadOnly(bool readonly) override; - virtual void setSelectOnly() override; - virtual swift::misc::CStatusMessageList validate(bool nested = false) const override; + void setReadOnly(bool readonly) override; + void setSelectOnly() override; + swift::misc::CStatusMessageList validate(bool nested = false) const override; //! @} //! Clear @@ -63,7 +63,7 @@ namespace swift::gui::editors protected: //! \copydoc CForm::jsonPasted - virtual void jsonPasted(const QString &json) override; + void jsonPasted(const QString &json) override; private: QScopedPointer ui; diff --git a/src/gui/editors/aircraftmodelform.cpp b/src/gui/editors/aircraftmodelform.cpp index 52bf3dd1e0..aca9c7e53b 100644 --- a/src/gui/editors/aircraftmodelform.cpp +++ b/src/gui/editors/aircraftmodelform.cpp @@ -15,7 +15,7 @@ namespace swift::gui::editors this->setFocusProxy(ui->editor_AircraftIcao); } - CAircraftModelForm::~CAircraftModelForm() {} + CAircraftModelForm::~CAircraftModelForm() = default; void CAircraftModelForm::setReadOnly(bool readOnly) { diff --git a/src/gui/editors/aircraftmodelform.h b/src/gui/editors/aircraftmodelform.h index 2e573c386e..02935a8597 100644 --- a/src/gui/editors/aircraftmodelform.h +++ b/src/gui/editors/aircraftmodelform.h @@ -29,19 +29,19 @@ namespace swift::gui::editors explicit CAircraftModelForm(QWidget *parent = nullptr); //! Destructor - virtual ~CAircraftModelForm() override; + ~CAircraftModelForm() override; //! Allow to drop data void allowDrop(bool allowDrop); //! \copydoc swift::gui::editors::CForm::setReadOnly - virtual void setReadOnly(bool readOnly) override; + void setReadOnly(bool readOnly) override; //! \copydoc swift::gui::editors::CForm::setSelectOnly - virtual void setSelectOnly() override; + void setSelectOnly() override; //! \copydoc swift::gui::editors::CForm::validate - virtual swift::misc::CStatusMessageList validate(bool withNestedForms = true) const override; + swift::misc::CStatusMessageList validate(bool withNestedForms = true) const override; //! \copydoc swift::gui::editors::CForm::validate virtual swift::misc::CStatusMessageList validateLivery(bool withNestedForms = true) const; diff --git a/src/gui/editors/aircraftpartsform.cpp b/src/gui/editors/aircraftpartsform.cpp index bbaae96150..889d90a8f4 100644 --- a/src/gui/editors/aircraftpartsform.cpp +++ b/src/gui/editors/aircraftpartsform.cpp @@ -32,7 +32,7 @@ namespace swift::gui::editors &CAircraftPartsForm::changeAircraftParts); // force change signal } - CAircraftPartsForm::~CAircraftPartsForm() {} + CAircraftPartsForm::~CAircraftPartsForm() = default; void CAircraftPartsForm::setReadOnly(bool readonly) { diff --git a/src/gui/editors/aircraftpartsform.h b/src/gui/editors/aircraftpartsform.h index f26f48f166..9b879552da 100644 --- a/src/gui/editors/aircraftpartsform.h +++ b/src/gui/editors/aircraftpartsform.h @@ -31,13 +31,13 @@ namespace swift::gui::editors explicit CAircraftPartsForm(QWidget *parent = nullptr); //! Destructor - virtual ~CAircraftPartsForm() override; + ~CAircraftPartsForm() override; //! \name Form class implementations //! @{ - virtual void setReadOnly(bool readonly) override; - virtual void setSelectOnly() override; - virtual swift::misc::CStatusMessageList validate(bool nested = false) const override; + void setReadOnly(bool readonly) override; + void setSelectOnly() override; + swift::misc::CStatusMessageList validate(bool nested = false) const override; //! @} //! Get the parts diff --git a/src/gui/editors/airlineicaoform.cpp b/src/gui/editors/airlineicaoform.cpp index 83c73651c7..e4aa5887da 100644 --- a/src/gui/editors/airlineicaoform.cpp +++ b/src/gui/editors/airlineicaoform.cpp @@ -53,7 +53,7 @@ namespace swift::gui::editors { qMetaTypeId(), qMetaTypeId() }); } - CAirlineIcaoForm::~CAirlineIcaoForm() {} + CAirlineIcaoForm::~CAirlineIcaoForm() = default; void CAirlineIcaoForm::setValue(const CAirlineIcaoCode &icao) { diff --git a/src/gui/editors/airlineicaoform.h b/src/gui/editors/airlineicaoform.h index 4ef7271b66..0d9c883042 100644 --- a/src/gui/editors/airlineicaoform.h +++ b/src/gui/editors/airlineicaoform.h @@ -34,7 +34,7 @@ namespace swift::gui::editors explicit CAirlineIcaoForm(QWidget *parent = nullptr); //! Destructor - virtual ~CAirlineIcaoForm() override; + ~CAirlineIcaoForm() override; //! Set value void setValue(const swift::misc::aviation::CAirlineIcaoCode &icao = swift::misc::aviation::CAirlineIcaoCode()); @@ -50,9 +50,9 @@ namespace swift::gui::editors //! \name Form class implementations //! @{ - virtual void setReadOnly(bool readonly) override; - virtual void setSelectOnly() override; - virtual swift::misc::CStatusMessageList validate(bool nested = false) const override; + void setReadOnly(bool readonly) override; + void setSelectOnly() override; + swift::misc::CStatusMessageList validate(bool nested = false) const override; //! @} //! Clear @@ -70,7 +70,7 @@ namespace swift::gui::editors protected: //! \copydoc CForm::jsonPasted - virtual void jsonPasted(const QString &json) override; + void jsonPasted(const QString &json) override; //! Variant has been dropped void onDroppedCode(const swift::misc::CVariant &variantDropped); diff --git a/src/gui/editors/cockpitcomform.cpp b/src/gui/editors/cockpitcomform.cpp index b9e6896e12..ea2d4d1d37 100644 --- a/src/gui/editors/cockpitcomform.cpp +++ b/src/gui/editors/cockpitcomform.cpp @@ -66,7 +66,7 @@ namespace swift::gui::editors this->initLeds(); } - CCockpitComForm::~CCockpitComForm() {} + CCockpitComForm::~CCockpitComForm() = default; void CCockpitComForm::setReadOnly(bool readonly) { diff --git a/src/gui/editors/cockpitcomform.h b/src/gui/editors/cockpitcomform.h index 089298a3a5..8b6c052e10 100644 --- a/src/gui/editors/cockpitcomform.h +++ b/src/gui/editors/cockpitcomform.h @@ -32,7 +32,7 @@ namespace swift::gui::editors explicit CCockpitComForm(QWidget *parent = nullptr); //! Destrutor - virtual ~CCockpitComForm() override; + ~CCockpitComForm() override; //! COM frequencies displayed void setFrequencies(const swift::misc::aviation::CComSystem &com1, @@ -55,9 +55,9 @@ namespace swift::gui::editors //! \name Form class implementations //! @{ - virtual void setReadOnly(bool readonly) override; - virtual void setSelectOnly() override; - virtual swift::misc::CStatusMessageList validate(bool nested = false) const override; + void setReadOnly(bool readonly) override; + void setSelectOnly() override; + swift::misc::CStatusMessageList validate(bool nested = false) const override; //! @} signals: diff --git a/src/gui/editors/coordinateform.cpp b/src/gui/editors/coordinateform.cpp index 7106c45cfb..0780b77f12 100644 --- a/src/gui/editors/coordinateform.cpp +++ b/src/gui/editors/coordinateform.cpp @@ -62,7 +62,7 @@ namespace swift::gui::editors this->setCoordinate(c); } - CCoordinateForm::~CCoordinateForm() {} + CCoordinateForm::~CCoordinateForm() = default; bool CCoordinateForm::setCoordinate(const ICoordinateGeodetic &coordinate) { diff --git a/src/gui/editors/coordinateform.h b/src/gui/editors/coordinateform.h index e05f0775a7..fda932adbc 100644 --- a/src/gui/editors/coordinateform.h +++ b/src/gui/editors/coordinateform.h @@ -29,7 +29,7 @@ namespace swift::gui::editors explicit CCoordinateForm(QWidget *parent = nullptr); //! Dtor - virtual ~CCoordinateForm() override; + ~CCoordinateForm() override; //! Get the coordinate swift::misc::geo::CCoordinateGeodetic getCoordinate() const { return m_coordinate; } @@ -39,8 +39,8 @@ namespace swift::gui::editors //! \name Form class implementations //! @{ - virtual void setReadOnly(bool readonly) override; - virtual swift::misc::CStatusMessageList validate(bool nested = false) const override; + void setReadOnly(bool readonly) override; + swift::misc::CStatusMessageList validate(bool nested = false) const override; //! @} //! Set button visible diff --git a/src/gui/editors/distributorform.cpp b/src/gui/editors/distributorform.cpp index 6abb1220ba..bcb93d9790 100644 --- a/src/gui/editors/distributorform.cpp +++ b/src/gui/editors/distributorform.cpp @@ -41,7 +41,7 @@ namespace swift::gui::editors ui->drop_DropData->setAcceptedMetaTypeIds({ qMetaTypeId(), qMetaTypeId() }); } - CDistributorForm::~CDistributorForm() {} + CDistributorForm::~CDistributorForm() = default; bool CDistributorForm::setValue(const swift::misc::simulation::CDistributor &distributor) { diff --git a/src/gui/editors/distributorform.h b/src/gui/editors/distributorform.h index ab9f1c9c78..3bdf0b3490 100644 --- a/src/gui/editors/distributorform.h +++ b/src/gui/editors/distributorform.h @@ -33,7 +33,7 @@ namespace swift::gui::editors explicit CDistributorForm(QWidget *parent = nullptr); //! Destructor - virtual ~CDistributorForm() override; + ~CDistributorForm() override; //! Get value swift::misc::simulation::CDistributor getValue() const; @@ -46,9 +46,9 @@ namespace swift::gui::editors //! \name Form class implementations //! @{ - virtual void setReadOnly(bool readonly) override; - virtual void setSelectOnly() override; - virtual swift::misc::CStatusMessageList validate(bool nested = false) const override; + void setReadOnly(bool readonly) override; + void setSelectOnly() override; + swift::misc::CStatusMessageList validate(bool nested = false) const override; //! @} //! Clear @@ -60,7 +60,7 @@ namespace swift::gui::editors protected: //! \copydoc CForm::jsonPasted - virtual void jsonPasted(const QString &json) override; + void jsonPasted(const QString &json) override; private: //! Variant has been dropped diff --git a/src/gui/editors/form.cpp b/src/gui/editors/form.cpp index 9d0ea1fdd6..a7f6617422 100644 --- a/src/gui/editors/form.cpp +++ b/src/gui/editors/form.cpp @@ -16,7 +16,7 @@ namespace swift::gui::editors { CForm::CForm(QWidget *parent) : COverlayMessagesFrame(parent) {} - CForm::~CForm() {} + CForm::~CForm() = default; void CForm::setSelectOnly() { this->setReadOnly(true); } @@ -48,7 +48,7 @@ namespace swift::gui::editors CFormDbUser::CFormDbUser(QWidget *parent) : CForm(parent) {} - CFormDbUser::~CFormDbUser() {} + CFormDbUser::~CFormDbUser() = default; CAuthenticatedUser CFormDbUser::getSwiftDbUser() const { return m_swiftDbUser.get(); } diff --git a/src/gui/editors/form.h b/src/gui/editors/form.h index abb2e1e415..0eb2e1f3cd 100644 --- a/src/gui/editors/form.h +++ b/src/gui/editors/form.h @@ -32,7 +32,7 @@ namespace swift::gui::editors explicit CForm(QWidget *parent = nullptr); //! Destructor - virtual ~CForm() override; + ~CForm() override; //! Set editable virtual void setReadOnly(bool readOnly) = 0; @@ -77,7 +77,7 @@ namespace swift::gui::editors explicit CFormDbUser(QWidget *parent = nullptr); //! Destructor - virtual ~CFormDbUser() override; + ~CFormDbUser() override; //! Authenticated DB user swift::misc::network::CAuthenticatedUser getSwiftDbUser() const; diff --git a/src/gui/editors/fsdsetupform.h b/src/gui/editors/fsdsetupform.h index 3d14173595..8e85c5b9b7 100644 --- a/src/gui/editors/fsdsetupform.h +++ b/src/gui/editors/fsdsetupform.h @@ -30,7 +30,7 @@ namespace swift::gui::editors explicit CFsdSetupForm(QWidget *parent = nullptr); //! Constructor - virtual ~CFsdSetupForm() override; + ~CFsdSetupForm() override; //! FSD setup from GUI swift::misc::network::CFsdSetup getValue() const; @@ -58,8 +58,8 @@ namespace swift::gui::editors //! \name Form class implementations //! @{ - virtual void setReadOnly(bool readonly) override; - virtual swift::misc::CStatusMessageList validate(bool nested = false) const override; + void setReadOnly(bool readonly) override; + swift::misc::CStatusMessageList validate(bool nested = false) const override; //! @} private: diff --git a/src/gui/editors/interpolationsetupform.cpp b/src/gui/editors/interpolationsetupform.cpp index 316ddc0a6c..8bd7fb8fd6 100644 --- a/src/gui/editors/interpolationsetupform.cpp +++ b/src/gui/editors/interpolationsetupform.cpp @@ -30,7 +30,7 @@ namespace swift::gui::editors connect(ui->le_PitchOnGround, &QLineEdit::editingFinished, this, &CInterpolationSetupForm::onPitchChanged); } - CInterpolationSetupForm::~CInterpolationSetupForm() {} + CInterpolationSetupForm::~CInterpolationSetupForm() = default; void CInterpolationSetupForm::setValue(const CInterpolationAndRenderingSetupBase &setup) { diff --git a/src/gui/editors/interpolationsetupform.h b/src/gui/editors/interpolationsetupform.h index 6453b7148c..b61d2a3052 100644 --- a/src/gui/editors/interpolationsetupform.h +++ b/src/gui/editors/interpolationsetupform.h @@ -30,7 +30,7 @@ namespace swift::gui::editors explicit CInterpolationSetupForm(QWidget *parent = nullptr); //! Destructor - virtual ~CInterpolationSetupForm() override; + ~CInterpolationSetupForm() override; //! Set value void setValue(const swift::misc::simulation::CInterpolationAndRenderingSetupBase &setup); @@ -40,8 +40,8 @@ namespace swift::gui::editors //! \name Form class implementations //! @{ - virtual void setReadOnly(bool readonly) override; - virtual swift::misc::CStatusMessageList validate(bool nested = false) const override; + void setReadOnly(bool readonly) override; + swift::misc::CStatusMessageList validate(bool nested = false) const override; //! @} signals: diff --git a/src/gui/editors/liveryform.cpp b/src/gui/editors/liveryform.cpp index 133ca4103b..a26aebada6 100644 --- a/src/gui/editors/liveryform.cpp +++ b/src/gui/editors/liveryform.cpp @@ -60,7 +60,7 @@ namespace swift::gui::editors connect(ui->pb_SearchColor, &QPushButton::pressed, this, &CLiveryForm::searchForColor); } - CLiveryForm::~CLiveryForm() {} + CLiveryForm::~CLiveryForm() = default; CLivery CLiveryForm::getValue() const { diff --git a/src/gui/editors/liveryform.h b/src/gui/editors/liveryform.h index b9da38b5d1..b9b16cb373 100644 --- a/src/gui/editors/liveryform.h +++ b/src/gui/editors/liveryform.h @@ -37,7 +37,7 @@ namespace swift::gui::editors explicit CLiveryForm(QWidget *parent = nullptr); //! Destructor - virtual ~CLiveryForm() override; + ~CLiveryForm() override; //! Value swift::misc::aviation::CLivery getValue() const; @@ -56,9 +56,9 @@ namespace swift::gui::editors //! \name Form class implementations //! @{ - virtual void setReadOnly(bool readonly) override; - virtual void setSelectOnly() override; - virtual swift::misc::CStatusMessageList validate(bool withNestedForms) const override; + void setReadOnly(bool readonly) override; + void setSelectOnly() override; + swift::misc::CStatusMessageList validate(bool withNestedForms) const override; //! @} //! Clear data @@ -72,7 +72,7 @@ namespace swift::gui::editors protected: //! \copydoc CForm::jsonPasted - virtual void jsonPasted(const QString &json) override; + void jsonPasted(const QString &json) override; private: //! Livery dropped diff --git a/src/gui/editors/matchingform.cpp b/src/gui/editors/matchingform.cpp index b2b65de0c6..7468e7a060 100644 --- a/src/gui/editors/matchingform.cpp +++ b/src/gui/editors/matchingform.cpp @@ -41,7 +41,7 @@ namespace swift::gui::editors Qt::QueuedConnection); } - CMatchingForm::~CMatchingForm() {} + CMatchingForm::~CMatchingForm() = default; void CMatchingForm::setReadOnly(bool readonly) { diff --git a/src/gui/editors/matchingform.h b/src/gui/editors/matchingform.h index 9188f484ab..49e8b09967 100644 --- a/src/gui/editors/matchingform.h +++ b/src/gui/editors/matchingform.h @@ -28,12 +28,12 @@ namespace swift::gui::editors explicit CMatchingForm(QWidget *parent = nullptr); //! Destructor - virtual ~CMatchingForm() override; + ~CMatchingForm() override; //! \name Form class implementations //! @{ - virtual void setReadOnly(bool readonly) override; - virtual swift::misc::CStatusMessageList validate(bool withNestedForms) const override; + void setReadOnly(bool readonly) override; + swift::misc::CStatusMessageList validate(bool withNestedForms) const override; //! @} //! Set valued diff --git a/src/gui/editors/modelmappingform.cpp b/src/gui/editors/modelmappingform.cpp index d9f62362bf..ae78c0763c 100644 --- a/src/gui/editors/modelmappingform.cpp +++ b/src/gui/editors/modelmappingform.cpp @@ -43,7 +43,7 @@ namespace swift::gui::editors this->userChanged(); } - CModelMappingForm::~CModelMappingForm() {} + CModelMappingForm::~CModelMappingForm() = default; swift::misc::simulation::CAircraftModel CModelMappingForm::getValue() const { diff --git a/src/gui/editors/modelmappingform.h b/src/gui/editors/modelmappingform.h index 2c6a805f54..4efa234174 100644 --- a/src/gui/editors/modelmappingform.h +++ b/src/gui/editors/modelmappingform.h @@ -32,7 +32,7 @@ namespace swift::gui::editors explicit CModelMappingForm(QWidget *parent = nullptr); //! Destructor - virtual ~CModelMappingForm() override; + ~CModelMappingForm() override; //! Value swift::misc::simulation::CAircraftModel getValue() const; @@ -41,9 +41,9 @@ namespace swift::gui::editors //! \name Form class implementations //! @{ - virtual void setReadOnly(bool readonly) override; - virtual void setSelectOnly() override; - virtual swift::misc::CStatusMessageList validate(bool withNestedObjects) const override; + void setReadOnly(bool readonly) override; + void setSelectOnly() override; + swift::misc::CStatusMessageList validate(bool withNestedObjects) const override; //! @} //! Set model @@ -55,7 +55,7 @@ namespace swift::gui::editors protected: //! \copydoc CFormDbUser::userChanged - virtual void userChanged() override; + void userChanged() override; private: //! CG (aka vertical offset) from UI diff --git a/src/gui/editors/modelmappingmodifyform.cpp b/src/gui/editors/modelmappingmodifyform.cpp index 947163b90e..1a29d76723 100644 --- a/src/gui/editors/modelmappingmodifyform.cpp +++ b/src/gui/editors/modelmappingmodifyform.cpp @@ -46,10 +46,7 @@ namespace swift::gui::editors connect(ui->le_CG, &QLineEdit::editingFinished, this, &CModelMappingModifyForm::onCGEdited); } - CModelMappingModifyForm::~CModelMappingModifyForm() - { - // void - } + CModelMappingModifyForm::~CModelMappingModifyForm() = default; CPropertyIndexVariantMap CModelMappingModifyForm::getValues() const { diff --git a/src/gui/editors/modelmappingmodifyform.h b/src/gui/editors/modelmappingmodifyform.h index fe179dd42f..70c5da5b69 100644 --- a/src/gui/editors/modelmappingmodifyform.h +++ b/src/gui/editors/modelmappingmodifyform.h @@ -38,7 +38,7 @@ namespace swift::gui::editors explicit CModelMappingModifyForm(QWidget *parent = nullptr); //! Destructor - virtual ~CModelMappingModifyForm() override; + ~CModelMappingModifyForm() override; //! Get the values swift::misc::CPropertyIndexVariantMap getValues() const; @@ -47,11 +47,11 @@ namespace swift::gui::editors void setValue(const swift::misc::simulation::CAircraftModel &model); //! \copydoc CForm::setReadOnly - virtual void setReadOnly(bool readOnly) override; + void setReadOnly(bool readOnly) override; protected: //! \copydoc CFormDbUser::userChanged - virtual void userChanged() override; + void userChanged() override; private: //! Return pressed diff --git a/src/gui/editors/ownmodelsetform.cpp b/src/gui/editors/ownmodelsetform.cpp index 71b69148fe..052b5a7a31 100644 --- a/src/gui/editors/ownmodelsetform.cpp +++ b/src/gui/editors/ownmodelsetform.cpp @@ -44,10 +44,7 @@ namespace swift::gui::editors }); } - COwnModelSetForm::~COwnModelSetForm() - { - // void - } + COwnModelSetForm::~COwnModelSetForm() = default; void COwnModelSetForm::reloadData() { diff --git a/src/gui/editors/ownmodelsetform.h b/src/gui/editors/ownmodelsetform.h index 78d12a3cf3..1a2336fa14 100644 --- a/src/gui/editors/ownmodelsetform.h +++ b/src/gui/editors/ownmodelsetform.h @@ -30,7 +30,7 @@ namespace swift::gui::editors explicit COwnModelSetForm(QWidget *parent = nullptr); //! Destructor - virtual ~COwnModelSetForm() override; + ~COwnModelSetForm() override; //! Reload data void reloadData(); @@ -79,7 +79,7 @@ namespace swift::gui::editors //! \name Form functions, here not used //! @{ - virtual void setReadOnly(bool readOnly) override { Q_UNUSED(readOnly); } + void setReadOnly(bool readOnly) override { Q_UNUSED(readOnly); } //! @} signals: diff --git a/src/gui/editors/pbhsform.cpp b/src/gui/editors/pbhsform.cpp index 0e3a6fd6ad..54ffccc932 100644 --- a/src/gui/editors/pbhsform.cpp +++ b/src/gui/editors/pbhsform.cpp @@ -35,7 +35,7 @@ namespace swift::gui::editors connect(ui->pb_SetOwnAircraft, &QPushButton::released, this, &CPbhsForm::changeValues); } - CPbhsForm::~CPbhsForm() {} + CPbhsForm::~CPbhsForm() = default; CAngle CPbhsForm::getBankAngle() const { return CAngle(getBankAngleDegrees(), CAngleUnit::deg()); } diff --git a/src/gui/editors/pbhsform.h b/src/gui/editors/pbhsform.h index 70e8f7aa63..f72a708129 100644 --- a/src/gui/editors/pbhsform.h +++ b/src/gui/editors/pbhsform.h @@ -31,7 +31,7 @@ namespace swift::gui::editors explicit CPbhsForm(QWidget *parent = nullptr); //! Dtor - virtual ~CPbhsForm() override; + ~CPbhsForm() override; //! Get bank angle swift::misc::physical_quantities::CAngle getBankAngle() const; @@ -64,7 +64,7 @@ namespace swift::gui::editors void updateSituation(swift::misc::aviation::CAircraftSituation &situation); //! \copydoc CForm::setReadOnly - virtual void setReadOnly(bool readOnly) override; + void setReadOnly(bool readOnly) override; //! Show the "SET" button void showSetButton(bool visible); diff --git a/src/gui/editors/pilotform.cpp b/src/gui/editors/pilotform.cpp index 9f4e832ec1..904007da79 100644 --- a/src/gui/editors/pilotform.cpp +++ b/src/gui/editors/pilotform.cpp @@ -39,7 +39,7 @@ namespace swift::gui::editors connect(ui->le_RealName, &QLineEdit::editingFinished, this, &CPilotForm::doValidation); } - CPilotForm::~CPilotForm() {} + CPilotForm::~CPilotForm() = default; void CPilotForm::setVatsimValidation(bool vatsim) { diff --git a/src/gui/editors/pilotform.h b/src/gui/editors/pilotform.h index 5a94804ea4..d8d4a1625c 100644 --- a/src/gui/editors/pilotform.h +++ b/src/gui/editors/pilotform.h @@ -31,7 +31,7 @@ namespace swift::gui::editors explicit CPilotForm(QWidget *parent = nullptr); //! Destructor - virtual ~CPilotForm() override; + ~CPilotForm() override; //! Set VATSIM validation mode void setVatsimValidation(bool vatsim); @@ -47,8 +47,8 @@ namespace swift::gui::editors //! \name Form class implementations //! @{ - virtual void setReadOnly(bool readonly) override; - virtual swift::misc::CStatusMessageList validate(bool nested = false) const override; + void setReadOnly(bool readonly) override; + swift::misc::CStatusMessageList validate(bool nested = false) const override; //! @} private: diff --git a/src/gui/editors/relativeaircraftposition.cpp b/src/gui/editors/relativeaircraftposition.cpp index 426b6dedc2..78c8bbee8f 100644 --- a/src/gui/editors/relativeaircraftposition.cpp +++ b/src/gui/editors/relativeaircraftposition.cpp @@ -16,7 +16,7 @@ namespace swift::gui::editors ui->setupUi(this); } - CRelativeAircraftPosition::~CRelativeAircraftPosition() {} + CRelativeAircraftPosition::~CRelativeAircraftPosition() = default; void CRelativeAircraftPosition::setReadOnly(bool readOnly) { diff --git a/src/gui/editors/relativeaircraftposition.h b/src/gui/editors/relativeaircraftposition.h index cd3bec8e82..3626649e1e 100644 --- a/src/gui/editors/relativeaircraftposition.h +++ b/src/gui/editors/relativeaircraftposition.h @@ -28,10 +28,10 @@ namespace swift::gui::editors explicit CRelativeAircraftPosition(QWidget *parent = nullptr); //! Destructor - virtual ~CRelativeAircraftPosition() override; + ~CRelativeAircraftPosition() override; //! \copydoc CForm::setReadOnly - virtual void setReadOnly(bool readOnly) override; + void setReadOnly(bool readOnly) override; //! Set origin coordinate void setOriginCoordinate(const swift::misc::geo::CCoordinateGeodetic &originCoordinate) diff --git a/src/gui/editors/serverform.cpp b/src/gui/editors/serverform.cpp index fe35a15dae..37771fe1b2 100644 --- a/src/gui/editors/serverform.cpp +++ b/src/gui/editors/serverform.cpp @@ -28,7 +28,7 @@ namespace swift::gui::editors connect(ui->tb_Unhide, &QToolButton::clicked, this, &CServerForm::tempUnhidePassword); } - CServerForm::~CServerForm() {} + CServerForm::~CServerForm() = default; void CServerForm::setServer(const CServer &server) { diff --git a/src/gui/editors/serverform.h b/src/gui/editors/serverform.h index af22b7abda..4bc1a84ae6 100644 --- a/src/gui/editors/serverform.h +++ b/src/gui/editors/serverform.h @@ -32,7 +32,7 @@ namespace swift::gui::editors explicit CServerForm(QWidget *parent = nullptr); //! Destructor - virtual ~CServerForm() override; + ~CServerForm() override; //! Set server void setServer(const swift::misc::network::CServer &server); @@ -48,8 +48,8 @@ namespace swift::gui::editors //! \name Form class implementations //! @{ - virtual void setReadOnly(bool readonly) override; - virtual swift::misc::CStatusMessageList validate(bool nested = false) const override; + void setReadOnly(bool readonly) override; + swift::misc::CStatusMessageList validate(bool nested = false) const override; //! @} //! Show the password field diff --git a/src/gui/editors/situationform.cpp b/src/gui/editors/situationform.cpp index e41de56408..0d2d19dca6 100644 --- a/src/gui/editors/situationform.cpp +++ b/src/gui/editors/situationform.cpp @@ -49,7 +49,7 @@ namespace swift::gui::editors connect(ui->comp_Coordinate, &CCoordinateForm::changedCoordinate, this, &CSituationForm::onCoordinateChanged); } - CSituationForm::~CSituationForm() {} + CSituationForm::~CSituationForm() = default; void CSituationForm::setSituation(const swift::misc::aviation::CAircraftSituation &situation) { diff --git a/src/gui/editors/situationform.h b/src/gui/editors/situationform.h index 21640a6fdc..7bb65152c6 100644 --- a/src/gui/editors/situationform.h +++ b/src/gui/editors/situationform.h @@ -31,7 +31,7 @@ namespace swift::gui::editors explicit CSituationForm(QWidget *parent = nullptr); //! Destructor - virtual ~CSituationForm() override; + ~CSituationForm() override; //! Set the situation void setSituation(const swift::misc::aviation::CAircraftSituation &situation); @@ -41,9 +41,9 @@ namespace swift::gui::editors //! \name Form class implementations //! @{ - virtual void setReadOnly(bool readonly) override; - virtual void setSelectOnly() override; - virtual swift::misc::CStatusMessageList validate(bool nested = false) const override; + void setReadOnly(bool readonly) override; + void setSelectOnly() override; + swift::misc::CStatusMessageList validate(bool nested = false) const override; //! @} //! Set button visible diff --git a/src/gui/editors/validationindicator.cpp b/src/gui/editors/validationindicator.cpp index 16df5406ac..d768cc21b9 100644 --- a/src/gui/editors/validationindicator.cpp +++ b/src/gui/editors/validationindicator.cpp @@ -30,7 +30,7 @@ namespace swift::gui::editors m_resetTimer.start(ResetInterval); } - CValidationIndicator::~CValidationIndicator() {} + CValidationIndicator::~CValidationIndicator() = default; void CValidationIndicator::passed() { diff --git a/src/gui/editors/validationindicator.h b/src/gui/editors/validationindicator.h index 98b7fc635b..8699ad0dcf 100644 --- a/src/gui/editors/validationindicator.h +++ b/src/gui/editors/validationindicator.h @@ -60,7 +60,7 @@ namespace swift::gui::editors protected: //! \copydoc QFrame::paintEvent - virtual void paintEvent(QPaintEvent *paintEvent) override; + void paintEvent(QPaintEvent *paintEvent) override; private: const int ResetInterval = 5000; diff --git a/src/gui/enablefordockwidgetinfoarea.h b/src/gui/enablefordockwidgetinfoarea.h index 0e6745d4d5..39a323d1eb 100644 --- a/src/gui/enablefordockwidgetinfoarea.h +++ b/src/gui/enablefordockwidgetinfoarea.h @@ -56,7 +56,7 @@ namespace swift::gui CEnableForDockWidgetInfoArea(CDockWidgetInfoArea *parentInfoArea = nullptr); //! Destructor - virtual ~CEnableForDockWidgetInfoArea() {} + virtual ~CEnableForDockWidgetInfoArea() = default; CDockWidgetInfoArea *m_parentDockableInfoArea = nullptr; //!< my parent dockable widget swift::misc::CConnectionGuard m_connections; //!< connections diff --git a/src/gui/enableforframelesswindow.h b/src/gui/enableforframelesswindow.h index 9d71a0a749..41b4c51030 100644 --- a/src/gui/enableforframelesswindow.h +++ b/src/gui/enableforframelesswindow.h @@ -48,7 +48,7 @@ namespace swift::gui QWidget *correspondingWidget); //! Destructor - virtual ~CEnableForFramelessWindow() {} + virtual ~CEnableForFramelessWindow() = default; //! Copy constructor CEnableForFramelessWindow(const CEnableForFramelessWindow &) = delete; diff --git a/src/gui/filters/aircrafticaofilterbar.cpp b/src/gui/filters/aircrafticaofilterbar.cpp index 59530ab9f1..4bd7f59e17 100644 --- a/src/gui/filters/aircrafticaofilterbar.cpp +++ b/src/gui/filters/aircrafticaofilterbar.cpp @@ -52,7 +52,7 @@ namespace swift::gui::filters this->clearForm(); } - CAircraftIcaoFilterBar::~CAircraftIcaoFilterBar() {} + CAircraftIcaoFilterBar::~CAircraftIcaoFilterBar() = default; std::unique_ptr> CAircraftIcaoFilterBar::createModelFilter() const diff --git a/src/gui/filters/aircrafticaofilterbar.h b/src/gui/filters/aircrafticaofilterbar.h index a885ee59ae..b2a7ca8039 100644 --- a/src/gui/filters/aircrafticaofilterbar.h +++ b/src/gui/filters/aircrafticaofilterbar.h @@ -40,7 +40,7 @@ namespace swift::gui::filters explicit CAircraftIcaoFilterBar(QWidget *parent = nullptr); //! Destructor - virtual ~CAircraftIcaoFilterBar() override; + ~CAircraftIcaoFilterBar() override; //! \copydoc models::IModelFilterProvider::createModelFilter std::unique_ptr> @@ -54,7 +54,7 @@ namespace swift::gui::filters public slots: //! \copydoc CFilterWidget::onRowCountChanged - virtual void onRowCountChanged(int count, bool withFilter) override; + void onRowCountChanged(int count, bool withFilter) override; protected: //! \copydoc CFilterWidget::clearForm diff --git a/src/gui/filters/aircraftmodelfilterbar.cpp b/src/gui/filters/aircraftmodelfilterbar.cpp index 0346b188df..e1c1808685 100644 --- a/src/gui/filters/aircraftmodelfilterbar.cpp +++ b/src/gui/filters/aircraftmodelfilterbar.cpp @@ -60,7 +60,7 @@ namespace swift::gui::filters }); } - CAircraftModelFilterBar::~CAircraftModelFilterBar() {} + CAircraftModelFilterBar::~CAircraftModelFilterBar() = default; void CAircraftModelFilterBar::displayCount(bool show) { ui->filter_Buttons->displayCount(show); } diff --git a/src/gui/filters/aircraftmodelfilterbar.h b/src/gui/filters/aircraftmodelfilterbar.h index ee437b21d0..d5d038d297 100644 --- a/src/gui/filters/aircraftmodelfilterbar.h +++ b/src/gui/filters/aircraftmodelfilterbar.h @@ -41,21 +41,21 @@ namespace swift::gui::filters explicit CAircraftModelFilterBar(QWidget *parent = nullptr); //! Destructor - virtual ~CAircraftModelFilterBar() override; + ~CAircraftModelFilterBar() override; //! Show count void displayCount(bool show); //! \copydoc models::IModelFilterProvider::createModelFilter - virtual std::unique_ptr> + std::unique_ptr> createModelFilter() const override; //! \copydoc CFilterWidget::onRowCountChanged - virtual void onRowCountChanged(int count, bool withFilter) override; + void onRowCountChanged(int count, bool withFilter) override; protected: //! \copydoc CFilterWidget::clearForm - virtual void clearForm() override; + void clearForm() override; private: //! Simulator selection changed diff --git a/src/gui/filters/aircraftmodelfilterdialog.cpp b/src/gui/filters/aircraftmodelfilterdialog.cpp index f4f4096816..16f74b07b9 100644 --- a/src/gui/filters/aircraftmodelfilterdialog.cpp +++ b/src/gui/filters/aircraftmodelfilterdialog.cpp @@ -24,7 +24,7 @@ namespace swift::gui::filters connect(ui->filter_Models, &CAircraftModelFilterBar::rejectDialog, this, &CAircraftModelFilterDialog::reject); } - CAircraftModelFilterDialog::~CAircraftModelFilterDialog() {} + CAircraftModelFilterDialog::~CAircraftModelFilterDialog() = default; std::unique_ptr> CAircraftModelFilterDialog::createModelFilter() const { diff --git a/src/gui/filters/aircraftmodelfilterdialog.h b/src/gui/filters/aircraftmodelfilterdialog.h index 2825562014..b800a58e4d 100644 --- a/src/gui/filters/aircraftmodelfilterdialog.h +++ b/src/gui/filters/aircraftmodelfilterdialog.h @@ -40,10 +40,10 @@ namespace swift::gui::filters explicit CAircraftModelFilterDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CAircraftModelFilterDialog() override; + ~CAircraftModelFilterDialog() override; //! \copydoc models::IModelFilterProvider::createModelFilter - virtual std::unique_ptr> + std::unique_ptr> createModelFilter() const override; private: diff --git a/src/gui/filters/airlineicaofilterbar.cpp b/src/gui/filters/airlineicaofilterbar.cpp index 765ada0bd4..b107224950 100644 --- a/src/gui/filters/airlineicaofilterbar.cpp +++ b/src/gui/filters/airlineicaofilterbar.cpp @@ -43,7 +43,7 @@ namespace swift::gui::filters this->clearForm(); } - CAirlineIcaoFilterBar::~CAirlineIcaoFilterBar() {} + CAirlineIcaoFilterBar::~CAirlineIcaoFilterBar() = default; std::unique_ptr> CAirlineIcaoFilterBar::createModelFilter() const { diff --git a/src/gui/filters/airlineicaofilterbar.h b/src/gui/filters/airlineicaofilterbar.h index 48ecdf6e4d..8e72fcdd3e 100644 --- a/src/gui/filters/airlineicaofilterbar.h +++ b/src/gui/filters/airlineicaofilterbar.h @@ -41,10 +41,10 @@ namespace swift::gui::filters explicit CAirlineIcaoFilterBar(QWidget *parent = nullptr); //! Destructor - virtual ~CAirlineIcaoFilterBar() override; + ~CAirlineIcaoFilterBar() override; //! \copydoc models::IModelFilterProvider::createModelFilter - virtual std::unique_ptr> + std::unique_ptr> createModelFilter() const override; //! Filter default values by ICAO code @@ -52,7 +52,7 @@ namespace swift::gui::filters public slots: //! \copydoc CFilterWidget::onRowCountChanged - virtual void onRowCountChanged(int count, bool withFilter) override; + void onRowCountChanged(int count, bool withFilter) override; private slots: //! Country has been changed @@ -60,7 +60,7 @@ namespace swift::gui::filters protected: //! Clear form - virtual void clearForm() override; + void clearForm() override; private: QScopedPointer ui; diff --git a/src/gui/filters/countryfilterbar.cpp b/src/gui/filters/countryfilterbar.cpp index bcadce0683..d655637e3f 100644 --- a/src/gui/filters/countryfilterbar.cpp +++ b/src/gui/filters/countryfilterbar.cpp @@ -32,7 +32,7 @@ namespace swift::gui::filters this->clearForm(); } - CCountryFilterBar::~CCountryFilterBar() {} + CCountryFilterBar::~CCountryFilterBar() = default; std::unique_ptr> CCountryFilterBar::createModelFilter() const { diff --git a/src/gui/filters/countryfilterbar.h b/src/gui/filters/countryfilterbar.h index a413aa2bb1..bd5129813a 100644 --- a/src/gui/filters/countryfilterbar.h +++ b/src/gui/filters/countryfilterbar.h @@ -41,19 +41,18 @@ namespace swift::gui::filters explicit CCountryFilterBar(QWidget *parent = nullptr); //! Destructor - virtual ~CCountryFilterBar() override; + ~CCountryFilterBar() override; //! \copydoc models::IModelFilterProvider::createModelFilter - virtual std::unique_ptr> - createModelFilter() const override; + std::unique_ptr> createModelFilter() const override; public slots: //! \copydoc CFilterWidget::onRowCountChanged - virtual void onRowCountChanged(int count, bool withFilter) override; + void onRowCountChanged(int count, bool withFilter) override; protected: //! Clear form - virtual void clearForm() override; + void clearForm() override; private: QScopedPointer ui; diff --git a/src/gui/filters/distributorfilterbar.cpp b/src/gui/filters/distributorfilterbar.cpp index 21c2ab125b..a33fc2db70 100644 --- a/src/gui/filters/distributorfilterbar.cpp +++ b/src/gui/filters/distributorfilterbar.cpp @@ -41,7 +41,7 @@ namespace swift::gui::filters }); } - CDistributorFilterBar::~CDistributorFilterBar() {} + CDistributorFilterBar::~CDistributorFilterBar() = default; std::unique_ptr> CDistributorFilterBar::createModelFilter() const { diff --git a/src/gui/filters/distributorfilterbar.h b/src/gui/filters/distributorfilterbar.h index 0f6088d6d4..32d687a080 100644 --- a/src/gui/filters/distributorfilterbar.h +++ b/src/gui/filters/distributorfilterbar.h @@ -40,21 +40,21 @@ namespace swift::gui::filters explicit CDistributorFilterBar(QWidget *parent = nullptr); //! Destructor - virtual ~CDistributorFilterBar() override; + ~CDistributorFilterBar() override; //! Set simulator void setSimulator(const swift::misc::simulation::CSimulatorInfo &simulator); //! \copydoc models::IModelFilterProvider::createModelFilter - virtual std::unique_ptr> + std::unique_ptr> createModelFilter() const override; //! \copydoc CFilterWidget::onRowCountChanged - virtual void onRowCountChanged(int count, bool withFilter) override; + void onRowCountChanged(int count, bool withFilter) override; protected: //! Clear form - virtual void clearForm() override; + void clearForm() override; private: //! Trigger filter by changing a value diff --git a/src/gui/filters/filterbarbuttons.cpp b/src/gui/filters/filterbarbuttons.cpp index 9712e9e38e..e36ea7c6de 100644 --- a/src/gui/filters/filterbarbuttons.cpp +++ b/src/gui/filters/filterbarbuttons.cpp @@ -20,7 +20,7 @@ namespace swift::gui::filters connect(ui->tb_New, &QToolButton::clicked, this, &CFilterBarButtons::ps_buttonClicked); } - CFilterBarButtons::~CFilterBarButtons() {} + CFilterBarButtons::~CFilterBarButtons() = default; void CFilterBarButtons::displayCount(bool show) { ui->le_Count->setVisible(show); } diff --git a/src/gui/filters/filterbarbuttons.h b/src/gui/filters/filterbarbuttons.h index fad5f38183..7f9999e214 100644 --- a/src/gui/filters/filterbarbuttons.h +++ b/src/gui/filters/filterbarbuttons.h @@ -41,7 +41,7 @@ namespace swift::gui::filters explicit CFilterBarButtons(QWidget *parent = nullptr); //! Destructor - virtual ~CFilterBarButtons(); + ~CFilterBarButtons() override; //! Show the counter void displayCount(bool show); diff --git a/src/gui/filters/filterdialog.cpp b/src/gui/filters/filterdialog.cpp index 6336753517..810a08827e 100644 --- a/src/gui/filters/filterdialog.cpp +++ b/src/gui/filters/filterdialog.cpp @@ -19,8 +19,6 @@ namespace swift::gui::filters Qt::QueuedConnection); } - CFilterDialog::~CFilterDialog() {} - void CFilterDialog::onStyleSheetChanged() { const QString qss = sGui->getStyleSheetUtility().style(CStyleSheetUtility::fileNameFilterDialog()); diff --git a/src/gui/filters/filterdialog.h b/src/gui/filters/filterdialog.h index 0cb0abbd7d..d43592ca5e 100644 --- a/src/gui/filters/filterdialog.h +++ b/src/gui/filters/filterdialog.h @@ -25,7 +25,7 @@ namespace swift::gui::filters CFilterDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CFilterDialog(); + ~CFilterDialog() override = default; private: //! Stylesheet changed diff --git a/src/gui/filters/filterwidget.cpp b/src/gui/filters/filterwidget.cpp index 5052bf542c..c2478ea48b 100644 --- a/src/gui/filters/filterwidget.cpp +++ b/src/gui/filters/filterwidget.cpp @@ -20,7 +20,7 @@ namespace swift::gui::filters Qt::QueuedConnection); } - CFilterWidget::~CFilterWidget() {} + CFilterWidget::~CFilterWidget() = default; void CFilterWidget::setButtonsAndCount(CFilterBarButtons *buttons) { diff --git a/src/gui/filters/filterwidget.h b/src/gui/filters/filterwidget.h index 12e84fd619..95837eb240 100644 --- a/src/gui/filters/filterwidget.h +++ b/src/gui/filters/filterwidget.h @@ -26,7 +26,7 @@ namespace swift::gui::filters CFilterWidget(QWidget *parent = nullptr); //! Destructor - virtual ~CFilterWidget(); + ~CFilterWidget() override; //! Row count has been changed virtual void onRowCountChanged(int count, bool withFilter) = 0; diff --git a/src/gui/filters/liveryfilterbar.cpp b/src/gui/filters/liveryfilterbar.cpp index 2b32c5848e..f2d1d7982b 100644 --- a/src/gui/filters/liveryfilterbar.cpp +++ b/src/gui/filters/liveryfilterbar.cpp @@ -46,7 +46,7 @@ namespace swift::gui::filters this->clearForm(); } - CLiveryFilterBar::~CLiveryFilterBar() {} + CLiveryFilterBar::~CLiveryFilterBar() = default; std::unique_ptr> CLiveryFilterBar::createModelFilter() const { diff --git a/src/gui/filters/liveryfilterbar.h b/src/gui/filters/liveryfilterbar.h index 88cbbd1a15..18603c4648 100644 --- a/src/gui/filters/liveryfilterbar.h +++ b/src/gui/filters/liveryfilterbar.h @@ -41,10 +41,10 @@ namespace swift::gui::filters explicit CLiveryFilterBar(QWidget *parent = nullptr); //! Destructor - virtual ~CLiveryFilterBar() override; + ~CLiveryFilterBar() override; //! \copydoc models::IModelFilterProvider::createModelFilter - virtual std::unique_ptr> + std::unique_ptr> createModelFilter() const override; //! Filter by livery values @@ -55,11 +55,11 @@ namespace swift::gui::filters public slots: //! \copydoc CFilterWidget::onRowCountChanged - virtual void onRowCountChanged(int count, bool withFilter) override; + void onRowCountChanged(int count, bool withFilter) override; protected: //! Clear form - virtual void clearForm() override; + void clearForm() override; private: //! Color changed diff --git a/src/gui/filters/statusmessagefilterbar.cpp b/src/gui/filters/statusmessagefilterbar.cpp index d6682f3372..82dc8ef77e 100644 --- a/src/gui/filters/statusmessagefilterbar.cpp +++ b/src/gui/filters/statusmessagefilterbar.cpp @@ -33,9 +33,9 @@ namespace swift::gui::filters this->clearForm(); } - void CStatusMessageFilterBar::displayCount(bool show) { ui->filter_Buttons->displayCount(show); } + CStatusMessageFilterBar::~CStatusMessageFilterBar() = default; - CStatusMessageFilterBar::~CStatusMessageFilterBar() {} + void CStatusMessageFilterBar::displayCount(bool show) { ui->filter_Buttons->displayCount(show); } void CStatusMessageFilterBar::useRadioButtonDescriptiveIcons(bool oneCharacterText) { diff --git a/src/gui/filters/statusmessagefilterbar.h b/src/gui/filters/statusmessagefilterbar.h index d42156dced..e59e1919cb 100644 --- a/src/gui/filters/statusmessagefilterbar.h +++ b/src/gui/filters/statusmessagefilterbar.h @@ -33,22 +33,22 @@ namespace swift::gui::filters void displayCount(bool show); //! Destructor - virtual ~CStatusMessageFilterBar() override; + ~CStatusMessageFilterBar() override; //! Use icons with radio buttons void useRadioButtonDescriptiveIcons(bool oneCharacterText); //! \copydoc models::IModelFilterProvider::createModelFilter - virtual std::unique_ptr> + std::unique_ptr> createModelFilter() const override; public slots: //! \copydoc CFilterWidget::onRowCountChanged - virtual void onRowCountChanged(int count, bool withFilter) override; + void onRowCountChanged(int count, bool withFilter) override; protected: //! \copydoc CFilterWidget::clearForm - virtual void clearForm() override; + void clearForm() override; private: QScopedPointer ui; diff --git a/src/gui/filters/statusmessagefilterdialog.cpp b/src/gui/filters/statusmessagefilterdialog.cpp index c3665c4501..6939793d86 100644 --- a/src/gui/filters/statusmessagefilterdialog.cpp +++ b/src/gui/filters/statusmessagefilterdialog.cpp @@ -24,7 +24,7 @@ namespace swift::gui::filters connect(ui->filter_Messages, &CStatusMessageFilterBar::rejectDialog, this, &CStatusMessageFilterDialog::reject); } - CStatusMessageFilterDialog::~CStatusMessageFilterDialog() {} + CStatusMessageFilterDialog::~CStatusMessageFilterDialog() = default; std::unique_ptr> CStatusMessageFilterDialog::createModelFilter() const { diff --git a/src/gui/filters/statusmessagefilterdialog.h b/src/gui/filters/statusmessagefilterdialog.h index d19be6a605..423af58035 100644 --- a/src/gui/filters/statusmessagefilterdialog.h +++ b/src/gui/filters/statusmessagefilterdialog.h @@ -40,10 +40,10 @@ namespace swift::gui::filters explicit CStatusMessageFilterDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CStatusMessageFilterDialog() override; + ~CStatusMessageFilterDialog() override; //! \copydoc models::IModelFilterProvider::createModelFilter - virtual std::unique_ptr> + std::unique_ptr> createModelFilter() const override; private: diff --git a/src/gui/guiactionbind.cpp b/src/gui/guiactionbind.cpp index 9b33536852..750e3641e6 100644 --- a/src/gui/guiactionbind.cpp +++ b/src/gui/guiactionbind.cpp @@ -23,8 +23,6 @@ namespace swift::gui connect(sApp, &CApplication::aboutToShutdown, this, &CGuiActionBindHandler::unbind); } - CGuiActionBindHandler::~CGuiActionBindHandler() {} - CActionBindings CGuiActionBindHandler::bindMenu(QMenu *menu, const QString &path) { Q_ASSERT(menu); diff --git a/src/gui/guiactionbind.h b/src/gui/guiactionbind.h index 1bb82e9c6b..24e5abde8d 100644 --- a/src/gui/guiactionbind.h +++ b/src/gui/guiactionbind.h @@ -23,7 +23,7 @@ namespace swift::gui public: //! Destructor - virtual ~CGuiActionBindHandler(); + ~CGuiActionBindHandler() override = default; //! Bound function for swift::core::CActionBind void boundFunction(bool enabled); diff --git a/src/gui/infoarea.cpp b/src/gui/infoarea.cpp index 51d83c958f..c6343d41e3 100644 --- a/src/gui/infoarea.cpp +++ b/src/gui/infoarea.cpp @@ -42,8 +42,6 @@ namespace swift::gui this->setWholeInfoAreaFloating(m_infoAreaFloating); } - CInfoArea::~CInfoArea() {} - void CInfoArea::initInfoArea() { // initInfoArea() needs be called after(!) GUI is setup diff --git a/src/gui/infoarea.h b/src/gui/infoarea.h index 7a8d5b377c..8b34467e7c 100644 --- a/src/gui/infoarea.h +++ b/src/gui/infoarea.h @@ -43,7 +43,7 @@ namespace swift::gui public: //! Destructor - virtual ~CInfoArea() override; + ~CInfoArea() override = default; //! Add items to context menu void addToContextMenu(QMenu *menu) const; @@ -165,14 +165,14 @@ namespace swift::gui explicit CInfoArea(QWidget *parent = nullptr); //! \copydoc QWidget::closeEvent - virtual void closeEvent(QCloseEvent *event) override; + void closeEvent(QCloseEvent *event) override; //! \copydoc QWidget::paintEvent - virtual void paintEvent(QPaintEvent *event) override; + void paintEvent(QPaintEvent *event) override; //! \copydoc QWidget::keyPressEvent //! \remarks nor fully sufficient, as the info area is hardly having focus - virtual void keyPressEvent(QKeyEvent *event) override; + void keyPressEvent(QKeyEvent *event) override; //! Preferred size when floating (size hint) virtual QSize getPreferredSizeWhenFloating(int areaIndex) const = 0; diff --git a/src/gui/labelandicon.cpp b/src/gui/labelandicon.cpp index ee153e791a..499308539b 100644 --- a/src/gui/labelandicon.cpp +++ b/src/gui/labelandicon.cpp @@ -11,7 +11,7 @@ namespace swift::gui { CLabelAndIcon::CLabelAndIcon(QWidget *parent) : QFrame(parent), ui(new Ui::CLabelAndIcon) { ui->setupUi(this); } - CLabelAndIcon::~CLabelAndIcon() {} + CLabelAndIcon::~CLabelAndIcon() = default; void CLabelAndIcon::set(const QPixmap &pixmap, const QString &text) { diff --git a/src/gui/labelandicon.h b/src/gui/labelandicon.h index ef5f23cb50..a706cc3658 100644 --- a/src/gui/labelandicon.h +++ b/src/gui/labelandicon.h @@ -33,7 +33,7 @@ namespace swift::gui explicit CLabelAndIcon(QWidget *parent = nullptr); //! Destructor - ~CLabelAndIcon(); + ~CLabelAndIcon() override; //! Set values (left to right) void set(const QPixmap &pixmap, const QString &text); diff --git a/src/gui/led.h b/src/gui/led.h index 3e4cc4dee0..d7d943c5d1 100644 --- a/src/gui/led.h +++ b/src/gui/led.h @@ -72,7 +72,7 @@ namespace swift::gui const QString &offName = "off", int targetWidth = -1, QWidget *parent = nullptr); //! Destructor - virtual ~CLedWidget() override; + ~CLedWidget() override; //! Value bool value() const { return m_blinkState; } @@ -188,10 +188,10 @@ namespace swift::gui void resetState(); //! Paint event - virtual void paintEvent(QPaintEvent *event) override; + void paintEvent(QPaintEvent *event) override; //! Mouse pressed - virtual void mousePressEvent(QMouseEvent *event) override; + void mousePressEvent(QMouseEvent *event) override; //! Set / init LED void setLed(LedColor ledColor = NoColor); diff --git a/src/gui/levelmeter.cpp b/src/gui/levelmeter.cpp index b538fdf801..792230e756 100644 --- a/src/gui/levelmeter.cpp +++ b/src/gui/levelmeter.cpp @@ -25,7 +25,7 @@ namespace swift::gui m_redrawTimer->setObjectName("CLevelMeter"); } - CLevelMeter::~CLevelMeter() {} + CLevelMeter::~CLevelMeter() = default; void CLevelMeter::reset() { diff --git a/src/gui/levelmeter.h b/src/gui/levelmeter.h index 638e876e32..524f9b1de2 100644 --- a/src/gui/levelmeter.h +++ b/src/gui/levelmeter.h @@ -37,7 +37,7 @@ namespace swift::gui CLevelMeter(QWidget *parent = nullptr); //! Destructor - virtual ~CLevelMeter() override; + ~CLevelMeter() override; //! \copydoc QWidget::paintEvent void paintEvent(QPaintEvent *event) override; diff --git a/src/gui/lineedithistory.h b/src/gui/lineedithistory.h index 4466226311..0813ec41f4 100644 --- a/src/gui/lineedithistory.h +++ b/src/gui/lineedithistory.h @@ -41,10 +41,10 @@ namespace swift::gui protected: //! \copydoc QLineEdit::keyPressEvent - virtual void keyPressEvent(QKeyEvent *event) override; + void keyPressEvent(QKeyEvent *event) override; //! \copydoc QLineEdit::keyPressEvent - virtual void contextMenuEvent(QContextMenuEvent *event) override; + void contextMenuEvent(QContextMenuEvent *event) override; private: QStringList m_history; diff --git a/src/gui/loadindicator.h b/src/gui/loadindicator.h index f4508403e7..d19e8490ee 100644 --- a/src/gui/loadindicator.h +++ b/src/gui/loadindicator.h @@ -55,10 +55,10 @@ namespace swift::gui const QColor &color() const { return m_color; } //! \copydoc QWidget::sizeHint - virtual QSize sizeHint() const override; + QSize sizeHint() const override; //! \copydoc QWidget::heightForWidth - virtual int heightForWidth(int w) const override; + int heightForWidth(int w) const override; //! Paint to another painter void paint(QPainter &painter) const; @@ -96,10 +96,10 @@ namespace swift::gui protected: //! \copydoc QWidget::timerEvent - virtual void timerEvent(QTimerEvent *event) override; + void timerEvent(QTimerEvent *event) override; //! \copydoc QWidget::paintEvent - virtual void paintEvent(QPaintEvent *event) override; + void paintEvent(QPaintEvent *event) override; //! Is parent widget visible? bool isParentVisible() const; @@ -124,7 +124,7 @@ namespace swift::gui CLoadIndicatorEnabled(QWidget *usingWidget); //! Destructor - virtual ~CLoadIndicatorEnabled() {} + virtual ~CLoadIndicatorEnabled() = default; //! Copy constructor CLoadIndicatorEnabled(const CLoadIndicatorEnabled &) = delete; diff --git a/src/gui/mainwindowaccess.cpp b/src/gui/mainwindowaccess.cpp index 89d9310d51..7095801565 100644 --- a/src/gui/mainwindowaccess.cpp +++ b/src/gui/mainwindowaccess.cpp @@ -11,10 +11,7 @@ using namespace swift::misc; namespace swift::gui { - IMainWindowAccess::~IMainWindowAccess() - { - // void - } + IMainWindowAccess::~IMainWindowAccess() = default; bool IMainWindowAccess::displayInStatusBar(const CStatusMessage &message) { diff --git a/src/gui/mainwindowaccess.h b/src/gui/mainwindowaccess.h index 11a9a6acde..1e586dda99 100644 --- a/src/gui/mainwindowaccess.h +++ b/src/gui/mainwindowaccess.h @@ -29,7 +29,7 @@ namespace swift::gui virtual ~IMainWindowAccess(); //! Ctor - IMainWindowAccess() {} + IMainWindowAccess() = default; //! Copy constructor IMainWindowAccess(const IMainWindowAccess &) = delete; diff --git a/src/gui/managedstatusbar.h b/src/gui/managedstatusbar.h index 682db2f0d8..bf8ec336a4 100644 --- a/src/gui/managedstatusbar.h +++ b/src/gui/managedstatusbar.h @@ -29,7 +29,7 @@ namespace swift::gui explicit CManagedStatusBar(QObject *parent = nullptr); //! Destructor - virtual ~CManagedStatusBar() override; + ~CManagedStatusBar() override; //! Get the status bar QStatusBar *getStatusBar() const { return m_statusBar; } diff --git a/src/gui/menus/aircraftmodelmenus.h b/src/gui/menus/aircraftmodelmenus.h index 24eefff6e6..7b416e623a 100644 --- a/src/gui/menus/aircraftmodelmenus.h +++ b/src/gui/menus/aircraftmodelmenus.h @@ -63,7 +63,7 @@ namespace swift::gui static const QStringList &getLogCategories(); //! \copydoc IMenuDelegate::customMenu - virtual void customMenu(CMenuActions &menuActions) override; + void customMenu(CMenuActions &menuActions) override; private: void showSimulatorFile(); //!< simulator file @@ -91,7 +91,7 @@ namespace swift::gui static const QStringList &getLogCategories(); //! \copydoc IMenuDelegate::customMenu - virtual void customMenu(CMenuActions &menuActions) override; + void customMenu(CMenuActions &menuActions) override; //! Change target void setModelsTarget(QObject *target) { m_modelsTarget = target; } @@ -123,7 +123,7 @@ namespace swift::gui static const QStringList &getLogCategories(); //! \copydoc IMenuDelegate::customMenu - virtual void customMenu(CMenuActions &menuActions) override; + void customMenu(CMenuActions &menuActions) override; //! Change target void setModelsTarget(QObject *target) { m_modelsTarget = target; } diff --git a/src/gui/menus/fontmenus.h b/src/gui/menus/fontmenus.h index b84966da2a..24cc72bce7 100644 --- a/src/gui/menus/fontmenus.h +++ b/src/gui/menus/fontmenus.h @@ -29,7 +29,7 @@ namespace swift::gui::menus static const QStringList &getLogCategories(); //! \copydoc IMenuDelegate::customMenu - virtual void customMenu(CMenuActions &menuActions) override; + void customMenu(CMenuActions &menuActions) override; //! Allow to use the actions directly QList getActions() const; diff --git a/src/gui/menus/menuaction.h b/src/gui/menus/menuaction.h index 3a91e5ffe1..a59a218bc5 100644 --- a/src/gui/menus/menuaction.h +++ b/src/gui/menus/menuaction.h @@ -384,7 +384,7 @@ namespace swift::gui::menus { public: //! Constructor - CMenuActions() {} + CMenuActions() = default; //! Constructor CMenuActions(const QList &actions); diff --git a/src/gui/menus/menudelegate.h b/src/gui/menus/menudelegate.h index 7e54430672..6fb529573a 100644 --- a/src/gui/menus/menudelegate.h +++ b/src/gui/menus/menudelegate.h @@ -32,7 +32,7 @@ namespace swift::gui::menus IMenuDelegate *getNestedDelegate() const { return m_nestedDelegate; } //! Destructor - virtual ~IMenuDelegate() {} + ~IMenuDelegate() override = default; //! Log categories const QStringList &getLogCategories() diff --git a/src/gui/models/actionhotkeylistmodel.h b/src/gui/models/actionhotkeylistmodel.h index 0b0c67216e..aca3eb99eb 100644 --- a/src/gui/models/actionhotkeylistmodel.h +++ b/src/gui/models/actionhotkeylistmodel.h @@ -34,7 +34,7 @@ namespace swift::gui::models CActionHotkeyListModel(QObject *parent = nullptr); //! Destructor - virtual ~CActionHotkeyListModel() override {} + ~CActionHotkeyListModel() override = default; //! \copydoc QAbstractTableModel::rowCount int rowCount(const QModelIndex &parent = QModelIndex()) const override; diff --git a/src/gui/models/actionmodel.cpp b/src/gui/models/actionmodel.cpp index 73f2c7d6d1..b2d434d9d4 100644 --- a/src/gui/models/actionmodel.cpp +++ b/src/gui/models/actionmodel.cpp @@ -23,7 +23,7 @@ namespace swift::gui::models setupModelData(); } - CActionModel::~CActionModel() {} + CActionModel::~CActionModel() = default; int CActionModel::columnCount(const QModelIndex &parent) const { diff --git a/src/gui/models/actionmodel.h b/src/gui/models/actionmodel.h index 0da81e12d2..706719851a 100644 --- a/src/gui/models/actionmodel.h +++ b/src/gui/models/actionmodel.h @@ -39,7 +39,7 @@ namespace swift::gui::models CActionModel(QObject *parent = nullptr); //! Destructor - virtual ~CActionModel() override; + ~CActionModel() override; //! \copydoc QAbstractItemModel::data QVariant data(const QModelIndex &index, int role) const override; diff --git a/src/gui/models/aircraftcategorylistmodel.h b/src/gui/models/aircraftcategorylistmodel.h index 00ac58d525..38138e90ea 100644 --- a/src/gui/models/aircraftcategorylistmodel.h +++ b/src/gui/models/aircraftcategorylistmodel.h @@ -23,7 +23,7 @@ namespace swift::gui::models explicit CAircraftCategoryListModel(QObject *parent = nullptr); //! Destructor - virtual ~CAircraftCategoryListModel() {} + ~CAircraftCategoryListModel() override = default; }; } // namespace swift::gui::models #endif // SWIFT_GUI_MODELS_AIRCRAFTCATEGORYLISTMODEL_H diff --git a/src/gui/models/aircraftcategorytreemodel.h b/src/gui/models/aircraftcategorytreemodel.h index f10a57314a..b60ada5719 100644 --- a/src/gui/models/aircraftcategorytreemodel.h +++ b/src/gui/models/aircraftcategorytreemodel.h @@ -24,7 +24,7 @@ namespace swift::gui::models explicit CAircraftCategoryTreeModel(QObject *parent = nullptr); //! Destructor - virtual ~CAircraftCategoryTreeModel() override {} + ~CAircraftCategoryTreeModel() override = default; //! Set columns void setColumns(const CColumns &columns) { m_columns.setColumns(columns); } diff --git a/src/gui/models/aircrafticaofilter.h b/src/gui/models/aircrafticaofilter.h index 2be8e10271..972ce695ad 100644 --- a/src/gui/models/aircrafticaofilter.h +++ b/src/gui/models/aircrafticaofilter.h @@ -23,7 +23,7 @@ namespace swift::gui::models const QString &description, const QString &combinedType); //! \copydoc IModelFilter::filter - virtual swift::misc::aviation::CAircraftIcaoCodeList + swift::misc::aviation::CAircraftIcaoCodeList filter(const swift::misc::aviation::CAircraftIcaoCodeList &inContainer) const override; private: diff --git a/src/gui/models/aircrafticaolistmodel.h b/src/gui/models/aircrafticaolistmodel.h index 084f88fdab..bb9626f8e7 100644 --- a/src/gui/models/aircrafticaolistmodel.h +++ b/src/gui/models/aircrafticaolistmodel.h @@ -23,7 +23,7 @@ namespace swift::gui::models explicit CAircraftIcaoCodeListModel(QObject *parent = nullptr); //! Destructor - virtual ~CAircraftIcaoCodeListModel() {} + ~CAircraftIcaoCodeListModel() override = default; }; } // namespace swift::gui::models diff --git a/src/gui/models/aircraftmodelfilter.h b/src/gui/models/aircraftmodelfilter.h index e8d26bbf66..af5fb21b96 100644 --- a/src/gui/models/aircraftmodelfilter.h +++ b/src/gui/models/aircraftmodelfilter.h @@ -34,7 +34,7 @@ namespace swift::gui::models const swift::misc::simulation::CDistributor &distributor = swift::misc::simulation::CDistributor()); //! \copydoc IModelFilter::filter - virtual swift::misc::simulation::CAircraftModelList + swift::misc::simulation::CAircraftModelList filter(const swift::misc::simulation::CAircraftModelList &inContainer) const override; private: diff --git a/src/gui/models/aircraftmodellistmodel.h b/src/gui/models/aircraftmodellistmodel.h index 0ca9807c62..b0eb3c06a4 100644 --- a/src/gui/models/aircraftmodellistmodel.h +++ b/src/gui/models/aircraftmodellistmodel.h @@ -47,7 +47,7 @@ namespace swift::gui::models explicit CAircraftModelListModel(AircraftModelMode mode, QObject *parent = nullptr); //! Destructor - virtual ~CAircraftModelListModel() override {} + ~CAircraftModelListModel() override = default; //! Mode void setAircraftModelMode(CAircraftModelListModel::AircraftModelMode stationMode); @@ -71,10 +71,10 @@ namespace swift::gui::models void setHighlightColor(const QBrush &brush) { m_highlightColor = brush; } //! \copydoc CListModelBaseNonTemplate::clearHighlighting - virtual void clearHighlighting() override; + void clearHighlighting() override; //! \copydoc CListModelBaseNonTemplate::hasHighlightedRows - virtual bool hasHighlightedRows() const override; + bool hasHighlightedRows() const override; //! Model strings QStringList getModelStrings(bool sort) const; @@ -83,10 +83,10 @@ namespace swift::gui::models void replaceOrAddByModelString(const swift::misc::simulation::CAircraftModelList &models); //! \copydoc QAbstractItemModel::data - virtual QVariant data(const QModelIndex &index, int role) const override; + QVariant data(const QModelIndex &index, int role) const override; //! \copydoc swift::gui::models::CListModelBaseNonTemplate::isOrderable - virtual bool isOrderable() const override { return true; } + bool isOrderable() const override { return true; } private: AircraftModelMode m_mode = NotSet; //!< current mode diff --git a/src/gui/models/aircraftpartslistmodel.h b/src/gui/models/aircraftpartslistmodel.h index a843aa424d..4cba57459d 100644 --- a/src/gui/models/aircraftpartslistmodel.h +++ b/src/gui/models/aircraftpartslistmodel.h @@ -26,7 +26,7 @@ namespace swift::gui::models explicit CAircraftPartsListModel(QObject *parent = nullptr); //! Destructor - virtual ~CAircraftPartsListModel() {} + ~CAircraftPartsListModel() override = default; }; } // namespace swift::gui::models diff --git a/src/gui/models/aircraftsituationchangelistmodel.h b/src/gui/models/aircraftsituationchangelistmodel.h index 81c07336bd..c178e2a0fd 100644 --- a/src/gui/models/aircraftsituationchangelistmodel.h +++ b/src/gui/models/aircraftsituationchangelistmodel.h @@ -26,7 +26,7 @@ namespace swift::gui::models explicit CAircraftSituationChangeListModel(QObject *parent = nullptr); //! Destructor - virtual ~CAircraftSituationChangeListModel() {} + ~CAircraftSituationChangeListModel() override = default; }; } // namespace swift::gui::models diff --git a/src/gui/models/aircraftsituationlistmodel.h b/src/gui/models/aircraftsituationlistmodel.h index 846baa7682..ab3117f689 100644 --- a/src/gui/models/aircraftsituationlistmodel.h +++ b/src/gui/models/aircraftsituationlistmodel.h @@ -23,7 +23,7 @@ namespace swift::gui::models explicit CAircraftSituationListModel(QObject *parent = nullptr); //! Destructor - virtual ~CAircraftSituationListModel() {} + ~CAircraftSituationListModel() override = default; }; } // namespace swift::gui::models #endif // SWIFT_GUI_MODELS_AIRCRAFTSITUATIONLISTMODEL_H diff --git a/src/gui/models/airlineicaofilter.h b/src/gui/models/airlineicaofilter.h index 14aba753b1..33fd1e73eb 100644 --- a/src/gui/models/airlineicaofilter.h +++ b/src/gui/models/airlineicaofilter.h @@ -23,7 +23,7 @@ namespace swift::gui::models bool isReal, bool isVa); //! \copydoc IModelFilter::filter - virtual swift::misc::aviation::CAirlineIcaoCodeList + swift::misc::aviation::CAirlineIcaoCodeList filter(const swift::misc::aviation::CAirlineIcaoCodeList &inContainer) const override; private: diff --git a/src/gui/models/airlineicaolistmodel.h b/src/gui/models/airlineicaolistmodel.h index e01eef92ce..e30fdb8e53 100644 --- a/src/gui/models/airlineicaolistmodel.h +++ b/src/gui/models/airlineicaolistmodel.h @@ -29,8 +29,8 @@ namespace swift::gui::models //! Constructor explicit CAirlineIcaoCodeListModel(QObject *parent = nullptr); - //! DestructorCAirlineIcaoCodeList - virtual ~CAirlineIcaoCodeListModel() {} + //! Destructor + ~CAirlineIcaoCodeListModel() override = default; }; } // namespace swift::gui::models #endif // SWIFT_GUI_AIRLINEICAOLISTMODEL_H diff --git a/src/gui/models/applicationinfolistmodel.h b/src/gui/models/applicationinfolistmodel.h index c57e08b262..18353e0229 100644 --- a/src/gui/models/applicationinfolistmodel.h +++ b/src/gui/models/applicationinfolistmodel.h @@ -26,7 +26,7 @@ namespace swift::gui::models explicit CApplicationInfoListModel(QObject *parent = nullptr); //! Destructor - virtual ~CApplicationInfoListModel() {} + ~CApplicationInfoListModel() override = default; //! \copydoc swift::misc::CApplicationInfoList::fromOtherSwiftVersionsFromDataDirectories void otherSwiftVersionsFromDataDirectories(bool reinit); diff --git a/src/gui/models/atcstationlistmodel.h b/src/gui/models/atcstationlistmodel.h index 7a4f5caa1d..847e1f2398 100644 --- a/src/gui/models/atcstationlistmodel.h +++ b/src/gui/models/atcstationlistmodel.h @@ -35,7 +35,7 @@ namespace swift::gui::models explicit CAtcStationListModel(AtcStationMode stationMode, QObject *parent = nullptr); //! Destructor - virtual ~CAtcStationListModel() override {} + ~CAtcStationListModel() override = default; //! Set station mode void setStationMode(AtcStationMode stationMode); diff --git a/src/gui/models/atcstationtreemodel.h b/src/gui/models/atcstationtreemodel.h index 5bd2e80f59..358ed63ac8 100644 --- a/src/gui/models/atcstationtreemodel.h +++ b/src/gui/models/atcstationtreemodel.h @@ -25,7 +25,7 @@ namespace swift::gui::models explicit CAtcStationTreeModel(QObject *parent = nullptr); //! Destructor - virtual ~CAtcStationTreeModel() override {} + ~CAtcStationTreeModel() override = default; //! Set columns void setColumns(const CColumns &columns) { m_columns.setColumns(columns); } diff --git a/src/gui/models/audiodeviceinfolistmodel.h b/src/gui/models/audiodeviceinfolistmodel.h index 94f14db162..d2b8b821af 100644 --- a/src/gui/models/audiodeviceinfolistmodel.h +++ b/src/gui/models/audiodeviceinfolistmodel.h @@ -23,7 +23,7 @@ namespace swift::gui::models explicit CAudioDeviceInfoListModel(QObject *parent = nullptr); //! Destructor - virtual ~CAudioDeviceInfoListModel() override {} + ~CAudioDeviceInfoListModel() override = default; }; } // namespace swift::gui::models #endif // SWIFT_GUI_MODELS_AUDIODEVICEINFOLISTMODEL_H diff --git a/src/gui/models/clientlistmodel.h b/src/gui/models/clientlistmodel.h index 4c2f3d8944..aba772b254 100644 --- a/src/gui/models/clientlistmodel.h +++ b/src/gui/models/clientlistmodel.h @@ -27,10 +27,10 @@ namespace swift::gui::models explicit CClientListModel(QObject *parent = nullptr); //! Destructor - virtual ~CClientListModel() {} + ~CClientListModel() override = default; //! \copydoc QAbstractListModel::data() - virtual QVariant data(const QModelIndex &index, int role) const override; + QVariant data(const QModelIndex &index, int role) const override; }; } // namespace swift::gui::models #endif // SWIFT_GUI_MODELS_CLIENTLISTMODEL_H diff --git a/src/gui/models/columnformatters.h b/src/gui/models/columnformatters.h index 2965d9731a..d00f602739 100644 --- a/src/gui/models/columnformatters.h +++ b/src/gui/models/columnformatters.h @@ -36,7 +36,7 @@ namespace swift::gui::models {} //! Virtual destructor - virtual ~CDefaultFormatter() {} + virtual ~CDefaultFormatter() = default; //! Copy constructor CDefaultFormatter(const CDefaultFormatter &) = default; @@ -156,13 +156,13 @@ namespace swift::gui::models {} //! \copydoc CDefaultFormatter::displayRole - virtual swift::misc::CVariant displayRole(const swift::misc::CVariant &dataCVariant) const override; + swift::misc::CVariant displayRole(const swift::misc::CVariant &dataCVariant) const override; //! \copydoc CDefaultFormatter::tooltipRole - virtual swift::misc::CVariant tooltipRole(const swift::misc::CVariant &dataCVariant) const override; + swift::misc::CVariant tooltipRole(const swift::misc::CVariant &dataCVariant) const override; //! \copydoc CDefaultFormatter::decorationRole - virtual swift::misc::CVariant decorationRole(const swift::misc::CVariant &dataCVariant) const override; + swift::misc::CVariant decorationRole(const swift::misc::CVariant &dataCVariant) const override; //! @{ //! Width/height @@ -185,7 +185,7 @@ namespace swift::gui::models CStringFormatter(int alignment = alignDefault()) : CDefaultFormatter(alignment, false, roleDisplay()) {} //! \copydoc CDefaultFormatter::displayRole - virtual swift::misc::CVariant displayRole(const swift::misc::CVariant &dataCVariant) const override; + swift::misc::CVariant displayRole(const swift::misc::CVariant &dataCVariant) const override; }; //! Just returns a empty "" value @@ -196,7 +196,7 @@ namespace swift::gui::models CEmptyFormatter(int alignment = alignDefault()) : CDefaultFormatter(alignment, false, roleDisplay()) {} //! \copydoc CDefaultFormatter::displayRole - virtual swift::misc::CVariant displayRole(const swift::misc::CVariant &dataCVariant) const override; + swift::misc::CVariant displayRole(const swift::misc::CVariant &dataCVariant) const override; }; //! Just returns a empty "" value @@ -207,7 +207,7 @@ namespace swift::gui::models CIncognitoFormatter(int alignment = alignDefault()) : CDefaultFormatter(alignment, false, roleDisplay()) {} //! \copydoc CDefaultFormatter::displayRole - virtual swift::misc::CVariant displayRole(const swift::misc::CVariant &dataCVariant) const override; + swift::misc::CVariant displayRole(const swift::misc::CVariant &dataCVariant) const override; }; //! Layout will be defined by a delegate @@ -221,7 +221,7 @@ namespace swift::gui::models {} //! \copydoc CDefaultFormatter::flags - virtual Qt::ItemFlags flags(Qt::ItemFlags flags, bool editable) const override; + Qt::ItemFlags flags(Qt::ItemFlags flags, bool editable) const override; }; //! Bool value, format as text @@ -237,10 +237,10 @@ namespace swift::gui::models {} //! \copydoc CDefaultFormatter::displayRole - virtual swift::misc::CVariant displayRole(const swift::misc::CVariant &dataCVariant) const override; + swift::misc::CVariant displayRole(const swift::misc::CVariant &dataCVariant) const override; //! \copydoc CDefaultFormatter::flags - virtual Qt::ItemFlags flags(Qt::ItemFlags flags, bool editable) const override; + Qt::ItemFlags flags(Qt::ItemFlags flags, bool editable) const override; protected: const swift::misc::CVariant m_trueNameVariant = "true"; //!< displayed when true @@ -258,13 +258,13 @@ namespace swift::gui::models CBoolLedFormatter(const QString &onName, const QString &offName, int alignment = alignDefault()); //! \copydoc CDefaultFormatter::displayRole - virtual swift::misc::CVariant displayRole(const swift::misc::CVariant &dataCVariant) const override; + swift::misc::CVariant displayRole(const swift::misc::CVariant &dataCVariant) const override; //! Display the LED - virtual swift::misc::CVariant decorationRole(const swift::misc::CVariant &dataCVariant) const override; + swift::misc::CVariant decorationRole(const swift::misc::CVariant &dataCVariant) const override; //! \copydoc CDefaultFormatter::tooltipRole - virtual swift::misc::CVariant tooltipRole(const swift::misc::CVariant &dataCVariant) const override + swift::misc::CVariant tooltipRole(const swift::misc::CVariant &dataCVariant) const override { return CBoolTextFormatter::displayRole(dataCVariant); } @@ -300,13 +300,13 @@ namespace swift::gui::models const QString &onName, const QString &offName, int alignment = alignCentered()); //! \copydoc CDefaultFormatter::displayRole - virtual swift::misc::CVariant displayRole(const swift::misc::CVariant &dataCVariant) const override; + swift::misc::CVariant displayRole(const swift::misc::CVariant &dataCVariant) const override; //! Display the icon - virtual swift::misc::CVariant decorationRole(const swift::misc::CVariant &dataCVariant) const override; + swift::misc::CVariant decorationRole(const swift::misc::CVariant &dataCVariant) const override; //! \copydoc CDefaultFormatter::tooltipRole - virtual swift::misc::CVariant tooltipRole(const swift::misc::CVariant &dataCVariant) const override; + swift::misc::CVariant tooltipRole(const swift::misc::CVariant &dataCVariant) const override; protected: const swift::misc::CVariant m_iconOnVariant; //!< Used when on @@ -324,10 +324,10 @@ namespace swift::gui::models {} //! \copydoc CDefaultFormatter::displayRole - virtual swift::misc::CVariant displayRole(const swift::misc::CVariant &valueObject) const override; + swift::misc::CVariant displayRole(const swift::misc::CVariant &valueObject) const override; //! \copydoc CDefaultFormatter::decorationRole - virtual swift::misc::CVariant decorationRole(const swift::misc::CVariant &valueObject) const override; + swift::misc::CVariant decorationRole(const swift::misc::CVariant &valueObject) const override; }; //! Formatter when column contains QDateTime, QDate or QTime @@ -338,7 +338,7 @@ namespace swift::gui::models CDateTimeFormatter(const QString &formatString = formatYmd(), int alignment = alignDefault(), bool i18n = true); //! \copydoc CDefaultFormatter::displayRole - virtual swift::misc::CVariant displayRole(const swift::misc::CVariant &dateTime) const override; + swift::misc::CVariant displayRole(const swift::misc::CVariant &dateTime) const override; //! Year month day static const QString &formatYmd() @@ -387,7 +387,7 @@ namespace swift::gui::models CIntegerFormatter(int alignment = alignRightVCenter()) : CDefaultFormatter(alignment, false) {} //! \copydoc CDefaultFormatter::displayRole - virtual swift::misc::CVariant displayRole(const swift::misc::CVariant &expectedInteger) const override; + swift::misc::CVariant displayRole(const swift::misc::CVariant &expectedInteger) const override; }; //! Formatter when column contains an altitude @@ -409,7 +409,7 @@ namespace swift::gui::models void setUnit(const swift::misc::physical_quantities::CLengthUnit &unit); //! \copydoc CDefaultFormatter::displayRole - virtual swift::misc::CVariant displayRole(const swift::misc::CVariant &altitude) const override; + swift::misc::CVariant displayRole(const swift::misc::CVariant &altitude) const override; private: swift::misc::physical_quantities::CLengthUnit m_unit = swift::misc::physical_quantities::CLengthUnit::ft(); @@ -424,13 +424,13 @@ namespace swift::gui::models CColorFormatter(int alignment = alignCentered(), bool i18n = true); //! \copydoc CDefaultFormatter::displayRole - virtual swift::misc::CVariant displayRole(const swift::misc::CVariant &dataCVariant) const override; + swift::misc::CVariant displayRole(const swift::misc::CVariant &dataCVariant) const override; //! \copydoc CDefaultFormatter::tooltipRole - virtual swift::misc::CVariant tooltipRole(const swift::misc::CVariant &dataCVariant) const override; + swift::misc::CVariant tooltipRole(const swift::misc::CVariant &dataCVariant) const override; //! Display the icon - virtual swift::misc::CVariant decorationRole(const swift::misc::CVariant &dataCVariant) const override; + swift::misc::CVariant decorationRole(const swift::misc::CVariant &dataCVariant) const override; }; //! Formatter for physical quantities @@ -447,7 +447,7 @@ namespace swift::gui::models {} //! \copydoc swift::gui::models::CDefaultFormatter::displayRole - virtual swift::misc::CVariant displayRole(const swift::misc::CVariant &physicalQuantity) const override + swift::misc::CVariant displayRole(const swift::misc::CVariant &physicalQuantity) const override { if (physicalQuantity.canConvert()) { @@ -500,7 +500,7 @@ namespace swift::gui::models {} //! \copydoc CDefaultFormatter::displayRole - virtual swift::misc::CVariant displayRole(const swift::misc::CVariant &dataCVariant) const override; + swift::misc::CVariant displayRole(const swift::misc::CVariant &dataCVariant) const override; }; //! Angle in degrees @@ -537,7 +537,7 @@ namespace swift::gui::models {} //! \copydoc CDefaultFormatter::displayRole - virtual swift::misc::CVariant displayRole(const swift::misc::CVariant &dataCVariant) const override; + swift::misc::CVariant displayRole(const swift::misc::CVariant &dataCVariant) const override; }; //! Speed displayed in kts @@ -553,7 +553,7 @@ namespace swift::gui::models {} //! \copydoc CDefaultFormatter::displayRole - virtual swift::misc::CVariant displayRole(const swift::misc::CVariant &dataCVariant) const override; + swift::misc::CVariant displayRole(const swift::misc::CVariant &dataCVariant) const override; }; } // namespace swift::gui::models diff --git a/src/gui/models/countryfilter.h b/src/gui/models/countryfilter.h index 1b42c654a1..6bf347bfdf 100644 --- a/src/gui/models/countryfilter.h +++ b/src/gui/models/countryfilter.h @@ -22,7 +22,7 @@ namespace swift::gui::models CCountryFilter(const QString &isoCode, const QString &name); //! \copydoc IModelFilter::filter - virtual swift::misc::CCountryList filter(const swift::misc::CCountryList &inContainer) const override; + swift::misc::CCountryList filter(const swift::misc::CCountryList &inContainer) const override; private: QString m_isoCode; diff --git a/src/gui/models/countrylistmodel.h b/src/gui/models/countrylistmodel.h index 3fe057fda9..d375a51ad8 100644 --- a/src/gui/models/countrylistmodel.h +++ b/src/gui/models/countrylistmodel.h @@ -26,7 +26,7 @@ namespace swift::gui::models explicit CCountryListModel(QObject *parent = nullptr); //! Destructor - virtual ~CCountryListModel() {} + ~CCountryListModel() override = default; }; } // namespace swift::gui::models #endif // SWIFT_GUI_MODELS_COUNTRYLISTMODEL_H diff --git a/src/gui/models/distributorfilter.h b/src/gui/models/distributorfilter.h index 8c23c4c6e1..f13364a45b 100644 --- a/src/gui/models/distributorfilter.h +++ b/src/gui/models/distributorfilter.h @@ -23,7 +23,7 @@ namespace swift::gui::models CDistributorFilter(const swift::misc::simulation::CSimulatorInfo &simulator); //! \copydoc IModelFilter::filter - virtual swift::misc::simulation::CDistributorList + swift::misc::simulation::CDistributorList filter(const swift::misc::simulation::CDistributorList &inDistributors) const override; private: diff --git a/src/gui/models/distributorlistmodel.h b/src/gui/models/distributorlistmodel.h index 48c9146fbc..19ed0a43a3 100644 --- a/src/gui/models/distributorlistmodel.h +++ b/src/gui/models/distributorlistmodel.h @@ -39,7 +39,7 @@ namespace swift::gui::models explicit CDistributorListModel(QObject *parent = nullptr); //! Destructor - virtual ~CDistributorListModel() override {} + ~CDistributorListModel() override = default; //! Set mode void setDistributorMode(DistributorMode distributorMode); @@ -48,7 +48,7 @@ namespace swift::gui::models DistributorMode getDistributorMode() const { return this->m_distributorMode; } //! \copydoc swift::gui::models::CListModelBaseNonTemplate::isOrderable - virtual bool isOrderable() const override { return true; } + bool isOrderable() const override { return true; } private: DistributorMode m_distributorMode = NotSet; diff --git a/src/gui/models/identifierlistmodel.h b/src/gui/models/identifierlistmodel.h index b69394f400..4d2182d4c2 100644 --- a/src/gui/models/identifierlistmodel.h +++ b/src/gui/models/identifierlistmodel.h @@ -22,7 +22,7 @@ namespace swift::gui::models explicit CIdentifierListModel(QObject *parent = nullptr); //! Destructor - virtual ~CIdentifierListModel() {} + ~CIdentifierListModel() override = default; }; } // namespace swift::gui::models #endif // SWIFT_GUI_MODELS_IDENTIFIERLISTMODEL_H diff --git a/src/gui/models/interpolationsetupmodel.h b/src/gui/models/interpolationsetupmodel.h index d94a0a95f7..e7a115706d 100644 --- a/src/gui/models/interpolationsetupmodel.h +++ b/src/gui/models/interpolationsetupmodel.h @@ -25,7 +25,7 @@ namespace swift::gui::models explicit CInterpolationSetupListModel(QObject *parent = nullptr); //! Destructor - virtual ~CInterpolationSetupListModel() override {} + ~CInterpolationSetupListModel() override = default; }; } // namespace swift::gui::models #endif // SWIFT_GUI_MODELS_INTERPOLATIONSETUPMODEL_H diff --git a/src/gui/models/listmodelcallsignobjects.h b/src/gui/models/listmodelcallsignobjects.h index 6b62776d92..4ffde07f28 100644 --- a/src/gui/models/listmodelcallsignobjects.h +++ b/src/gui/models/listmodelcallsignobjects.h @@ -31,7 +31,7 @@ namespace swift::gui::models using ObjectType = typename T::value_type; //! Destructor - virtual ~CListModelCallsignObjects() {} + ~CListModelCallsignObjects() override = default; //! Keys to be highlighted void setHighlightedCallsigns(const swift::misc::aviation::CCallsignSet &callsigns) @@ -43,7 +43,7 @@ namespace swift::gui::models void clearHighlightedCallsigns() { m_highlightCallsigns.clear(); } //! \copydoc swift::gui::models::CListModelBaseNonTemplate::clearHighlighting - virtual void clearHighlighting() override + void clearHighlighting() override { this->clearHighlightedCallsigns(); CListModelBase::clearHighlighting(); @@ -53,7 +53,7 @@ namespace swift::gui::models void setHighlightColor(QColor color) { m_highlightColor = color; } //! Get data for index and role - virtual QVariant data(const QModelIndex &index, int role) const override; + QVariant data(const QModelIndex &index, int role) const override; //! Callsign for given index swift::misc::aviation::CCallsign callsignForIndex(const QModelIndex &index) const; diff --git a/src/gui/models/listmodeldbobjects.h b/src/gui/models/listmodeldbobjects.h index 86ba6f8a1d..9afffe500d 100644 --- a/src/gui/models/listmodeldbobjects.h +++ b/src/gui/models/listmodeldbobjects.h @@ -34,7 +34,7 @@ namespace swift::gui::models using KeyType = K; //! Destructor - virtual ~CListModelDbObjects() {} + ~CListModelDbObjects() override = default; //! Keys to be highlighted void setHighlightedDbKeys(const QList &keys) { m_highlightKeys = keys; } @@ -43,20 +43,20 @@ namespace swift::gui::models void clearHighlightedDbKeys() { m_highlightKeys.clear(); } //! \copydoc swift::gui::models::CListModelBaseNonTemplate::clearHighlighting - virtual void clearHighlighting() override + void clearHighlighting() override { this->clearHighlightedDbKeys(); CListModelBase::clearHighlighting(); } //! \copydoc swift::gui::models::CListModelBaseNonTemplate::hasHighlightedRows - virtual bool hasHighlightedRows() const override { return !m_highlightKeys.isEmpty(); } + bool hasHighlightedRows() const override { return !m_highlightKeys.isEmpty(); } //! Set color for highlighting void setHighlightColor(QColor color) { m_highlightColor = color; } //! Get data for index and role - virtual QVariant data(const QModelIndex &index, int role) const override; + QVariant data(const QModelIndex &index, int role) const override; //! DB key for given index KeyType dbKeyForIndex(const QModelIndex &index) const; @@ -88,17 +88,17 @@ namespace swift::gui::models using KeyType = K; //! Destructor - virtual ~COrderableListModelDbObjects() {} + ~COrderableListModelDbObjects() override = default; //! \name specialized swift::gui::models::CListModelDbObjects functions for ordering //! @{ using COrderableListModelDbObjects::CListModelDbObjects::update; //! \copydoc swift::gui::models::CListModelDbObjects::update - virtual int update(const ContainerType &container, bool sort) override; + int update(const ContainerType &container, bool sort) override; //! \copydoc swift::gui::models::CListModelDbObjects::moveItems - virtual void moveItems(const ContainerType &items, int position) override; + void moveItems(const ContainerType &items, int position) override; //! @} //! Sort order to order property swift::misc::IOrderable::IndexOrder diff --git a/src/gui/models/listmodeltimestampobjects.h b/src/gui/models/listmodeltimestampobjects.h index 3c2d1a8d0e..365c4085af 100644 --- a/src/gui/models/listmodeltimestampobjects.h +++ b/src/gui/models/listmodeltimestampobjects.h @@ -49,7 +49,7 @@ namespace swift::gui::models using ObjectType = typename T::value_type; //! Destructor - virtual ~CListModelTimestampWithOffsetObjects() {} + ~CListModelTimestampWithOffsetObjects() override = default; //! Insert as first element by keeping maxElements and the latest first void push_frontKeepLatestAdjustedFirst(const ObjectType &object, int max); diff --git a/src/gui/models/liveryfilter.h b/src/gui/models/liveryfilter.h index 3ef301b010..83a896fb64 100644 --- a/src/gui/models/liveryfilter.h +++ b/src/gui/models/liveryfilter.h @@ -25,8 +25,7 @@ namespace swift::gui::models double maxColorDistance, bool colorLiveries, bool airlineLiveries); //! \copydoc IModelFilter::filter - virtual swift::misc::aviation::CLiveryList - filter(const swift::misc::aviation::CLiveryList &inContainer) const override; + swift::misc::aviation::CLiveryList filter(const swift::misc::aviation::CLiveryList &inContainer) const override; private: int m_id = -1; diff --git a/src/gui/models/liverylistmodel.h b/src/gui/models/liverylistmodel.h index 566919d169..12fd31df66 100644 --- a/src/gui/models/liverylistmodel.h +++ b/src/gui/models/liverylistmodel.h @@ -29,7 +29,7 @@ namespace swift::gui::models explicit CLiveryListModel(QObject *parent = nullptr); //! Destructor - virtual ~CLiveryListModel() override {} + ~CLiveryListModel() override = default; }; } // namespace swift::gui::models diff --git a/src/gui/models/matchingstatisticsmodel.h b/src/gui/models/matchingstatisticsmodel.h index e79697487c..ad64dbb315 100644 --- a/src/gui/models/matchingstatisticsmodel.h +++ b/src/gui/models/matchingstatisticsmodel.h @@ -33,7 +33,7 @@ namespace swift::gui::models explicit CMatchingStatisticsModel(MatchingStatisticsMode mode, QObject *parent = nullptr); //! Destructor - virtual ~CMatchingStatisticsModel() {} + ~CMatchingStatisticsModel() override = default; //! Set mode void setMode(MatchingStatisticsMode mode); diff --git a/src/gui/models/modelfilter.h b/src/gui/models/modelfilter.h index cc017df821..e17f6757fe 100644 --- a/src/gui/models/modelfilter.h +++ b/src/gui/models/modelfilter.h @@ -24,7 +24,7 @@ namespace swift::gui::models IModelFilter(bool enabled = true) : m_enabled(enabled) {} //! Destructor - virtual ~IModelFilter() {} + virtual ~IModelFilter() = default; //! Used container data virtual ContainerType filter(const ContainerType &container) const = 0; diff --git a/src/gui/models/namevariantpairlistmodel.h b/src/gui/models/namevariantpairlistmodel.h index cba59c2690..940c665a29 100644 --- a/src/gui/models/namevariantpairlistmodel.h +++ b/src/gui/models/namevariantpairlistmodel.h @@ -34,7 +34,7 @@ namespace swift::gui::models explicit CNameVariantPairModel(bool withIcon, QObject *parent = nullptr); //! Destructor - virtual ~CNameVariantPairModel() {} + ~CNameVariantPairModel() override = default; //! Icon on / off void setIconMode(bool withIcon); diff --git a/src/gui/models/selectionmodel.h b/src/gui/models/selectionmodel.h index 5848a31af0..4bc32e90b1 100644 --- a/src/gui/models/selectionmodel.h +++ b/src/gui/models/selectionmodel.h @@ -14,7 +14,7 @@ namespace swift::gui::models { public: //! Destructor - virtual ~ISelectionModel() {} + virtual ~ISelectionModel() = default; //! Selected objects virtual ContainerType selectedObjects() const = 0; diff --git a/src/gui/models/serverlistmodel.h b/src/gui/models/serverlistmodel.h index 1910626415..4cbf811c03 100644 --- a/src/gui/models/serverlistmodel.h +++ b/src/gui/models/serverlistmodel.h @@ -24,7 +24,7 @@ namespace swift::gui::models explicit CServerListModel(QObject *parent = nullptr); //! Destructor - virtual ~CServerListModel() {} + ~CServerListModel() override = default; }; } // namespace swift::gui::models #endif // SWIFT_GUI_MODELS_SERVERLISTMODEL_H diff --git a/src/gui/models/simulatedaircraftlistmodel.h b/src/gui/models/simulatedaircraftlistmodel.h index 29f4f12a55..eca43c65fd 100644 --- a/src/gui/models/simulatedaircraftlistmodel.h +++ b/src/gui/models/simulatedaircraftlistmodel.h @@ -35,7 +35,7 @@ namespace swift::gui::models explicit CSimulatedAircraftListModel(QObject *parent = nullptr); //! Destructor - virtual ~CSimulatedAircraftListModel() override {} + ~CSimulatedAircraftListModel() override = default; //! Mode void setAircraftMode(AircraftMode mode); diff --git a/src/gui/models/statusmessagefilter.h b/src/gui/models/statusmessagefilter.h index 48ffa030d3..6d62f1beca 100644 --- a/src/gui/models/statusmessagefilter.h +++ b/src/gui/models/statusmessagefilter.h @@ -28,11 +28,10 @@ namespace swift::gui::models const QString &category); //! \copydoc IModelFilter::filter - virtual swift::misc::CStatusMessageList - filter(const swift::misc::CStatusMessageList &inContainer) const override; + swift::misc::CStatusMessageList filter(const swift::misc::CStatusMessageList &inContainer) const override; //! \copydoc IModelFilter::getAsValueObject - virtual swift::misc::CVariant getAsValueObject() const override; + swift::misc::CVariant getAsValueObject() const override; private: swift::misc::CStatusMessage::StatusSeverity m_severity = swift::misc::CStatusMessage::SeverityError; diff --git a/src/gui/models/statusmessagelistmodel.h b/src/gui/models/statusmessagelistmodel.h index 69fdd6847e..c60a67b908 100644 --- a/src/gui/models/statusmessagelistmodel.h +++ b/src/gui/models/statusmessagelistmodel.h @@ -34,7 +34,7 @@ namespace swift::gui::models explicit CStatusMessageListModel(QObject *parent = nullptr); //! Destructor - virtual ~CStatusMessageListModel() override {} + ~CStatusMessageListModel() override = default; //! Set mode void setMode(Mode mode); @@ -46,7 +46,7 @@ namespace swift::gui::models void adjustOrderColumn(const swift::misc::CStatusMessageList &messages); //! \copydoc QAbstractItemModel::data - virtual QVariant data(const QModelIndex &index, int role) const override; + QVariant data(const QModelIndex &index, int role) const override; //! Currently sorted by timestamp or by order bool isSortedByTimestampOrOrder() const; diff --git a/src/gui/models/textmessagelistmodel.h b/src/gui/models/textmessagelistmodel.h index e4ba1564a2..88bbb17b7d 100644 --- a/src/gui/models/textmessagelistmodel.h +++ b/src/gui/models/textmessagelistmodel.h @@ -37,7 +37,7 @@ namespace swift::gui::models explicit CTextMessageListModel(TextMessageMode stationMode, QObject *parent = nullptr); //! Destructor - virtual ~CTextMessageListModel() override {} + ~CTextMessageListModel() override = default; //! Set mode void setTextMessageMode(TextMessageMode mode); @@ -46,7 +46,7 @@ namespace swift::gui::models TextMessageMode getTextMessageMode() const { return m_textMessageMode; } //! \copydoc QAbstractItemModel::data - virtual QVariant data(const QModelIndex &index, int role) const override; + QVariant data(const QModelIndex &index, int role) const override; private: TextMessageMode m_textMessageMode = NotSet; diff --git a/src/gui/models/userlistmodel.h b/src/gui/models/userlistmodel.h index 9841cc95d4..18eb9da2a1 100644 --- a/src/gui/models/userlistmodel.h +++ b/src/gui/models/userlistmodel.h @@ -32,7 +32,7 @@ namespace swift::gui::models explicit CUserListModel(UserMode userMode, QObject *parent = nullptr); //! Destructor - virtual ~CUserListModel() {} + ~CUserListModel() override = default; //! Set station mode void setUserMode(UserMode userMode); diff --git a/src/gui/overlaymessages.cpp b/src/gui/overlaymessages.cpp index a9202ef4b2..3c04afa7ae 100644 --- a/src/gui/overlaymessages.cpp +++ b/src/gui/overlaymessages.cpp @@ -74,7 +74,7 @@ namespace swift::gui this->setDefaultConfirmationButton(QMessageBox::Cancel); } - COverlayMessages::~COverlayMessages() {} + COverlayMessages::~COverlayMessages() = default; void COverlayMessages::init(int w, int h) { diff --git a/src/gui/overlaymessages.h b/src/gui/overlaymessages.h index 18b3cfb218..02cce685ec 100644 --- a/src/gui/overlaymessages.h +++ b/src/gui/overlaymessages.h @@ -51,7 +51,7 @@ namespace swift::gui explicit COverlayMessages(int w, int h, QWidget *parent); //! Destructor - virtual ~COverlayMessages() override; + ~COverlayMessages() override; //! Messages mode void setModeToMessages(); @@ -189,7 +189,7 @@ namespace swift::gui void display(std::chrono::milliseconds timeout = std::chrono::milliseconds(0)); //! \copydoc QFrame::keyPressEvent - virtual void keyPressEvent(QKeyEvent *event) override; + void keyPressEvent(QKeyEvent *event) override; private: QScopedPointer ui; diff --git a/src/gui/overlaymessagesframe.h b/src/gui/overlaymessagesframe.h index 93bf65655e..bef61bbb7a 100644 --- a/src/gui/overlaymessagesframe.h +++ b/src/gui/overlaymessagesframe.h @@ -48,7 +48,7 @@ namespace swift::gui { public: //! Destructor - virtual ~COverlayMessagesBase() override {} + ~COverlayMessagesBase() override = default; //! Init, normally we use lazy init, but by calling init explicitly we can force initalization //! \remark usefule for text messages, as history will be already available @@ -332,7 +332,7 @@ namespace swift::gui } //! \copydoc QFrame::keyPressEvent - virtual void keyPressEvent(QKeyEvent *event) override + void keyPressEvent(QKeyEvent *event) override { if (m_overlayMessages && event->key() == Qt::Key_Escape) { @@ -343,7 +343,7 @@ namespace swift::gui } //! \copydoc QFrame::resizeEvent - virtual void resizeEvent(QResizeEvent *event) override + void resizeEvent(QResizeEvent *event) override { WIDGET::resizeEvent(event); if (m_overlayMessages && m_overlayMessages->isVisible()) { this->initInnerFrame(); } diff --git a/src/gui/pluginconfig.h b/src/gui/pluginconfig.h index bc78085333..7ee2ae02e8 100644 --- a/src/gui/pluginconfig.h +++ b/src/gui/pluginconfig.h @@ -27,7 +27,7 @@ namespace swift::gui { public: //! Dtor. - virtual ~IPluginConfig() {} + virtual ~IPluginConfig() = default; //! Creates a new config window and returns its pointer. virtual CPluginConfigWindow *createConfigWindow(QWidget *parent) = 0; diff --git a/src/gui/plugindetailswindow.cpp b/src/gui/plugindetailswindow.cpp index e0efb6a2df..9d8f975152 100644 --- a/src/gui/plugindetailswindow.cpp +++ b/src/gui/plugindetailswindow.cpp @@ -27,7 +27,7 @@ namespace swift::gui connect(ui->pb_Close, &QPushButton::clicked, this, &CPluginDetailsWindow::close); } - CPluginDetailsWindow::~CPluginDetailsWindow() {} + CPluginDetailsWindow::~CPluginDetailsWindow() = default; void CPluginDetailsWindow::setPluginName(const QString &name) { diff --git a/src/gui/plugindetailswindow.h b/src/gui/plugindetailswindow.h index e635c5a212..c455bfa1a0 100644 --- a/src/gui/plugindetailswindow.h +++ b/src/gui/plugindetailswindow.h @@ -33,7 +33,7 @@ namespace swift::gui explicit CPluginDetailsWindow(QWidget *parent = nullptr); //! Destructor - virtual ~CPluginDetailsWindow() override; + ~CPluginDetailsWindow() override; //! Sets the plugin name void setPluginName(const QString &name); diff --git a/src/gui/settings/dockwidgetsettings.cpp b/src/gui/settings/dockwidgetsettings.cpp index 3cbf3468b6..22ca409c08 100644 --- a/src/gui/settings/dockwidgetsettings.cpp +++ b/src/gui/settings/dockwidgetsettings.cpp @@ -15,8 +15,6 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::gui::settings, CDockWidgetSettings) namespace swift::gui::settings { - CDockWidgetSettings::CDockWidgetSettings() {} - void CDockWidgetSettings::resetMarginsToDefault() { // this->setMarginsWhenFloating(QMargins(0, 3, 15, 35)); // found by trial and error on windows diff --git a/src/gui/settings/dockwidgetsettings.h b/src/gui/settings/dockwidgetsettings.h index ceab3eb1da..eac9e57f2d 100644 --- a/src/gui/settings/dockwidgetsettings.h +++ b/src/gui/settings/dockwidgetsettings.h @@ -35,7 +35,7 @@ namespace swift::gui::settings }; //! Default constructor - CDockWidgetSettings(); + CDockWidgetSettings() = default; //! Reset margins to default void resetMarginsToDefault(); diff --git a/src/gui/settings/guisettings.cpp b/src/gui/settings/guisettings.cpp index 50b99f9f18..6f30943d20 100644 --- a/src/gui/settings/guisettings.cpp +++ b/src/gui/settings/guisettings.cpp @@ -11,8 +11,6 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::gui::settings, CGeneralGuiSettings) namespace swift::gui::settings { - CGeneralGuiSettings::CGeneralGuiSettings() {} - void CGeneralGuiSettings::setWidgetStyle(const QString &widgetStyle) { if (this->m_widgetStyle == widgetStyle) { return; } diff --git a/src/gui/settings/guisettings.h b/src/gui/settings/guisettings.h index 7230d27b6d..c5cf1ae3f9 100644 --- a/src/gui/settings/guisettings.h +++ b/src/gui/settings/guisettings.h @@ -29,7 +29,7 @@ namespace swift::gui::settings }; //! Default constructor - CGeneralGuiSettings(); + CGeneralGuiSettings() = default; //! Widget style const QString &getWidgetStyle() const { return m_widgetStyle; } diff --git a/src/gui/settings/navigatorsettings.cpp b/src/gui/settings/navigatorsettings.cpp index c94eb407d5..1664c5fc15 100644 --- a/src/gui/settings/navigatorsettings.cpp +++ b/src/gui/settings/navigatorsettings.cpp @@ -15,8 +15,6 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::gui::settings, CNavigatorSettings) namespace swift::gui::settings { - CNavigatorSettings::CNavigatorSettings() {} - void CNavigatorSettings::reset() {} void CNavigatorSettings::setMargins(const QMargins &margins) diff --git a/src/gui/settings/navigatorsettings.h b/src/gui/settings/navigatorsettings.h index 77e93a6e98..5c1f975c6e 100644 --- a/src/gui/settings/navigatorsettings.h +++ b/src/gui/settings/navigatorsettings.h @@ -32,10 +32,10 @@ namespace swift::gui::settings }; //! Default constructor - CNavigatorSettings(); + CNavigatorSettings() = default; //! Destructor. - ~CNavigatorSettings() {} + ~CNavigatorSettings() = default; //! Reset to defaults void reset(); diff --git a/src/gui/settings/textmessagesettings.cpp b/src/gui/settings/textmessagesettings.cpp index f2df03c7f4..f221a3a56f 100644 --- a/src/gui/settings/textmessagesettings.cpp +++ b/src/gui/settings/textmessagesettings.cpp @@ -14,8 +14,6 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::gui::settings, CTextMessageSettings) namespace swift::gui::settings { - CTextMessageSettings::CTextMessageSettings() {} - bool CTextMessageSettings::popupPrivateMessages() const { return this->getPopupAllMessages() || m_popupPrivateMessages; diff --git a/src/gui/settings/textmessagesettings.h b/src/gui/settings/textmessagesettings.h index 2b25dad96f..5d684f4bc6 100644 --- a/src/gui/settings/textmessagesettings.h +++ b/src/gui/settings/textmessagesettings.h @@ -44,7 +44,7 @@ namespace swift::gui::settings }; //! Default constructor - CTextMessageSettings(); + CTextMessageSettings() = default; //! Private messages? All considered. bool popupPrivateMessages() const; diff --git a/src/gui/settings/viewupdatesettings.cpp b/src/gui/settings/viewupdatesettings.cpp index b6b74e4a2d..e3a55dc51d 100644 --- a/src/gui/settings/viewupdatesettings.cpp +++ b/src/gui/settings/viewupdatesettings.cpp @@ -16,8 +16,6 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::gui::settings, CViewUpdateSettings) namespace swift::gui::settings { - CViewUpdateSettings::CViewUpdateSettings() {} - void CViewUpdateSettings::reset() { this->m_updateAircraft = CTime(10.0, CTimeUnit::s()); diff --git a/src/gui/settings/viewupdatesettings.h b/src/gui/settings/viewupdatesettings.h index fae1782985..282b07f9e3 100644 --- a/src/gui/settings/viewupdatesettings.h +++ b/src/gui/settings/viewupdatesettings.h @@ -34,7 +34,7 @@ namespace swift::gui::settings }; //! Default constructor - CViewUpdateSettings(); + CViewUpdateSettings() = default; //! Reset to defaults void reset(); diff --git a/src/gui/sharedstringlistcompleter.h b/src/gui/sharedstringlistcompleter.h index e15e0336e4..72b1dc5e50 100644 --- a/src/gui/sharedstringlistcompleter.h +++ b/src/gui/sharedstringlistcompleter.h @@ -22,7 +22,7 @@ namespace swift::gui { public: //! Constructor - CSharedStringListCompleter() {} + CSharedStringListCompleter() = default; //! Update data bool updateData(const QStringList &data, int cacheTimeMs); diff --git a/src/gui/showhidebar.cpp b/src/gui/showhidebar.cpp index 63ad8d1693..3ee750bddc 100644 --- a/src/gui/showhidebar.cpp +++ b/src/gui/showhidebar.cpp @@ -16,7 +16,7 @@ namespace swift::gui connect(ui->pb_ShowHidePushButton, &QPushButton::clicked, this, &CShowHideBar::toggleShowHide); } - CShowHideBar::~CShowHideBar() {} + CShowHideBar::~CShowHideBar() = default; bool CShowHideBar::isShown() const { return ui->pb_ShowHidePushButton->isChecked(); } } // namespace swift::gui diff --git a/src/gui/showhidebar.h b/src/gui/showhidebar.h index c70963ee12..bb8480974c 100644 --- a/src/gui/showhidebar.h +++ b/src/gui/showhidebar.h @@ -28,7 +28,7 @@ namespace swift::gui explicit CShowHideBar(QWidget *parent = nullptr); //! Destructor - virtual ~CShowHideBar(); + ~CShowHideBar() override; //! Is shown? bool isShown() const; diff --git a/src/gui/systemtraywindow.h b/src/gui/systemtraywindow.h index d7d10626d5..18954346af 100644 --- a/src/gui/systemtraywindow.h +++ b/src/gui/systemtraywindow.h @@ -63,10 +63,10 @@ namespace swift::gui protected: //! \copydoc QMainWindow::changeEvent - virtual void changeEvent(QEvent *event) override; + void changeEvent(QEvent *event) override; //! \copydoc QMainWindow::closeEvent - virtual void closeEvent(QCloseEvent *event) override; + void closeEvent(QCloseEvent *event) override; private: void createActions(); diff --git a/src/gui/textmessagetextedit.cpp b/src/gui/textmessagetextedit.cpp index 766bb8eaed..bf0ed57492 100644 --- a/src/gui/textmessagetextedit.cpp +++ b/src/gui/textmessagetextedit.cpp @@ -51,7 +51,7 @@ namespace swift::gui connect(this, &QTextEdit::customContextMenuRequested, this, &CTextMessageTextEdit::showContextMenuForTextEdit); } - CTextMessageTextEdit::~CTextMessageTextEdit() {} + CTextMessageTextEdit::~CTextMessageTextEdit() = default; void CTextMessageTextEdit::insertTextMessage(const CTextMessage &textMessage, int maxMessages) { diff --git a/src/gui/textmessagetextedit.h b/src/gui/textmessagetextedit.h index 195d6255bb..67d6e65c9a 100644 --- a/src/gui/textmessagetextedit.h +++ b/src/gui/textmessagetextedit.h @@ -33,7 +33,7 @@ namespace swift::gui CTextMessageTextEdit(QWidget *parent = nullptr); //! Destructor - virtual ~CTextMessageTextEdit() override; + ~CTextMessageTextEdit() override; //! Insert a message void insertTextMessage(const swift::misc::network::CTextMessage &textMessage, int maxMessages = -1); diff --git a/src/gui/uppercasevalidator.h b/src/gui/uppercasevalidator.h index 3be426c3de..844b6bf879 100644 --- a/src/gui/uppercasevalidator.h +++ b/src/gui/uppercasevalidator.h @@ -38,10 +38,10 @@ namespace swift::gui void setAllowedCharacters09AZ(); //! \copydoc QValidator::validate - virtual State validate(QString &input, int &pos) const override; + State validate(QString &input, int &pos) const override; //! \copydoc QValidator::fixup - virtual void fixup(QString &input) const override; + void fixup(QString &input) const override; private: bool m_optionalValue = false; //!< allow empty diff --git a/src/gui/views/aircraftmodelstatisticsdialog.cpp b/src/gui/views/aircraftmodelstatisticsdialog.cpp index af7e63226e..8543544694 100644 --- a/src/gui/views/aircraftmodelstatisticsdialog.cpp +++ b/src/gui/views/aircraftmodelstatisticsdialog.cpp @@ -29,7 +29,7 @@ namespace swift::gui::views &CAircraftModelStatisticsDialog::displayHTMLMatrix); } - CAircraftModelStatisticsDialog::~CAircraftModelStatisticsDialog() {} + CAircraftModelStatisticsDialog::~CAircraftModelStatisticsDialog() = default; void CAircraftModelStatisticsDialog::analyzeModels(const CAircraftModelList &models) { diff --git a/src/gui/views/aircraftmodelstatisticsdialog.h b/src/gui/views/aircraftmodelstatisticsdialog.h index b6f5ebc321..0f7288d62f 100644 --- a/src/gui/views/aircraftmodelstatisticsdialog.h +++ b/src/gui/views/aircraftmodelstatisticsdialog.h @@ -27,7 +27,7 @@ namespace swift::gui::views explicit CAircraftModelStatisticsDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CAircraftModelStatisticsDialog(); + ~CAircraftModelStatisticsDialog() override; //! Set and analyze the models void analyzeModels(const swift::misc::simulation::CAircraftModelList &models); diff --git a/src/gui/views/aircraftmodelvalidationdialog.cpp b/src/gui/views/aircraftmodelvalidationdialog.cpp index 7be61238e3..7f3a900d74 100644 --- a/src/gui/views/aircraftmodelvalidationdialog.cpp +++ b/src/gui/views/aircraftmodelvalidationdialog.cpp @@ -30,7 +30,7 @@ namespace swift::gui::views Qt::QueuedConnection); } - CAircraftModelValidationDialog::~CAircraftModelValidationDialog() {} + CAircraftModelValidationDialog::~CAircraftModelValidationDialog() = default; void CAircraftModelValidationDialog::setModels(const CAircraftModelList &models, const CSimulatorInfo &simulator, const QString &simulatorDir) diff --git a/src/gui/views/aircraftmodelvalidationdialog.h b/src/gui/views/aircraftmodelvalidationdialog.h index d450ab4060..d373f90a99 100644 --- a/src/gui/views/aircraftmodelvalidationdialog.h +++ b/src/gui/views/aircraftmodelvalidationdialog.h @@ -31,7 +31,7 @@ namespace swift::gui::views explicit CAircraftModelValidationDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CAircraftModelValidationDialog() override; + ~CAircraftModelValidationDialog() override; //! Models void setModels(const swift::misc::simulation::CAircraftModelList &models, diff --git a/src/gui/views/aircraftmodelview.h b/src/gui/views/aircraftmodelview.h index 9bc8a6c2c1..4b1627b719 100644 --- a/src/gui/views/aircraftmodelview.h +++ b/src/gui/views/aircraftmodelview.h @@ -140,24 +140,24 @@ namespace swift::gui protected: //! \copydoc QTableView::dropEvent //! \sa swift::gui::models::CListModelBase::dropMimeData - virtual void dropEvent(QDropEvent *event) override; + void dropEvent(QDropEvent *event) override; //! \name View base class overrides //! @{ //! \copydoc swift::gui::views::COrderableViewWithDbObjects::customMenu - virtual void customMenu(menus::CMenuActions &menuActions) override; + void customMenu(menus::CMenuActions &menuActions) override; //! \copydoc swift::gui::views::COrderableViewWithDbObjects::modifyLoadedJsonData - virtual swift::misc::CStatusMessage + swift::misc::CStatusMessage modifyLoadedJsonData(swift::misc::simulation::CAircraftModelList &models) const override; //! \copydoc swift::gui::views::COrderableViewWithDbObjects::validateLoadedJsonData - virtual swift::misc::CStatusMessage + swift::misc::CStatusMessage validateLoadedJsonData(const swift::misc::simulation::CAircraftModelList &models) const override; //! \copydoc swift::gui::views::COrderableViewWithDbObjects::jsonLoadedAndModelUpdated - virtual void jsonLoadedAndModelUpdated(const swift::misc::simulation::CAircraftModelList &models) override; + void jsonLoadedAndModelUpdated(const swift::misc::simulation::CAircraftModelList &models) override; //! @} private: diff --git a/src/gui/views/aircraftsituationview.h b/src/gui/views/aircraftsituationview.h index 20f314d9ab..87bc1b9b56 100644 --- a/src/gui/views/aircraftsituationview.h +++ b/src/gui/views/aircraftsituationview.h @@ -31,7 +31,7 @@ namespace swift::gui::views protected: //! \copydoc CViewBase::customMenu - virtual void customMenu(menus::CMenuActions &menuActions) override; + void customMenu(menus::CMenuActions &menuActions) override; private: //! Request elevation diff --git a/src/gui/views/applicationinfoview.h b/src/gui/views/applicationinfoview.h index af6cd3188b..b55ff0198e 100644 --- a/src/gui/views/applicationinfoview.h +++ b/src/gui/views/applicationinfoview.h @@ -44,7 +44,7 @@ namespace swift::gui::views CApplicationInfoMenu(CApplicationInfoView *modelView) : menus::IMenuDelegate(modelView) {} //! \copydoc menus::IMenuDelegate::customMenu - virtual void customMenu(menus::CMenuActions &menuActions) override; + void customMenu(menus::CMenuActions &menuActions) override; private: //! Model view diff --git a/src/gui/views/atcstationview.h b/src/gui/views/atcstationview.h index a6a852f519..8bb522e123 100644 --- a/src/gui/views/atcstationview.h +++ b/src/gui/views/atcstationview.h @@ -59,7 +59,7 @@ namespace swift::gui protected: //! \copydoc CViewBase::customMenu - virtual void customMenu(swift::gui::menus::CMenuActions &menuActions) override; + void customMenu(swift::gui::menus::CMenuActions &menuActions) override; private: void emitTestRequest1kAtcOnlineDummies() { emit this->testRequestDummyAtcOnlineStations(1000); } diff --git a/src/gui/views/checkboxdelegate.cpp b/src/gui/views/checkboxdelegate.cpp index 3608f266cb..0252fcab1d 100644 --- a/src/gui/views/checkboxdelegate.cpp +++ b/src/gui/views/checkboxdelegate.cpp @@ -25,8 +25,6 @@ namespace swift::gui::views : QItemDelegate(parent), m_iconCheckedUrl(iconCheckedUrl), m_iconUncheckedUrl(iconUncheckedUrl) {} - CCheckBoxDelegate::~CCheckBoxDelegate() {} - QWidget *CCheckBoxDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const { diff --git a/src/gui/views/checkboxdelegate.h b/src/gui/views/checkboxdelegate.h index b2f9da9cf2..af419c521e 100644 --- a/src/gui/views/checkboxdelegate.h +++ b/src/gui/views/checkboxdelegate.h @@ -33,21 +33,21 @@ namespace swift::gui::views CCheckBoxDelegate(const QString &iconCheckedUrl, const QString &iconUncheckedUrl, QObject *parent = nullptr); //! Destructor - ~CCheckBoxDelegate(); + ~CCheckBoxDelegate() override = default; //! \copydoc QItemDelegate::createEditor - virtual QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, - const QModelIndex &index) const override; + QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, + const QModelIndex &index) const override; //! \copydoc QItemDelegate::setEditorData - virtual void setEditorData(QWidget *editor, const QModelIndex &index) const override; + void setEditorData(QWidget *editor, const QModelIndex &index) const override; //! \copydoc QItemDelegate::setModelData - virtual void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override; + void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override; //! \copydoc QItemDelegate::updateEditorGeometry - virtual void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, - const QModelIndex &index) const override; + void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, + const QModelIndex &index) const override; private: QString m_iconCheckedUrl; diff --git a/src/gui/views/flightplandialog.cpp b/src/gui/views/flightplandialog.cpp index 89b1922a97..e6c48510fb 100644 --- a/src/gui/views/flightplandialog.cpp +++ b/src/gui/views/flightplandialog.cpp @@ -25,7 +25,7 @@ namespace swift::gui::views &CFlightPlanDialog::loadFp); } - CFlightPlanDialog::~CFlightPlanDialog() {} + CFlightPlanDialog::~CFlightPlanDialog() = default; void CFlightPlanDialog::showFlightPlan(const CCallsign &callsign) { diff --git a/src/gui/views/flightplandialog.h b/src/gui/views/flightplandialog.h index da956a0a8b..ef4b01939a 100644 --- a/src/gui/views/flightplandialog.h +++ b/src/gui/views/flightplandialog.h @@ -27,7 +27,7 @@ namespace swift::gui::views explicit CFlightPlanDialog(QWidget *parent = nullptr); //! Destructor - virtual ~CFlightPlanDialog() override; + ~CFlightPlanDialog() override; //! Show a particular callsign flight plan void showFlightPlan(const swift::misc::aviation::CCallsign &callsign); diff --git a/src/gui/views/radarview.h b/src/gui/views/radarview.h index 02f12b5744..078cfea81d 100644 --- a/src/gui/views/radarview.h +++ b/src/gui/views/radarview.h @@ -30,10 +30,10 @@ namespace swift::gui::views protected: //! \copydoc QWidget::resizeEvent - virtual void resizeEvent(QResizeEvent *event) override; + void resizeEvent(QResizeEvent *event) override; //! \copydoc QWidget::wheelEvent - virtual void wheelEvent(QWheelEvent *event) override; + void wheelEvent(QWheelEvent *event) override; }; } // namespace swift::gui::views diff --git a/src/gui/views/simulatedaircraftview.h b/src/gui/views/simulatedaircraftview.h index 93abb33413..b87a9c64b5 100644 --- a/src/gui/views/simulatedaircraftview.h +++ b/src/gui/views/simulatedaircraftview.h @@ -70,7 +70,7 @@ namespace swift::gui protected: //! \copydoc CViewBase::customMenu - virtual void customMenu(menus::CMenuActions &menuActions) override; + void customMenu(menus::CMenuActions &menuActions) override; private: //! Request text message for selected aircraft diff --git a/src/gui/views/userview.h b/src/gui/views/userview.h index 4ae4a681cb..6c892c270b 100644 --- a/src/gui/views/userview.h +++ b/src/gui/views/userview.h @@ -34,7 +34,7 @@ namespace swift::gui::views protected: //! \copydoc CViewBase::customMenu - virtual void customMenu(menus::CMenuActions &menuActions) override; + void customMenu(menus::CMenuActions &menuActions) override; private: //! Request text message for selected aircraft diff --git a/src/gui/views/viewbase.h b/src/gui/views/viewbase.h index 965990963a..6a76e19808 100644 --- a/src/gui/views/viewbase.h +++ b/src/gui/views/viewbase.h @@ -204,7 +204,7 @@ namespace swift::gui virtual bool acceptDrop(const QMimeData *mimeData) const = 0; //! \copydoc CEnableForDockWidgetInfoArea::setParentDockWidgetInfoArea - virtual bool setParentDockWidgetInfoArea(swift::gui::CDockWidgetInfoArea *parentDockableWidget) override; + bool setParentDockWidgetInfoArea(swift::gui::CDockWidgetInfoArea *parentDockableWidget) override; //! Resize mode ResizeMode getResizeMode() const { return m_resizeMode; } @@ -301,7 +301,7 @@ namespace swift::gui Menu getMenu() const { return m_menus; } //! \copydoc QTableView::setSelectionModel - virtual void setSelectionModel(QItemSelectionModel *model) override; + void setSelectionModel(QItemSelectionModel *model) override; //! Main application window widget if any QWidget *mainApplicationWindowWidget() const; @@ -430,7 +430,7 @@ namespace swift::gui CViewBaseNonTemplate(QWidget *parent); //! Destructor - virtual ~CViewBaseNonTemplate() override; + ~CViewBaseNonTemplate() override; //! Method creating the menu //! \remarks override this method to contribute to the menu @@ -440,19 +440,19 @@ namespace swift::gui //! \name Functions from QTableView //! @{ //! \copydoc QTableView::resizeEvent - virtual void resizeEvent(QResizeEvent *event) override; + void resizeEvent(QResizeEvent *event) override; //! \copydoc QTableView::dragEnterEvent - virtual void dragEnterEvent(QDragEnterEvent *event) override; + void dragEnterEvent(QDragEnterEvent *event) override; //! \copydoc QTableView::dragMoveEvent - virtual void dragMoveEvent(QDragMoveEvent *event) override; + void dragMoveEvent(QDragMoveEvent *event) override; //! \copydoc QTableView::dragLeaveEvent - virtual void dragLeaveEvent(QDragLeaveEvent *event) override; + void dragLeaveEvent(QDragLeaveEvent *event) override; //! \copydoc QTableView::dropEvent - virtual void dropEvent(QDropEvent *event) override; + void dropEvent(QDropEvent *event) override; //! @} //! Perform resizing (no presizing) / non slot method for template @@ -660,7 +660,7 @@ namespace swift::gui using ObjectType = typename T::ObjectType; //! Destructor - virtual ~CViewBase() + ~CViewBase() override { if (m_model) { m_model->markDestroyed(); } } @@ -716,13 +716,13 @@ namespace swift::gui //! @{ //! \copydoc swift::gui::models::ISelectionModel::selectObjects - virtual void selectObjects(const ContainerType &selectedObjects) override; + void selectObjects(const ContainerType &selectedObjects) override; //! \copydoc swift::gui::models::ISelectionModel::selectedObjects - virtual ContainerType selectedObjects() const override; + ContainerType selectedObjects() const override; //! \copydoc swift::gui::models::ISelectionModel::unselectedObjects - virtual ContainerType unselectedObjects() const override; + ContainerType unselectedObjects() const override; //! @} //! First selected, the only one, or default @@ -762,70 +762,70 @@ namespace swift::gui //! @{ //!\copydoc swift::gui::views::CViewBaseNonTemplate::removeSelectedRows - virtual int removeSelectedRows() override; + int removeSelectedRows() override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::presizeOrFullResizeToContents - virtual void presizeOrFullResizeToContents() override; + void presizeOrFullResizeToContents() override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::clearHighlighting - virtual void clearHighlighting() override; + void clearHighlighting() override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::materializeFilter - virtual void materializeFilter() override; + void materializeFilter() override; //! @} //! \name swift::gui::views::CViewBaseNonTemplate implementations //! @{ //!\copydoc swift::gui::views::CViewBaseNonTemplate::clear - virtual void clear() override; + void clear() override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::rowCount - virtual int rowCount() const override; + int rowCount() const override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::isEmpty - virtual bool isEmpty() const override; + bool isEmpty() const override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::isOrderable - virtual bool isOrderable() const override; + bool isOrderable() const override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::allowDragDrop - virtual void allowDragDrop(bool allowDrag, bool allowDrop, bool allowDropJsonFile = false) override; + void allowDragDrop(bool allowDrag, bool allowDrop, bool allowDropJsonFile = false) override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::isDropAllowed - virtual bool isDropAllowed() const override; + bool isDropAllowed() const override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::dropEvent - virtual void dropEvent(QDropEvent *event) override; + void dropEvent(QDropEvent *event) override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::acceptDrop - virtual bool acceptDrop(const QMimeData *mimeData) const override; + bool acceptDrop(const QMimeData *mimeData) const override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::setSorting - virtual bool setSorting(const swift::misc::CPropertyIndex &propertyIndex, - Qt::SortOrder order = Qt::AscendingOrder) override; + bool setSorting(const swift::misc::CPropertyIndex &propertyIndex, + Qt::SortOrder order = Qt::AscendingOrder) override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::sortByPropertyIndex - virtual void sortByPropertyIndex(const swift::misc::CPropertyIndex &propertyIndex, - Qt::SortOrder order = Qt::AscendingOrder) override; + void sortByPropertyIndex(const swift::misc::CPropertyIndex &propertyIndex, + Qt::SortOrder order = Qt::AscendingOrder) override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::setNoSorting - virtual void setNoSorting() override { m_model->setNoSorting(); } + void setNoSorting() override { m_model->setNoSorting(); } //!\copydoc swift::gui::views::CViewBaseNonTemplate::getSortProperty - virtual swift::misc::CPropertyIndex getSortProperty() const override { return m_model->getSortProperty(); } + swift::misc::CPropertyIndex getSortProperty() const override { return m_model->getSortProperty(); } //!\copydoc swift::gui::views::CViewBaseNonTemplate::getSortColumn - virtual int getSortColumn() const override { return m_model->getSortColumn(); } + int getSortColumn() const override { return m_model->getSortColumn(); } //!\copydoc swift::gui::views::CViewBaseNonTemplate::hasValidSortColumn - virtual bool hasValidSortColumn() const override { return m_model->hasValidSortColumn(); } + bool hasValidSortColumn() const override { return m_model->hasValidSortColumn(); } //!\copydoc swift::gui::views::CViewBaseNonTemplate::endsWithEmptyColumn - virtual bool endsWithEmptyColumn() const override { return m_model->endsWithEmptyColumn(); } + bool endsWithEmptyColumn() const override { return m_model->endsWithEmptyColumn(); } //!\copydoc swift::gui::views::CViewBaseNonTemplate::getSortOrder - virtual Qt::SortOrder getSortOrder() const override { return m_model->getSortOrder(); } + Qt::SortOrder getSortOrder() const override { return m_model->getSortOrder(); } //! @} //! Sort if columns or order changed @@ -889,46 +889,46 @@ namespace swift::gui //! @{ //!\copydoc swift::gui::views::CViewBaseNonTemplate::reachedResizeThreshold - virtual bool reachedResizeThreshold(int containrerSize = -1) const override; + bool reachedResizeThreshold(int containrerSize = -1) const override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::performModeBasedResizeToContent - virtual void performModeBasedResizeToContent() override; + void performModeBasedResizeToContent() override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::performUpdateContainer - virtual int performUpdateContainer(const swift::misc::CVariant &variant, bool sort, bool resize) override; + int performUpdateContainer(const swift::misc::CVariant &variant, bool sort, bool resize) override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::updateSortIndicator - virtual void updateSortIndicator() override; + void updateSortIndicator() override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::mouseOverCallback - virtual void mouseOverCallback(const QModelIndex &index, bool mouseOver) override; + void mouseOverCallback(const QModelIndex &index, bool mouseOver) override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::drawDropIndicator - virtual void drawDropIndicator(bool indicator) override; + void drawDropIndicator(bool indicator) override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::copy - virtual void copy() override; + void copy() override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::cut - virtual void cut() override; + void cut() override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::paste - virtual void paste() override; + void paste() override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::displayJsonPopup - virtual void displayJsonPopup() override { this->displayContainerAsJsonPopup(false); } + void displayJsonPopup() override { this->displayContainerAsJsonPopup(false); } //!\copydoc swift::gui::views::CViewBaseNonTemplate::displaySelectedJsonPopup - virtual void displaySelectedJsonPopup() override { this->displayContainerAsJsonPopup(true); } + void displaySelectedJsonPopup() override { this->displayContainerAsJsonPopup(true); } //!\copydoc swift::gui::views::CViewBaseNonTemplate::filterDialogFinished - virtual bool filterDialogFinished(int status) override; + bool filterDialogFinished(int status) override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::filterWidgetChangedFilter - virtual bool filterWidgetChangedFilter(bool enabled) override; + bool filterWidgetChangedFilter(bool enabled) override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::removeFilter - virtual void removeFilter() override; + void removeFilter() override; //! @} //! Modify JSON data loaded in swift::gui::views::CViewBaseNonTemplate::loadJson @@ -942,10 +942,10 @@ namespace swift::gui virtual void jsonLoadedAndModelUpdated(const ContainerType &data); //! \copydoc swift::gui::views::CViewBaseNonTemplate::customMenu - virtual void customMenu(menus::CMenuActions &menuActions) override; + void customMenu(menus::CMenuActions &menuActions) override; //! \copydoc swift::gui::views::CViewBaseNonTemplate::customMenu - virtual swift::misc::CStatusMessage loadJsonFile(const QString &fileName) override; + swift::misc::CStatusMessage loadJsonFile(const QString &fileName) override; //! Display the container as JSON popup virtual void displayContainerAsJsonPopup(bool selectedOnly); @@ -954,20 +954,19 @@ namespace swift::gui //! @{ //!\copydoc swift::gui::views::CViewBaseNonTemplate::removeFilter - virtual void onClicked(const QModelIndex &index) override; + void onClicked(const QModelIndex &index) override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::onDoubleClicked - virtual void onDoubleClicked(const QModelIndex &index) override; + void onDoubleClicked(const QModelIndex &index) override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::onRowSelected - virtual void onRowSelected(const QModelIndex &index) override; + void onRowSelected(const QModelIndex &index) override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::loadJson - virtual swift::misc::CStatusMessage loadJson(const QString &directory = {}) override; + swift::misc::CStatusMessage loadJson(const QString &directory = {}) override; //!\copydoc swift::gui::views::CViewBaseNonTemplate::saveJson - virtual swift::misc::CStatusMessage saveJson(bool selectedOnly = false, - const QString &directory = {}) override; + swift::misc::CStatusMessage saveJson(bool selectedOnly = false, const QString &directory = {}) override; //! @} }; } // namespace views diff --git a/src/gui/views/viewbaseitemdelegate.h b/src/gui/views/viewbaseitemdelegate.h index 848b44deb7..0357e43674 100644 --- a/src/gui/views/viewbaseitemdelegate.h +++ b/src/gui/views/viewbaseitemdelegate.h @@ -27,11 +27,10 @@ namespace swift::gui::views //! @{ //! \copydoc QStyledItemDelegate::paint - virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, - const QModelIndex &index) const override; + void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; //! \copydoc QStyledItemDelegate::sizeHint - virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; + QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; //! @} private: diff --git a/src/gui/views/viewbasenontemplate.cpp b/src/gui/views/viewbasenontemplate.cpp index 39f9d79ff6..d2145a311f 100644 --- a/src/gui/views/viewbasenontemplate.cpp +++ b/src/gui/views/viewbasenontemplate.cpp @@ -88,10 +88,7 @@ namespace swift::gui::views resize->setContext(Qt::WidgetShortcut); } - CViewBaseNonTemplate::~CViewBaseNonTemplate() - { - // dtor - } + CViewBaseNonTemplate::~CViewBaseNonTemplate() = default; bool CViewBaseNonTemplate::setParentDockWidgetInfoArea(CDockWidgetInfoArea *parentDockableWidget) { diff --git a/src/gui/views/viewbaseproxystyle.h b/src/gui/views/viewbaseproxystyle.h index ec9af58653..8e05146276 100644 --- a/src/gui/views/viewbaseproxystyle.h +++ b/src/gui/views/viewbaseproxystyle.h @@ -28,8 +28,8 @@ namespace swift::gui::views //! @{ //! \copydoc QProxyStyle::drawPrimitive - virtual void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, - const QWidget *widget) const override; + void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, + const QWidget *widget) const override; //! @} private: diff --git a/src/gui/views/viewcallsignobjects.h b/src/gui/views/viewcallsignobjects.h index 533723ac2b..9bc8aa6863 100644 --- a/src/gui/views/viewcallsignobjects.h +++ b/src/gui/views/viewcallsignobjects.h @@ -58,7 +58,7 @@ namespace swift::gui int replaceOrAddObjectByCallsign(const ObjectType &object); //! Reselect by callsigns - virtual void selectObjects(const ContainerType &selectedObjects) override; + void selectObjects(const ContainerType &selectedObjects) override; protected: //! Constructor diff --git a/src/gui/views/viewdbobjects.h b/src/gui/views/viewdbobjects.h index 2471ef81ff..9409073da7 100644 --- a/src/gui/views/viewdbobjects.h +++ b/src/gui/views/viewdbobjects.h @@ -63,14 +63,14 @@ namespace swift::gui int replaceOrAddObjectsByKey(const ContainerType &container); //! Select by DB keys - virtual void selectObjects(const ContainerType &selectedObjects) override; + void selectObjects(const ContainerType &selectedObjects) override; protected: //! Constructor explicit CViewWithDbObjects(QWidget *parent = nullptr); //! \copydoc swift::gui::views::CViewBaseNonTemplate::customMenu - virtual void customMenu(swift::gui::menus::CMenuActions &menuActions) override; + void customMenu(swift::gui::menus::CMenuActions &menuActions) override; }; //! Base class for views with DB objects also orderable (based on swift::misc::IOrderableList ) @@ -91,14 +91,14 @@ namespace swift::gui using KeyType = typename T::KeyType; //! Select by DB keys - virtual void selectObjects(const ContainerType &selectedObjects) override; + void selectObjects(const ContainerType &selectedObjects) override; protected: //! Constructor explicit COrderableViewWithDbObjects(QWidget *parent = nullptr); //! \copydoc swift::gui::views::CViewBaseNonTemplate::customMenu - virtual void customMenu(swift::gui::menus::CMenuActions &menuActions) override; + void customMenu(swift::gui::menus::CMenuActions &menuActions) override; //! Move selected items void moveSelectedItems(int order); diff --git a/src/input/joystick.h b/src/input/joystick.h index 0e02d33464..fd5e259774 100644 --- a/src/input/joystick.h +++ b/src/input/joystick.h @@ -27,7 +27,7 @@ namespace swift::input IJoystick(QObject *parent = nullptr); //! Destructor - virtual ~IJoystick() {} + ~IJoystick() override = default; //! Creates a native joystick handler object static std::unique_ptr create(QObject *parent = nullptr); diff --git a/src/input/keyboard.h b/src/input/keyboard.h index e683e455f0..491e3c5483 100644 --- a/src/input/keyboard.h +++ b/src/input/keyboard.h @@ -28,7 +28,7 @@ namespace swift::input IKeyboard(QObject *parent = nullptr); //! Destructor - virtual ~IKeyboard() {} + ~IKeyboard() override = default; //! Creates a native keyboard handler object static std::unique_ptr create(QObject *parent = nullptr); diff --git a/src/input/linux/joysticklinux.h b/src/input/linux/joysticklinux.h index 451c2c0025..75f140951c 100644 --- a/src/input/linux/joysticklinux.h +++ b/src/input/linux/joysticklinux.h @@ -27,7 +27,7 @@ namespace swift::input public: //! Constructor CJoystickDevice(const QString &path, QFile *fd, QObject *parent); - ~CJoystickDevice(); + ~CJoystickDevice() override; //! Get device name QString getName() const { return m_name; } @@ -65,10 +65,10 @@ namespace swift::input CJoystickLinux &operator=(CJoystickLinux const &) = delete; //! \brief Destructor - virtual ~CJoystickLinux() = default; + ~CJoystickLinux() override = default; //! \copydoc swift::input::IJoystick::getAllAvailableJoystickButtons() - virtual swift::misc::input::CJoystickButtonList getAllAvailableJoystickButtons() const override; + swift::misc::input::CJoystickButtonList getAllAvailableJoystickButtons() const override; private: friend class IJoystick; diff --git a/src/input/linux/keyboardlinux.h b/src/input/linux/keyboardlinux.h index be8a8932cb..8452704db4 100644 --- a/src/input/linux/keyboardlinux.h +++ b/src/input/linux/keyboardlinux.h @@ -32,11 +32,11 @@ namespace swift::input CKeyboardLinux &operator=(CKeyboardLinux const &) = delete; //! Destructor - virtual ~CKeyboardLinux() override; + ~CKeyboardLinux() override; protected: //! \copydoc IKeyboard::init() - virtual bool init() override; + bool init() override; private slots: //! Changed directory to linux devices diff --git a/src/misc/CMakeLists.txt b/src/misc/CMakeLists.txt index 018a84ab4f..6d0e075a90 100644 --- a/src/misc/CMakeLists.txt +++ b/src/misc/CMakeLists.txt @@ -291,7 +291,6 @@ add_library(misc SHARED propertyindexref.h propertyindexvariantmap.cpp propertyindexvariantmap.h - provider.cpp provider.h range.h registermetadata.cpp diff --git a/src/misc/applicationinfolist.cpp b/src/misc/applicationinfolist.cpp index 66e5c0bc59..2823b02a99 100644 --- a/src/misc/applicationinfolist.cpp +++ b/src/misc/applicationinfolist.cpp @@ -14,8 +14,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc, CApplicationInfo, CApplicationInfoList namespace swift::misc { - CApplicationInfoList::CApplicationInfoList() {} - CApplicationInfoList::CApplicationInfoList(const CSequence &other) : CSequence(other) {} diff --git a/src/misc/applicationinfolist.h b/src/misc/applicationinfolist.h index 94e562fe61..b4927f234b 100644 --- a/src/misc/applicationinfolist.h +++ b/src/misc/applicationinfolist.h @@ -26,7 +26,7 @@ namespace swift::misc using CSequence::CSequence; //! Default constructor. - CApplicationInfoList(); + CApplicationInfoList() = default; //! Construct from base class object. CApplicationInfoList(const CSequence &other); diff --git a/src/misc/atomicfile.h b/src/misc/atomicfile.h index 036f915e33..afb9f3dab4 100644 --- a/src/misc/atomicfile.h +++ b/src/misc/atomicfile.h @@ -31,15 +31,15 @@ namespace swift::misc CAtomicFile(const QString &filename) : QFile(filename) {} //! \copydoc QFile::~QFile - virtual ~CAtomicFile() override; + ~CAtomicFile() override; //! \copydoc QFile::open //! Just before opening the file, the filename is changed so we actually write to a temporary file. - virtual bool open(OpenMode mode) override; + bool open(OpenMode mode) override; //! \copydoc QFileDevice::close //! After closing the file, it is renamed so that it overwrites the target file. - virtual void close() override; + void close() override; //! Calls close() and returns false if there was an error at any stage. bool checkedClose(); diff --git a/src/misc/aviation/aircraftcategorylist.cpp b/src/misc/aviation/aircraftcategorylist.cpp index 6193c45c00..59e75f89b8 100644 --- a/src/misc/aviation/aircraftcategorylist.cpp +++ b/src/misc/aviation/aircraftcategorylist.cpp @@ -13,8 +13,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::aviation, CAircraftCategory, CAircraft namespace swift::misc::aviation { - CAircraftCategoryList::CAircraftCategoryList() {} - CAircraftCategoryList::CAircraftCategoryList(const CSequence &other) : CSequence(other) {} diff --git a/src/misc/aviation/aircraftcategorylist.h b/src/misc/aviation/aircraftcategorylist.h index 203612b991..22eaf521f6 100644 --- a/src/misc/aviation/aircraftcategorylist.h +++ b/src/misc/aviation/aircraftcategorylist.h @@ -34,7 +34,7 @@ namespace swift::misc::aviation using CSequence::CSequence; //! Default constructor. - CAircraftCategoryList(); + CAircraftCategoryList() = default; //! Construct from a base class object. CAircraftCategoryList(const CSequence &other); diff --git a/src/misc/aviation/aircraftengine.h b/src/misc/aviation/aircraftengine.h index 00b74cf3e1..da49cdc338 100644 --- a/src/misc/aviation/aircraftengine.h +++ b/src/misc/aviation/aircraftengine.h @@ -22,7 +22,7 @@ namespace swift::misc::aviation { public: //! Default constructor - CAircraftEngine() {} + CAircraftEngine() = default; //! Constructor //! \remark numbers are 1 based! diff --git a/src/misc/aviation/aircrafticaocode.h b/src/misc/aviation/aircrafticaocode.h index 3803067b70..1d525442e9 100644 --- a/src/misc/aviation/aircrafticaocode.h +++ b/src/misc/aviation/aircrafticaocode.h @@ -54,7 +54,7 @@ namespace swift::misc::aviation }; //! Default constructor. - CAircraftIcaoCode() {} + CAircraftIcaoCode() = default; //! Constructor. CAircraftIcaoCode(const QString &icao, const QString &combinedType = ""); diff --git a/src/misc/aviation/aircrafticaocodelist.cpp b/src/misc/aviation/aircrafticaocodelist.cpp index 77393529cc..6a999931e5 100644 --- a/src/misc/aviation/aircrafticaocodelist.cpp +++ b/src/misc/aviation/aircrafticaocodelist.cpp @@ -13,8 +13,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::aviation, CAircraftIcaoCode, CAircraft namespace swift::misc::aviation { - CAircraftIcaoCodeList::CAircraftIcaoCodeList() {} - CAircraftIcaoCodeList::CAircraftIcaoCodeList(const CSequence &other) : CSequence(other) {} diff --git a/src/misc/aviation/aircrafticaocodelist.h b/src/misc/aviation/aircrafticaocodelist.h index 14bd25ce59..68ea316753 100644 --- a/src/misc/aviation/aircrafticaocodelist.h +++ b/src/misc/aviation/aircrafticaocodelist.h @@ -35,7 +35,7 @@ namespace swift::misc::aviation using CSequence::CSequence; //! Default constructor. - CAircraftIcaoCodeList(); + CAircraftIcaoCodeList() = default; //! Construct from a base class object. CAircraftIcaoCodeList(const CSequence &other); diff --git a/src/misc/aviation/aircraftparts.h b/src/misc/aviation/aircraftparts.h index fcc2292384..8a6da191a4 100644 --- a/src/misc/aviation/aircraftparts.h +++ b/src/misc/aviation/aircraftparts.h @@ -46,7 +46,7 @@ namespace swift::misc::aviation }; //! Default constructor - CAircraftParts() {} + CAircraftParts() = default; //! Default constructor CAircraftParts(int flapsPercent); diff --git a/src/misc/aviation/aircraftpartslist.cpp b/src/misc/aviation/aircraftpartslist.cpp index 7a61e8c77f..b6ac663a8e 100644 --- a/src/misc/aviation/aircraftpartslist.cpp +++ b/src/misc/aviation/aircraftpartslist.cpp @@ -9,8 +9,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::aviation, CAircraftParts, CAircraftPar namespace swift::misc::aviation { - CAircraftPartsList::CAircraftPartsList() {} - CAircraftPartsList::CAircraftPartsList(const CSequence &other) : CSequence(other) {} int CAircraftPartsList::setOnGround(bool onGround) diff --git a/src/misc/aviation/aircraftpartslist.h b/src/misc/aviation/aircraftpartslist.h index b71b8b4ae5..3865672348 100644 --- a/src/misc/aviation/aircraftpartslist.h +++ b/src/misc/aviation/aircraftpartslist.h @@ -31,7 +31,7 @@ namespace swift::misc::aviation using CSequence::CSequence; //! Default constructor. - CAircraftPartsList(); + CAircraftPartsList() = default; //! Construct from a base class object. CAircraftPartsList(const CSequence &other); diff --git a/src/misc/aviation/aircraftsituation.cpp b/src/misc/aviation/aircraftsituation.cpp index 66d8d5571b..012a8659a3 100644 --- a/src/misc/aviation/aircraftsituation.cpp +++ b/src/misc/aviation/aircraftsituation.cpp @@ -87,8 +87,6 @@ namespace swift::misc::aviation qRegisterMetaType(); } - CAircraftSituation::CAircraftSituation() {} - CAircraftSituation::CAircraftSituation(const CCallsign &correspondingCallsign) : m_correspondingCallsign(correspondingCallsign) {} diff --git a/src/misc/aviation/aircraftsituation.h b/src/misc/aviation/aircraftsituation.h index 45c500b953..c6f56e62a9 100644 --- a/src/misc/aviation/aircraftsituation.h +++ b/src/misc/aviation/aircraftsituation.h @@ -104,7 +104,7 @@ namespace swift::misc }; //! Default constructor. - CAircraftSituation(); + CAircraftSituation() = default; //! Constructor with callsign CAircraftSituation(const CCallsign &correspondingCallsign); @@ -143,7 +143,7 @@ namespace swift::misc bool isPositionOrAltitudeNull() const { return this->isPositionNull() || this->getAltitude().isNull(); } //! Null situation - virtual bool isNull() const override; + bool isNull() const override; //! Is given info better (more accurate)? bool isOtherElevationInfoBetter(GndElevationInfo otherInfo, bool transferred) const; @@ -171,10 +171,10 @@ namespace swift::misc void setPosition(const geo::CCoordinateGeodetic &position) { m_position = position; } //! \copydoc geo::ICoordinateGeodetic::latitude() - virtual geo::CLatitude latitude() const override { return m_position.latitude(); } + geo::CLatitude latitude() const override { return m_position.latitude(); } //! \copydoc geo::ICoordinateGeodetic::longitude() - virtual geo::CLongitude longitude() const override { return m_position.longitude(); } + geo::CLongitude longitude() const override { return m_position.longitude(); } //! Is on ground? bool isOnGround() const { return m_onGroundInfo.getOnGround() == COnGroundInfo::OnGround; } @@ -210,13 +210,10 @@ namespace swift::misc const CAltitude &geodeticHeight() const override { return m_position.geodeticHeight(); } //! \copydoc geo::ICoordinateGeodetic::normalVector - virtual QVector3D normalVector() const override { return m_position.normalVector(); } + QVector3D normalVector() const override { return m_position.normalVector(); } //! \copydoc geo::ICoordinateGeodetic::normalVectorDouble - virtual std::array normalVectorDouble() const override - { - return m_position.normalVectorDouble(); - } + std::array normalVectorDouble() const override { return m_position.normalVectorDouble(); } //! Elevation of the ground directly beneath const CAltitude &getGroundElevation() const { return m_groundElevationPlane.getAltitude(); } diff --git a/src/misc/aviation/aircraftsituationchangelist.cpp b/src/misc/aviation/aircraftsituationchangelist.cpp index 1e931f1a2c..dc8ce7a8fe 100644 --- a/src/misc/aviation/aircraftsituationchangelist.cpp +++ b/src/misc/aviation/aircraftsituationchangelist.cpp @@ -7,8 +7,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::aviation, CAircraftSituationChange, CA namespace swift::misc::aviation { - CAircraftSituationChangeList::CAircraftSituationChangeList() {} - CAircraftSituationChangeList::CAircraftSituationChangeList(const CSequence &other) : CSequence(other) {} diff --git a/src/misc/aviation/aircraftsituationchangelist.h b/src/misc/aviation/aircraftsituationchangelist.h index b88b2d3aa5..c22b840676 100644 --- a/src/misc/aviation/aircraftsituationchangelist.h +++ b/src/misc/aviation/aircraftsituationchangelist.h @@ -27,7 +27,7 @@ namespace swift::misc::aviation using CSequence::CSequence; //! Default constructor. - CAircraftSituationChangeList(); + CAircraftSituationChangeList() = default; //! Construct from a base class object. CAircraftSituationChangeList(const CSequence &other); diff --git a/src/misc/aviation/aircraftvelocity.cpp b/src/misc/aviation/aircraftvelocity.cpp index f812c125fd..4d890b4657 100644 --- a/src/misc/aviation/aircraftvelocity.cpp +++ b/src/misc/aviation/aircraftvelocity.cpp @@ -18,8 +18,6 @@ namespace swift::misc::aviation const CAngleUnit CAircraftVelocity::c_pbhAngleUnit = CAngleUnit::rad(); const CTimeUnit CAircraftVelocity::c_timeUnit = CTimeUnit::s(); - CAircraftVelocity::CAircraftVelocity() = default; - CAircraftVelocity::CAircraftVelocity(double x, double y, double z, CSpeedUnit xyzUnit, double pitch, double roll, double heading, CAngleUnit pbhAngleUnit, CTimeUnit pbhTimeUnit) { diff --git a/src/misc/aviation/aircraftvelocity.h b/src/misc/aviation/aircraftvelocity.h index 42c343722b..cf9db29809 100644 --- a/src/misc/aviation/aircraftvelocity.h +++ b/src/misc/aviation/aircraftvelocity.h @@ -34,7 +34,7 @@ namespace swift::misc::aviation }; //! Default constructor - CAircraftVelocity(); + CAircraftVelocity() = default; //! Constructor CAircraftVelocity(double x, double y, double z, physical_quantities::CSpeedUnit xyzUnit, double pitch, diff --git a/src/misc/aviation/airlineicaocodelist.cpp b/src/misc/aviation/airlineicaocodelist.cpp index b096e12876..fdc0f59cb3 100644 --- a/src/misc/aviation/airlineicaocodelist.cpp +++ b/src/misc/aviation/airlineicaocodelist.cpp @@ -20,8 +20,6 @@ namespace swift::misc::aviation return cats; } - CAirlineIcaoCodeList::CAirlineIcaoCodeList() {} - CAirlineIcaoCodeList::CAirlineIcaoCodeList(const CSequence &other) : CSequence(other) {} diff --git a/src/misc/aviation/airlineicaocodelist.h b/src/misc/aviation/airlineicaocodelist.h index 71380c6ce5..6e77002e76 100644 --- a/src/misc/aviation/airlineicaocodelist.h +++ b/src/misc/aviation/airlineicaocodelist.h @@ -38,7 +38,7 @@ namespace swift::misc::aviation static const QStringList &getLogCategories(); //! Default constructor. - CAirlineIcaoCodeList(); + CAirlineIcaoCodeList() = default; //! Construct from a base class object. CAirlineIcaoCodeList(const CSequence &other); diff --git a/src/misc/aviation/airport.h b/src/misc/aviation/airport.h index 396a844571..b4df40b5f9 100644 --- a/src/misc/aviation/airport.h +++ b/src/misc/aviation/airport.h @@ -132,22 +132,20 @@ namespace swift::misc::aviation bool hasValidIcaoCode() const { return !this->getIcao().isEmpty(); } //! NULL airport? - virtual bool isNull() const override; + bool isNull() const override; //! \copydoc geo::ICoordinateGeodetic::latitude - virtual swift::misc::geo::CLatitude latitude() const override { return this->getPosition().latitude(); } + + swift::misc::geo::CLatitude latitude() const override { return this->getPosition().latitude(); } //! \copydoc geo::ICoordinateGeodetic::longitude - virtual swift::misc::geo::CLongitude longitude() const override { return this->getPosition().longitude(); } + swift::misc::geo::CLongitude longitude() const override { return this->getPosition().longitude(); } //! \copydoc geo::ICoordinateGeodetic::normalVector - virtual QVector3D normalVector() const override { return this->getPosition().normalVector(); } + QVector3D normalVector() const override { return this->getPosition().normalVector(); } //! \copydoc geo::ICoordinateGeodetic::normalVectorDouble - virtual std::array normalVectorDouble() const override - { - return this->getPosition().normalVectorDouble(); - } + std::array normalVectorDouble() const override { return this->getPosition().normalVectorDouble(); } //! \copydoc swift::misc::mixin::Index::propertyByIndex QVariant propertyByIndex(swift::misc::CPropertyIndexRef index) const; diff --git a/src/misc/aviation/airporticaocode.h b/src/misc/aviation/airporticaocode.h index 3c4f3cc724..8b13a1bd86 100644 --- a/src/misc/aviation/airporticaocode.h +++ b/src/misc/aviation/airporticaocode.h @@ -25,7 +25,7 @@ namespace swift::misc::aviation { public: //! Default constructor. - CAirportIcaoCode() {} + CAirportIcaoCode() = default; //! Constructor CAirportIcaoCode(const QString &icaoCode) : m_icaoCode(CAirportIcaoCode::unifyAirportCode(icaoCode)) {} diff --git a/src/misc/aviation/atcstation.cpp b/src/misc/aviation/atcstation.cpp index 19d8b0520c..b18bab477f 100644 --- a/src/misc/aviation/atcstation.cpp +++ b/src/misc/aviation/atcstation.cpp @@ -25,8 +25,6 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::misc::aviation, CAtcStation) namespace swift::misc::aviation { - CAtcStation::CAtcStation() {} - CAtcStation::CAtcStation(const QString &callsign) : m_callsign(callsign) { m_callsign.setTypeHint(CCallsign::Atc); } CAtcStation::CAtcStation(const CCallsign &callsign, const CUser &controller, const CFrequency &frequency, diff --git a/src/misc/aviation/atcstation.h b/src/misc/aviation/atcstation.h index b61bb31a82..ee6a883973 100644 --- a/src/misc/aviation/atcstation.h +++ b/src/misc/aviation/atcstation.h @@ -58,7 +58,7 @@ namespace swift::misc::aviation }; //! Default constructor. - CAtcStation(); + CAtcStation() = default; //! Simplified constructor CAtcStation(const QString &callsign); @@ -202,19 +202,19 @@ namespace swift::misc::aviation void setLogoffTimeUtc(const QDateTime &logoffTimeUtc) { m_logoffTimeUtc = logoffTimeUtc; } //! \copydoc geo::ICoordinateGeodetic::latitude - virtual geo::CLatitude latitude() const override; + geo::CLatitude latitude() const override; //! \copydoc geo::ICoordinateGeodetic::longitude - virtual geo::CLongitude longitude() const override; + geo::CLongitude longitude() const override; //! \copydoc geo::ICoordinateGeodetic::geodeticHeight const aviation::CAltitude &geodeticHeight() const override; //! \copydoc geo::ICoordinateGeodetic::normalVector - virtual QVector3D normalVector() const override; + QVector3D normalVector() const override; //! \copydoc geo::ICoordinateGeodetic::normalVectorDouble - virtual std::array normalVectorDouble() const override; + std::array normalVectorDouble() const override; //! \copydoc swift::misc::mixin::Index::propertyByIndex QVariant propertyByIndex(CPropertyIndexRef index) const; diff --git a/src/misc/aviation/atcstationlist.cpp b/src/misc/aviation/atcstationlist.cpp index e335889a95..85eb9b05b8 100644 --- a/src/misc/aviation/atcstationlist.cpp +++ b/src/misc/aviation/atcstationlist.cpp @@ -19,8 +19,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::aviation, CAtcStation, CAtcStationList namespace swift::misc::aviation { - CAtcStationList::CAtcStationList() {} - CAtcStationList::CAtcStationList(const CSequence &other) : CSequence(other) {} CAtcStationList CAtcStationList::findIfComUnitTunedInChannelSpacing(const CComSystem &comUnit) const diff --git a/src/misc/aviation/atcstationlist.h b/src/misc/aviation/atcstationlist.h index f835771f3a..3c439ee766 100644 --- a/src/misc/aviation/atcstationlist.h +++ b/src/misc/aviation/atcstationlist.h @@ -35,7 +35,7 @@ namespace swift::misc::aviation using CSequence::CSequence; //! Default constructor. - CAtcStationList(); + CAtcStationList() = default; //! Construct from a base class object. CAtcStationList(const CSequence &other); diff --git a/src/misc/aviation/callsign.h b/src/misc/aviation/callsign.h index e37bf47f22..1614627a33 100644 --- a/src/misc/aviation/callsign.h +++ b/src/misc/aviation/callsign.h @@ -48,7 +48,7 @@ namespace swift::misc }; //! Default constructor. - CCallsign() {} + CCallsign() = default; //! Constructor CCallsign(const QString &callsign, TypeHint hint = NoHint); diff --git a/src/misc/aviation/callsignset.cpp b/src/misc/aviation/callsignset.cpp index 464f74712e..edd0d6047b 100644 --- a/src/misc/aviation/callsignset.cpp +++ b/src/misc/aviation/callsignset.cpp @@ -12,8 +12,6 @@ SWIFT_DEFINE_COLLECTION_MIXINS(swift::misc::aviation, CCallsign, CCallsignSet) namespace swift::misc::aviation { - CCallsignSet::CCallsignSet() {} - CCallsignSet::CCallsignSet(const QStringList &callsigns, CCallsign::TypeHint typeHint) { for (const QString &c : callsigns) diff --git a/src/misc/aviation/callsignset.h b/src/misc/aviation/callsignset.h index 3ef4126710..e770b38e0e 100644 --- a/src/misc/aviation/callsignset.h +++ b/src/misc/aviation/callsignset.h @@ -29,7 +29,7 @@ namespace swift::misc::aviation public: //! Default constructor - CCallsignSet(); + CCallsignSet() = default; //! By string list CCallsignSet(const QStringList &callsigns, CCallsign::TypeHint typeHint = CCallsign::NoHint); diff --git a/src/misc/aviation/comsystem.h b/src/misc/aviation/comsystem.h index fac643ac09..dba58ff153 100644 --- a/src/misc/aviation/comsystem.h +++ b/src/misc/aviation/comsystem.h @@ -58,7 +58,7 @@ namespace swift::misc::aviation }; //! Default constructor - CComSystem() {} + CComSystem() = default; //! Constructor CComSystem(const QString &name, const physical_quantities::CFrequency &activeFrequency, diff --git a/src/misc/aviation/flightplan.cpp b/src/misc/aviation/flightplan.cpp index afada2ad89..796ee40dce 100644 --- a/src/misc/aviation/flightplan.cpp +++ b/src/misc/aviation/flightplan.cpp @@ -28,8 +28,6 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::misc::aviation, CFlightPlan) namespace swift::misc::aviation { - CFlightPlanRemarks::CFlightPlanRemarks() {} - CFlightPlanRemarks::CFlightPlanRemarks(const QString &remarks, bool parse) : m_remarks(cleanRemarks(remarks)) { if (parse) { this->parseFlightPlanRemarks(); } diff --git a/src/misc/aviation/flightplan.h b/src/misc/aviation/flightplan.h index 8551616ad1..8b32428d4d 100644 --- a/src/misc/aviation/flightplan.h +++ b/src/misc/aviation/flightplan.h @@ -46,7 +46,7 @@ namespace swift::misc::aviation { public: //! Ctor - CFlightPlanRemarks(); + CFlightPlanRemarks() = default; //! Ctor CFlightPlanRemarks(const QString &remarks, bool parse = true); diff --git a/src/misc/aviation/flightplanlist.cpp b/src/misc/aviation/flightplanlist.cpp index bfe4cf0382..cde7282fff 100644 --- a/src/misc/aviation/flightplanlist.cpp +++ b/src/misc/aviation/flightplanlist.cpp @@ -7,7 +7,5 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::aviation, CFlightPlan, CFlightPlanList namespace swift::misc::aviation { - CFlightPlanList::CFlightPlanList() {} - CFlightPlanList::CFlightPlanList(const CSequence &other) : CSequence(other) {} } // namespace swift::misc::aviation diff --git a/src/misc/aviation/flightplanlist.h b/src/misc/aviation/flightplanlist.h index 11f8d23211..42541816ed 100644 --- a/src/misc/aviation/flightplanlist.h +++ b/src/misc/aviation/flightplanlist.h @@ -29,7 +29,7 @@ namespace swift::misc::aviation using CSequence::CSequence; //! Default constructor. - CFlightPlanList(); + CFlightPlanList() = default; //! Construct from a base class object. CFlightPlanList(const CSequence &other); diff --git a/src/misc/aviation/livery.cpp b/src/misc/aviation/livery.cpp index a8e3d51df6..4d50f3fe4d 100644 --- a/src/misc/aviation/livery.cpp +++ b/src/misc/aviation/livery.cpp @@ -25,8 +25,6 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::misc::aviation, CLivery) namespace swift::misc::aviation { - CLivery::CLivery() {} - CLivery::CLivery(const QString &combinedCode, const CAirlineIcaoCode &airline, const QString &description) : CLivery(-1, combinedCode, airline, description, "", "", false) {} diff --git a/src/misc/aviation/livery.h b/src/misc/aviation/livery.h index 23a09e3957..8d3aeb217c 100644 --- a/src/misc/aviation/livery.h +++ b/src/misc/aviation/livery.h @@ -40,7 +40,7 @@ namespace swift::misc::aviation }; //! Default constructor. - CLivery(); + CLivery() = default; //! Constructor CLivery(const QString &combinedCode, const CAirlineIcaoCode &airline, const QString &description); diff --git a/src/misc/aviation/liverylist.cpp b/src/misc/aviation/liverylist.cpp index 1305cf047c..20ac2ddfab 100644 --- a/src/misc/aviation/liverylist.cpp +++ b/src/misc/aviation/liverylist.cpp @@ -12,8 +12,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::aviation, CLivery, CLiveryList) namespace swift::misc::aviation { - CLiveryList::CLiveryList() {} - CLiveryList::CLiveryList(const CSequence &other) : CSequence(other) {} CLiveryList CLiveryList::findByAirlineIcaoDesignator(const QString &icao) const diff --git a/src/misc/aviation/liverylist.h b/src/misc/aviation/liverylist.h index fc7fb65dbd..327fb2f8ac 100644 --- a/src/misc/aviation/liverylist.h +++ b/src/misc/aviation/liverylist.h @@ -32,7 +32,7 @@ namespace swift::misc::aviation using CSequence::CSequence; //! Default constructor. - CLiveryList(); + CLiveryList() = default; //! Construct from a base class object. CLiveryList(const CSequence &other); diff --git a/src/misc/countrylist.cpp b/src/misc/countrylist.cpp index d16e3eae1e..3da08a7726 100644 --- a/src/misc/countrylist.cpp +++ b/src/misc/countrylist.cpp @@ -11,8 +11,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc, CCountry, CCountryList) namespace swift::misc { - CCountryList::CCountryList() {} - CCountryList::CCountryList(const CSequence &other) : CSequence(other) {} CCountry CCountryList::findByIsoCode(const QString &isoCode) const diff --git a/src/misc/countrylist.h b/src/misc/countrylist.h index 75688f2929..f0137357b5 100644 --- a/src/misc/countrylist.h +++ b/src/misc/countrylist.h @@ -35,7 +35,7 @@ namespace swift::misc using CSequence::CSequence; //! Default constructor. - CCountryList(); + CCountryList() = default; //! Construct from a base class object. CCountryList(const CSequence &other); diff --git a/src/misc/crashhandler.h b/src/misc/crashhandler.h index 708d760795..c8187ca807 100644 --- a/src/misc/crashhandler.h +++ b/src/misc/crashhandler.h @@ -30,7 +30,7 @@ namespace swift::misc static CCrashHandler *instance(); //! Destructor - virtual ~CCrashHandler(); + ~CCrashHandler() override; //! Initialize and start crashpad handler process void init(); diff --git a/src/misc/datacache.cpp b/src/misc/datacache.cpp index b317c9063d..5e3915c948 100644 --- a/src/misc/datacache.cpp +++ b/src/misc/datacache.cpp @@ -351,8 +351,6 @@ namespace swift::misc : m_basename(basename), m_session(std::make_unique(m_basename + "/.session")) {} - CDataCacheRevision::~CDataCacheRevision() = default; - CDataCacheRevision::LockGuard CDataCacheRevision::beginUpdate(const QMap ×tamps, bool updateUuid, bool pinsOnly) { diff --git a/src/misc/datacache.h b/src/misc/datacache.h index ef77ec5594..ccb823ca71 100644 --- a/src/misc/datacache.h +++ b/src/misc/datacache.h @@ -83,7 +83,7 @@ namespace swift::misc CDataCacheRevision(const QString &basename); //! Destructor. - ~CDataCacheRevision(); + ~CDataCacheRevision() = default; //! @{ //! Non-copyable. @@ -247,7 +247,7 @@ namespace swift::misc public: //! Destructor. - virtual ~CDataCache() override; + ~CDataCache() override; //! Return the singleton instance. static CDataCache *instance(); @@ -297,7 +297,7 @@ namespace swift::misc void saveToStoreAsync(const swift::misc::CValueCachePacket &values); void loadFromStoreAsync(); - virtual void connectPage(private_ns::CValuePage *page) override; + void connectPage(private_ns::CValuePage *page) override; QFileSystemWatcher m_watcher; diff --git a/src/misc/db/artifact.cpp b/src/misc/db/artifact.cpp index eb2c5e83ac..d2db3c4451 100644 --- a/src/misc/db/artifact.cpp +++ b/src/misc/db/artifact.cpp @@ -16,8 +16,6 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::misc::db, CArtifact) namespace swift::misc::db { - CArtifact::CArtifact() {} - CArtifact::CArtifact(const QString &name, const QString &version, const QString &md5, CArtifact::ArtifactType type, int size, bool existing, const CPlatform &platform) : m_name(name.trimmed()), m_md5(md5), m_type(static_cast(type)), m_size(size), m_existing(existing), diff --git a/src/misc/db/artifact.h b/src/misc/db/artifact.h index 53f8e23888..763b8ad7b8 100644 --- a/src/misc/db/artifact.h +++ b/src/misc/db/artifact.h @@ -46,7 +46,7 @@ namespace swift::misc::db }; //! Default constructor - CArtifact(); + CArtifact() = default; //! Constructor CArtifact(const QString &name, const QString &version, const QString &md5, ArtifactType type, int size, diff --git a/src/misc/db/artifactlist.cpp b/src/misc/db/artifactlist.cpp index 6d3dc4efd0..d75802e6ef 100644 --- a/src/misc/db/artifactlist.cpp +++ b/src/misc/db/artifactlist.cpp @@ -11,8 +11,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::db, CArtifact, CArtifactList) namespace swift::misc::db { - CArtifactList::CArtifactList() {} - CArtifactList::CArtifactList(const CSequence &other) : CSequence(other) {} CPlatformSet CArtifactList::getPlatforms() const diff --git a/src/misc/db/artifactlist.h b/src/misc/db/artifactlist.h index f083c3ca12..1d5d7e0e2c 100644 --- a/src/misc/db/artifactlist.h +++ b/src/misc/db/artifactlist.h @@ -32,7 +32,7 @@ namespace swift::misc::db using CSequence::CSequence; //! Empty constructor. - CArtifactList(); + CArtifactList() = default; //! Construct from a base class object. CArtifactList(const CSequence &other); diff --git a/src/misc/db/dbinfolist.cpp b/src/misc/db/dbinfolist.cpp index dddfc503a4..e9ff6c6d4e 100644 --- a/src/misc/db/dbinfolist.cpp +++ b/src/misc/db/dbinfolist.cpp @@ -9,8 +9,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::db, CDbInfo, CDbInfoList) namespace swift::misc::db { - CDbInfoList::CDbInfoList() {} - CDbInfoList::CDbInfoList(const CSequence &other) : CSequence(other) {} CDbInfo CDbInfoList::findFirstByEntityOrDefault(CEntityFlags::Entity entity) const diff --git a/src/misc/db/dbinfolist.h b/src/misc/db/dbinfolist.h index 97a1aadd3f..be0d2b39ef 100644 --- a/src/misc/db/dbinfolist.h +++ b/src/misc/db/dbinfolist.h @@ -30,7 +30,7 @@ namespace swift::misc::db using CSequence::CSequence; //! Default constructor. - CDbInfoList(); + CDbInfoList() = default; //! Construct from a base class object. CDbInfoList(const CSequence &other); diff --git a/src/misc/db/distribution.cpp b/src/misc/db/distribution.cpp index f67da4fa47..da411b3f7c 100644 --- a/src/misc/db/distribution.cpp +++ b/src/misc/db/distribution.cpp @@ -14,8 +14,6 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::misc::db, CDistribution) namespace swift::misc::db { - CDistribution::CDistribution() {} - CDistribution::CDistribution(const QString &channel, int stability, bool restricted) : m_channel(channel.trimmed().toUpper()), m_stability(stability), m_restricted(restricted) {} diff --git a/src/misc/db/distribution.h b/src/misc/db/distribution.h index d1d3ec20b4..cdbc7f44a0 100644 --- a/src/misc/db/distribution.h +++ b/src/misc/db/distribution.h @@ -36,7 +36,7 @@ namespace swift::misc::db }; //! Default constructor - CDistribution(); + CDistribution() = default; //! Constructor CDistribution(const QString &channel, int stability, bool restricted); diff --git a/src/misc/db/distributionlist.cpp b/src/misc/db/distributionlist.cpp index a214fc96f2..cad706464d 100644 --- a/src/misc/db/distributionlist.cpp +++ b/src/misc/db/distributionlist.cpp @@ -9,8 +9,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::db, CDistribution, CDistributionList) namespace swift::misc::db { - CDistributionList::CDistributionList() {} - CDistributionList::CDistributionList(const CSequence &other) : CSequence(other) {} QStringList CDistributionList::getChannels() const diff --git a/src/misc/db/distributionlist.h b/src/misc/db/distributionlist.h index 46671cf8b4..dd3b1ce5ec 100644 --- a/src/misc/db/distributionlist.h +++ b/src/misc/db/distributionlist.h @@ -34,7 +34,7 @@ namespace swift::misc::db using CSequence::CSequence; //! Empty constructor. - CDistributionList(); + CDistributionList() = default; //! Construct from a base class object. CDistributionList(const CSequence &other); diff --git a/src/misc/db/updateinfo.h b/src/misc/db/updateinfo.h index c351dd8f04..5b69a4ce2d 100644 --- a/src/misc/db/updateinfo.h +++ b/src/misc/db/updateinfo.h @@ -32,13 +32,13 @@ namespace swift::misc::db }; //! Constructor - CUpdateInfo() {} + CUpdateInfo() = default; //! Constructor CUpdateInfo(const CArtifactList &artifacts, const CDistributionList &distributions); //! Destructor. - ~CUpdateInfo() {} + ~CUpdateInfo() = default; //! Artifacts (pilot client) const CArtifactList &getArtifactsPilotClient() const { return m_artifactsPilotClient; } diff --git a/src/misc/dbusserver.h b/src/misc/dbusserver.h index 3c826d9548..1faa707fec 100644 --- a/src/misc/dbusserver.h +++ b/src/misc/dbusserver.h @@ -60,7 +60,7 @@ namespace swift::misc CDBusServer(const QString &service, const QString &address, QObject *parent = nullptr); //! Destructor - virtual ~CDBusServer() override; + ~CDBusServer() override; //! Add a QObject to be exposed via DBus void addObject(const QString &name, QObject *object); diff --git a/src/misc/dictionary.h b/src/misc/dictionary.h index 6d70924810..47a3d95732 100644 --- a/src/misc/dictionary.h +++ b/src/misc/dictionary.h @@ -276,7 +276,7 @@ namespace swift::misc } //! Default constructor. - CDictionary() {} + CDictionary() = default; //! Initializer list constructor. CDictionary(std::initializer_list> il) : m_impl(il) {} diff --git a/src/misc/geo/coordinategeodetic.cpp b/src/misc/geo/coordinategeodetic.cpp index 400f465a82..e9d5ce2633 100644 --- a/src/misc/geo/coordinategeodetic.cpp +++ b/src/misc/geo/coordinategeodetic.cpp @@ -19,8 +19,6 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::misc::geo, CCoordinateGeodetic) namespace swift::misc::geo { - ICoordinateGeodetic::~ICoordinateGeodetic() {} - QString CCoordinateGeodetic::convertToQString(bool i18n) const { return ICoordinateGeodetic::convertToQString(i18n); @@ -525,8 +523,6 @@ namespace swift::misc::geo ICoordinateGeodetic::convertToQString(i18n); } - ICoordinateWithRelativePosition::ICoordinateWithRelativePosition() {} - bool ICoordinateWithRelativePosition::canHandleIndex(CPropertyIndexRef index) { if (ICoordinateGeodetic::canHandleIndex(index)) { return true; } diff --git a/src/misc/geo/coordinategeodetic.h b/src/misc/geo/coordinategeodetic.h index b2966c2e65..5014e78341 100644 --- a/src/misc/geo/coordinategeodetic.h +++ b/src/misc/geo/coordinategeodetic.h @@ -54,7 +54,7 @@ namespace swift::misc ICoordinateGeodetic() = default; //! Destructor - virtual ~ICoordinateGeodetic(); + virtual ~ICoordinateGeodetic() = default; //! Copy constructor ICoordinateGeodetic(const ICoordinateGeodetic &) = default; @@ -216,7 +216,7 @@ namespace swift::misc protected: //! Constructor - ICoordinateWithRelativePosition(); + ICoordinateWithRelativePosition() = default; //! Can given index be handled? static bool canHandleIndex(CPropertyIndexRef index); @@ -232,7 +232,7 @@ namespace swift::misc { public: //! Default constructor (null coordinate) - CCoordinateGeodetic() {} + CCoordinateGeodetic() = default; //! Constructor by normal vector CCoordinateGeodetic(const QVector3D &normal) @@ -264,19 +264,19 @@ namespace swift::misc const physical_quantities::CAngle &relBearing) const; //! \copydoc ICoordinateGeodetic::latitude - virtual CLatitude latitude() const override; + CLatitude latitude() const override; //! \copydoc ICoordinateGeodetic::longitude - virtual CLongitude longitude() const override; + CLongitude longitude() const override; //! \copydoc ICoordinateGeodetic::geodeticHeight - virtual const aviation::CAltitude &geodeticHeight() const override { return m_geodeticHeight; } + const aviation::CAltitude &geodeticHeight() const override { return m_geodeticHeight; } //! \copydoc ICoordinateGeodetic::normalVector - virtual QVector3D normalVector() const override; + QVector3D normalVector() const override; //! \copydoc ICoordinateGeodetic::normalVectorDouble - virtual std::array normalVectorDouble() const override; + std::array normalVectorDouble() const override; //! \copydoc mixin::Index::propertyByIndex QVariant propertyByIndex(CPropertyIndexRef index) const; @@ -344,7 +344,7 @@ namespace swift::misc } //! Is null? - virtual bool isNull() const override + bool isNull() const override { if (m_geodeticHeight.isNull()) { return true; } return math::CMathUtils::epsilonZeroLimits(m_x) && math::CMathUtils::epsilonZeroLimits(m_y) && diff --git a/src/misc/geo/coordinategeodeticlist.cpp b/src/misc/geo/coordinategeodeticlist.cpp index b7511893b5..81e3bbdd06 100644 --- a/src/misc/geo/coordinategeodeticlist.cpp +++ b/src/misc/geo/coordinategeodeticlist.cpp @@ -12,8 +12,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::geo, CCoordinateGeodetic, CCoordinateG namespace swift::misc::geo { - CCoordinateGeodeticList::CCoordinateGeodeticList() {} - CCoordinateGeodeticList::CCoordinateGeodeticList(const CSequence &other) : CSequence(other) {} diff --git a/src/misc/geo/coordinategeodeticlist.h b/src/misc/geo/coordinategeodeticlist.h index 76a4f8c5f8..f58440fc31 100644 --- a/src/misc/geo/coordinategeodeticlist.h +++ b/src/misc/geo/coordinategeodeticlist.h @@ -34,7 +34,7 @@ namespace swift::misc::geo using CSequence::CSequence; //! Default constructor. - CCoordinateGeodeticList(); + CCoordinateGeodeticList() = default; //! Construct from a base class object. CCoordinateGeodeticList(const CSequence &other); diff --git a/src/misc/geo/elevationplane.h b/src/misc/geo/elevationplane.h index 418752066a..6955c93dd5 100644 --- a/src/misc/geo/elevationplane.h +++ b/src/misc/geo/elevationplane.h @@ -33,7 +33,7 @@ namespace swift::misc::geo }; //! Default constructor - CElevationPlane() {} + CElevationPlane() = default; //! Plane at given coordinates with range to 2nd coordinate CElevationPlane(const ICoordinateGeodetic &coordinate, const ICoordinateGeodetic &rangeCoordinate); @@ -96,7 +96,7 @@ namespace swift::misc::geo double getAltitudeValue(const physical_quantities::CLengthUnit &unit) const; //! Existing value? - virtual bool isNull() const override; + bool isNull() const override; //! Check if elevation is within radius and can be used //! \remark checks against the set radius diff --git a/src/misc/icon.h b/src/misc/icon.h index d84e9a42fa..0814b30406 100644 --- a/src/misc/icon.h +++ b/src/misc/icon.h @@ -39,7 +39,7 @@ namespace swift::misc { public: //! Default constructor. - CIcon() {} + CIcon() = default; //! Constructor. CIcon(CIcons::IconIndex index); diff --git a/src/misc/iconlist.h b/src/misc/iconlist.h index b6c6bf1161..2d472bec78 100644 --- a/src/misc/iconlist.h +++ b/src/misc/iconlist.h @@ -31,7 +31,7 @@ namespace swift::misc public: //! Constructor - CIconList() {} + CIconList() = default; //! Construct from a base class object. CIconList(const CSequence &other); diff --git a/src/misc/identifierlist.cpp b/src/misc/identifierlist.cpp index 251ffe2114..f05fff0a2c 100644 --- a/src/misc/identifierlist.cpp +++ b/src/misc/identifierlist.cpp @@ -11,8 +11,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc, CIdentifier, CIdentifierList) namespace swift::misc { - CIdentifierList::CIdentifierList() {} - CIdentifierList::CIdentifierList(const CSequence &other) : CSequence(other) {} bool CIdentifierList::containsAnyNotIn(const CIdentifierList &other) const diff --git a/src/misc/identifierlist.h b/src/misc/identifierlist.h index 43357559dc..0409acaaea 100644 --- a/src/misc/identifierlist.h +++ b/src/misc/identifierlist.h @@ -27,7 +27,7 @@ namespace swift::misc using CSequence::CSequence; //! Default constructor. - CIdentifierList(); + CIdentifierList() = default; //! Construct from a base class object. CIdentifierList(const CSequence &other); diff --git a/src/misc/input/keyboardkeylist.cpp b/src/misc/input/keyboardkeylist.cpp index 5be39cefcf..57e7eb8eb1 100644 --- a/src/misc/input/keyboardkeylist.cpp +++ b/src/misc/input/keyboardkeylist.cpp @@ -9,8 +9,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::input, CKeyboardKey, CKeyboardKeyList) namespace swift::misc::input { - CKeyboardKeyList::CKeyboardKeyList() {} - CKeyboardKeyList::CKeyboardKeyList(const CSequence &baseClass) : CSequence(baseClass) {} QStringList CKeyboardKeyList::getKeyStrings() const diff --git a/src/misc/input/keyboardkeylist.h b/src/misc/input/keyboardkeylist.h index 35ed7977ca..02130c329e 100644 --- a/src/misc/input/keyboardkeylist.h +++ b/src/misc/input/keyboardkeylist.h @@ -29,7 +29,7 @@ namespace swift::misc::input using CSequence::CSequence; //! Default constructor - CKeyboardKeyList(); + CKeyboardKeyList() = default; //! Construct from a base class object. CKeyboardKeyList(const CSequence &baseClass); diff --git a/src/misc/logmessage.cpp b/src/misc/logmessage.cpp index 11438768ca..21a12e4cf7 100644 --- a/src/misc/logmessage.cpp +++ b/src/misc/logmessage.cpp @@ -10,8 +10,6 @@ namespace swift::misc { - CLogMessage::CLogMessage() = default; - CLogMessage::CLogMessage(const char *file, int line, const char *function) : m_logger(file, line, function) {} CLogMessage::operator CStatusMessage() { return { m_categories, m_severity, message() }; } diff --git a/src/misc/logmessage.h b/src/misc/logmessage.h index 67976317cc..f18aa195e1 100644 --- a/src/misc/logmessage.h +++ b/src/misc/logmessage.h @@ -30,7 +30,7 @@ namespace swift::misc using CMessageBase::CMessageBase; //! Construct a message with the "uncategorized" category. - CLogMessage(); + CLogMessage() = default; //! Constructor taking filename, line number, and function name, for uncategorized verbose debug messages. CLogMessage(const char *file, int line, const char *function); diff --git a/src/misc/namevariantpairlist.cpp b/src/misc/namevariantpairlist.cpp index 3bacf65edf..bda704f4cf 100644 --- a/src/misc/namevariantpairlist.cpp +++ b/src/misc/namevariantpairlist.cpp @@ -9,8 +9,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc, CNameVariantPair, CNameVariantPairList namespace swift::misc { - CNameVariantPairList::CNameVariantPairList() {} - CNameVariantPairList::CNameVariantPairList(const CSequence &other) : CSequence(other) {} diff --git a/src/misc/namevariantpairlist.h b/src/misc/namevariantpairlist.h index 284224bd51..77a20090cf 100644 --- a/src/misc/namevariantpairlist.h +++ b/src/misc/namevariantpairlist.h @@ -30,7 +30,7 @@ namespace swift::misc using CSequence::CSequence; //! Default constructor. - CNameVariantPairList(); + CNameVariantPairList() = default; //! Construct from a base class object. CNameVariantPairList(const CSequence &other); diff --git a/src/misc/network/authenticateduser.cpp b/src/misc/network/authenticateduser.cpp index 95ae12b027..d3cafeed81 100644 --- a/src/misc/network/authenticateduser.cpp +++ b/src/misc/network/authenticateduser.cpp @@ -15,8 +15,6 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::misc::network, CAuthenticatedUser) namespace swift::misc::network { - CAuthenticatedUser::CAuthenticatedUser() {} - CAuthenticatedUser::CAuthenticatedUser(int id, const QString &realname) : IDatastoreObjectWithIntegerKey(id), m_realname(realname.trimmed()) {} diff --git a/src/misc/network/authenticateduser.h b/src/misc/network/authenticateduser.h index 2362b4fcdd..ae1b9c1f68 100644 --- a/src/misc/network/authenticateduser.h +++ b/src/misc/network/authenticateduser.h @@ -43,7 +43,7 @@ namespace swift::misc::network }; //! Default constructor. - CAuthenticatedUser(); + CAuthenticatedUser() = default; //! Constructor. CAuthenticatedUser(int id, const QString &realname); diff --git a/src/misc/network/clientlist.cpp b/src/misc/network/clientlist.cpp index c352d2a3ae..d99dc62804 100644 --- a/src/misc/network/clientlist.cpp +++ b/src/misc/network/clientlist.cpp @@ -9,7 +9,5 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::network, CClient, CClientList) namespace swift::misc::network { - CClientList::CClientList() {} - CClientList::CClientList(const CSequence &other) : CSequence(other) {} } // namespace swift::misc::network diff --git a/src/misc/network/clientlist.h b/src/misc/network/clientlist.h index f0fecaa68d..07bd75abe9 100644 --- a/src/misc/network/clientlist.h +++ b/src/misc/network/clientlist.h @@ -30,7 +30,7 @@ namespace swift::misc::network using CSequence::CSequence; //! Default constructor. - CClientList(); + CClientList() = default; //! Construct from a base class object. CClientList(const CSequence &other); diff --git a/src/misc/network/clientprovider.h b/src/misc/network/clientprovider.h index 1526eb7d21..a4a0116423 100644 --- a/src/misc/network/clientprovider.h +++ b/src/misc/network/clientprovider.h @@ -88,21 +88,21 @@ namespace swift::misc { public: //! clientprovider - virtual CClientList getClients() const override; - virtual void setClients(const CClientList &clients) override; - virtual void clearClients() override; - virtual CClientList getClientsForCallsigns(const aviation::CCallsignSet &callsigns) const override; - virtual CClient getClientOrDefaultForCallsign(const aviation::CCallsign &callsign) const override; - virtual bool hasClientInfo(const aviation::CCallsign &callsign) const override; - virtual bool addNewClient(const CClient &client) override; - virtual bool setOtherClient(const swift::misc::network::CClient &client) override; - virtual int updateOrAddClient(const aviation::CCallsign &callsign, const CPropertyIndexVariantMap &vm, - bool skipEqualValues = true) override; - virtual int removeClient(const aviation::CCallsign &callsign) override; - virtual bool autoAdjustCientGndCapability(const aviation::CAircraftSituation &situation) override; - virtual bool addClientGndCapability(const aviation::CCallsign &callsign) override; - virtual bool setClientGndCapability(const aviation::CCallsign &callsign, bool supportGndFlag) override; - virtual void markAsSwiftClient(const aviation::CCallsign &callsign) override; + CClientList getClients() const override; + void setClients(const CClientList &clients) override; + void clearClients() override; + CClientList getClientsForCallsigns(const aviation::CCallsignSet &callsigns) const override; + CClient getClientOrDefaultForCallsign(const aviation::CCallsign &callsign) const override; + bool hasClientInfo(const aviation::CCallsign &callsign) const override; + bool addNewClient(const CClient &client) override; + bool setOtherClient(const swift::misc::network::CClient &client) override; + int updateOrAddClient(const aviation::CCallsign &callsign, const CPropertyIndexVariantMap &vm, + bool skipEqualValues = true) override; + int removeClient(const aviation::CCallsign &callsign) override; + bool autoAdjustCientGndCapability(const aviation::CAircraftSituation &situation) override; + bool addClientGndCapability(const aviation::CCallsign &callsign) override; + bool setClientGndCapability(const aviation::CCallsign &callsign, bool supportGndFlag) override; + void markAsSwiftClient(const aviation::CCallsign &callsign) override; private: CClientPerCallsign m_clients; diff --git a/src/misc/network/ecosystem.h b/src/misc/network/ecosystem.h index ad951dc1a3..2d6489422e 100644 --- a/src/misc/network/ecosystem.h +++ b/src/misc/network/ecosystem.h @@ -39,7 +39,7 @@ namespace swift::misc::network }; //! Default constructor - CEcosystem() {} + CEcosystem() = default; //! Constructor CEcosystem(System s) : m_system(static_cast(s)) {} diff --git a/src/misc/network/ecosystemlist.cpp b/src/misc/network/ecosystemlist.cpp index ce27d5dd2d..37b504e83e 100644 --- a/src/misc/network/ecosystemlist.cpp +++ b/src/misc/network/ecosystemlist.cpp @@ -7,8 +7,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::network, CEcosystem, CEcosystemList) namespace swift::misc::network { - CEcosystemList::CEcosystemList() {} - CEcosystemList::CEcosystemList(const CSequence &other) : CSequence(other) {} QStringList CEcosystemList::allSystemStrings() const diff --git a/src/misc/network/ecosystemlist.h b/src/misc/network/ecosystemlist.h index 1376c7d440..60eb1c9ead 100644 --- a/src/misc/network/ecosystemlist.h +++ b/src/misc/network/ecosystemlist.h @@ -28,7 +28,7 @@ namespace swift::misc::network using CSequence::CSequence; //! Default constructor. - CEcosystemList(); + CEcosystemList() = default; //! Construct from a base class object. CEcosystemList(const CSequence &other); diff --git a/src/misc/network/fsdsetup.h b/src/misc/network/fsdsetup.h index c321aa0a65..9019453538 100644 --- a/src/misc/network/fsdsetup.h +++ b/src/misc/network/fsdsetup.h @@ -65,7 +65,7 @@ namespace swift::misc::network //! @} //! Default constructor. - CFsdSetup() {} + CFsdSetup() = default; //! Constructor. CFsdSetup(SendReceiveDetails sendReceive); diff --git a/src/misc/network/rawfsdmessagelist.cpp b/src/misc/network/rawfsdmessagelist.cpp index 4cb3bdc081..4019c1873b 100644 --- a/src/misc/network/rawfsdmessagelist.cpp +++ b/src/misc/network/rawfsdmessagelist.cpp @@ -7,8 +7,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::network, CRawFsdMessage, CRawFsdMessag namespace swift::misc::network { - CRawFsdMessageList::CRawFsdMessageList() {} - CRawFsdMessageList::CRawFsdMessageList(const CSequence &other) : CSequence(other) {} CRawFsdMessageList CRawFsdMessageList::findByPacketType(const QString &type) const diff --git a/src/misc/network/rawfsdmessagelist.h b/src/misc/network/rawfsdmessagelist.h index f9754350cd..a046582b9e 100644 --- a/src/misc/network/rawfsdmessagelist.h +++ b/src/misc/network/rawfsdmessagelist.h @@ -31,7 +31,7 @@ namespace swift::misc::network using CSequence::CSequence; //! Default constructor. - CRawFsdMessageList(); + CRawFsdMessageList() = default; //! Construct from a base class object. CRawFsdMessageList(const CSequence &other); diff --git a/src/misc/network/remotefilelist.cpp b/src/misc/network/remotefilelist.cpp index 3563c5e71e..f8b8753ffb 100644 --- a/src/misc/network/remotefilelist.cpp +++ b/src/misc/network/remotefilelist.cpp @@ -12,8 +12,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::network, CRemoteFile, CRemoteFileList) namespace swift::misc::network { - CRemoteFileList::CRemoteFileList() {} - CRemoteFileList::CRemoteFileList(const CSequence &other) : CSequence(other) {} QStringList CRemoteFileList::getNames(bool sorted) const diff --git a/src/misc/network/remotefilelist.h b/src/misc/network/remotefilelist.h index 6ec97734d8..2b5fe63dbe 100644 --- a/src/misc/network/remotefilelist.h +++ b/src/misc/network/remotefilelist.h @@ -28,7 +28,7 @@ namespace swift::misc::network using CSequence::CSequence; //! Default constructor. - CRemoteFileList(); + CRemoteFileList() = default; //! Construct from a base class object. CRemoteFileList(const CSequence &other); diff --git a/src/misc/network/rolelist.cpp b/src/misc/network/rolelist.cpp index e9fee5a104..0f0979486b 100644 --- a/src/misc/network/rolelist.cpp +++ b/src/misc/network/rolelist.cpp @@ -11,8 +11,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::network, CRole, CRoleList) namespace swift::misc::network { - CRoleList::CRoleList() {} - bool CRoleList::hasRole(const QString &roleName) const { return this->contains(&CRole::getName, roleName.trimmed().toUpper()); diff --git a/src/misc/network/rolelist.h b/src/misc/network/rolelist.h index 410121b38c..b0e72d780c 100644 --- a/src/misc/network/rolelist.h +++ b/src/misc/network/rolelist.h @@ -30,7 +30,7 @@ namespace swift::misc::network using CSequence::CSequence; //! Default constructor. - CRoleList(); + CRoleList() = default; //! Has role? bool hasRole(const QString &roleName) const; diff --git a/src/misc/network/server.h b/src/misc/network/server.h index 671db49c73..2b7e0829c2 100644 --- a/src/misc/network/server.h +++ b/src/misc/network/server.h @@ -60,7 +60,7 @@ namespace swift::misc::network static const QString &serverTypeToString(ServerType server); //! Default constructor. - CServer() {} + CServer() = default; //! Constructor. CServer(const QString &name, const QString &description, const QString &address, int port, const CUser &user, diff --git a/src/misc/network/serverlist.cpp b/src/misc/network/serverlist.cpp index c5c3b8c6a9..2d7b292242 100644 --- a/src/misc/network/serverlist.cpp +++ b/src/misc/network/serverlist.cpp @@ -7,8 +7,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::network, CServer, CServerList) namespace swift::misc::network { - CServerList::CServerList() {} - CServerList::CServerList(const CSequence &other) : CSequence(other) {} bool CServerList::containsName(const QString &name) const diff --git a/src/misc/network/serverlist.h b/src/misc/network/serverlist.h index 13c63b496d..aa2c31aeb9 100644 --- a/src/misc/network/serverlist.h +++ b/src/misc/network/serverlist.h @@ -26,7 +26,7 @@ namespace swift::misc::network using CSequence::CSequence; //! Default constructor. - CServerList(); + CServerList() = default; //! Construct from a base class object. CServerList(const CSequence &other); diff --git a/src/misc/network/textmessage.h b/src/misc/network/textmessage.h index 25a10b02e7..3668758b8e 100644 --- a/src/misc/network/textmessage.h +++ b/src/misc/network/textmessage.h @@ -40,7 +40,7 @@ namespace swift::misc::network }; //! Default constructor. - CTextMessage() {} + CTextMessage() = default; //! Constructor, radio message CTextMessage(const QString &message, const physical_quantities::CFrequency &frequency, diff --git a/src/misc/network/textmessagelist.cpp b/src/misc/network/textmessagelist.cpp index c867a60569..9884f6a9f0 100644 --- a/src/misc/network/textmessagelist.cpp +++ b/src/misc/network/textmessagelist.cpp @@ -16,8 +16,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::network, CTextMessage, CTextMessageLis namespace swift::misc::network { - CTextMessageList::CTextMessageList() {} - CTextMessageList::CTextMessageList(const QString &message, const CCallsign &recipientCallsign) { CTextMessage pm(message, recipientCallsign); diff --git a/src/misc/network/textmessagelist.h b/src/misc/network/textmessagelist.h index 8c3ecda723..89f1977f9e 100644 --- a/src/misc/network/textmessagelist.h +++ b/src/misc/network/textmessagelist.h @@ -35,7 +35,7 @@ namespace swift::misc::network using CSequence::CSequence; //! Default constructor. - CTextMessageList(); + CTextMessageList() = default; //! Constructor, single private message CTextMessageList(const QString &message, const aviation::CCallsign &recipientCallsign); diff --git a/src/misc/network/urlloglist.cpp b/src/misc/network/urlloglist.cpp index 9f9bfe5d36..17cb9bb2c3 100644 --- a/src/misc/network/urlloglist.cpp +++ b/src/misc/network/urlloglist.cpp @@ -7,8 +7,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::network, CUrlLog, CUrlLogList) namespace swift::misc::network { - CUrlLogList::CUrlLogList() {} - CUrlLogList::CUrlLogList(const CSequence &other) : CSequence(other) {} int CUrlLogList::addPendingUrl(const CUrl &url, int maxNumber) diff --git a/src/misc/network/urlloglist.h b/src/misc/network/urlloglist.h index e6ee9a5761..ea1359a254 100644 --- a/src/misc/network/urlloglist.h +++ b/src/misc/network/urlloglist.h @@ -29,7 +29,7 @@ namespace swift::misc::network using CSequence::CSequence; //! Default constructor. - CUrlLogList(); + CUrlLogList() = default; //! Construct from a base class object. CUrlLogList(const CSequence &other); diff --git a/src/misc/network/userlist.cpp b/src/misc/network/userlist.cpp index ffeb662e20..7aeca24927 100644 --- a/src/misc/network/userlist.cpp +++ b/src/misc/network/userlist.cpp @@ -7,7 +7,5 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::network, CUser, CUserList) namespace swift::misc::network { - CUserList::CUserList() {} - CUserList::CUserList(const CSequence &other) : CSequence(other) {} } // namespace swift::misc::network diff --git a/src/misc/network/userlist.h b/src/misc/network/userlist.h index cfa03f7a3b..d8cb5aa848 100644 --- a/src/misc/network/userlist.h +++ b/src/misc/network/userlist.h @@ -29,7 +29,7 @@ namespace swift::misc::network using CSequence::CSequence; //! Default constructor. - CUserList(); + CUserList() = default; //! Construct from a base class object. CUserList(const CSequence &other); diff --git a/src/misc/orderable.cpp b/src/misc/orderable.cpp index 5d63967adf..6938b9091b 100644 --- a/src/misc/orderable.cpp +++ b/src/misc/orderable.cpp @@ -13,8 +13,6 @@ namespace swift::misc { - IOrderable::IOrderable() {} - IOrderable::IOrderable(int order) : m_order(order) {} QString IOrderable::getOrderAsString() const diff --git a/src/misc/orderable.h b/src/misc/orderable.h index 257c07d517..c258657c3c 100644 --- a/src/misc/orderable.h +++ b/src/misc/orderable.h @@ -45,7 +45,7 @@ namespace swift::misc static bool canHandleIndex(CPropertyIndexRef index); //! Constructor - IOrderable(); + IOrderable() = default; //! Constructor IOrderable(int order); diff --git a/src/misc/platform.h b/src/misc/platform.h index f7c934c052..06c20142ce 100644 --- a/src/misc/platform.h +++ b/src/misc/platform.h @@ -46,7 +46,7 @@ namespace swift::misc Q_DECLARE_FLAGS(Platform, PlatformFlag) //! Constructor - CPlatform() {} + CPlatform() = default; //! Constructor CPlatform(const QString &p); diff --git a/src/misc/platformset.cpp b/src/misc/platformset.cpp index 6cbf18b06e..b8787e389c 100644 --- a/src/misc/platformset.cpp +++ b/src/misc/platformset.cpp @@ -14,8 +14,6 @@ SWIFT_DEFINE_COLLECTION_MIXINS(swift::misc, CPlatform, CPlatformSet) namespace swift::misc { - CPlatformSet::CPlatformSet() {} - CPlatformSet::CPlatformSet(const CCollection &other) : CCollection(other) {} QStringList CPlatformSet::getPlatformNames() const diff --git a/src/misc/platformset.h b/src/misc/platformset.h index f457f3f653..fe3b219e04 100644 --- a/src/misc/platformset.h +++ b/src/misc/platformset.h @@ -25,7 +25,7 @@ namespace swift::misc public: //! Default constructor. - CPlatformSet(); + CPlatformSet() = default; //! Construct from a base class object. CPlatformSet(const CCollection &other); diff --git a/src/misc/pq/units.h b/src/misc/pq/units.h index 2d1f340f00..5155199906 100644 --- a/src/misc/pq/units.h +++ b/src/misc/pq/units.h @@ -263,8 +263,8 @@ namespace swift::misc::physical_quantities } //! \copydoc CMeasurementUnit::makeRoundedQStringWithUnit - virtual QString makeRoundedQStringWithUnit(double value, int digits = -1, bool withGroupSeparator = false, - bool i18n = false) const override; + QString makeRoundedQStringWithUnit(double value, int digits = -1, bool withGroupSeparator = false, + bool i18n = false) const override; //! Radians static CAngleUnit rad() @@ -947,8 +947,8 @@ namespace swift::misc::physical_quantities } //! \copydoc CMeasurementUnit::makeRoundedQStringWithUnit - virtual QString makeRoundedQStringWithUnit(double value, int digits = -1, bool withGroupSeparator = false, - bool i18n = false) const override; + QString makeRoundedQStringWithUnit(double value, int digits = -1, bool withGroupSeparator = false, + bool i18n = false) const override; //! Second s static CTimeUnit s() diff --git a/src/misc/processinfo.h b/src/misc/processinfo.h index 5cd37b5c5c..087db71fbc 100644 --- a/src/misc/processinfo.h +++ b/src/misc/processinfo.h @@ -22,7 +22,7 @@ namespace swift::misc { public: //! Construct an object identifying an invalid process. - CProcessInfo() {} + CProcessInfo() = default; //! Construct an object identifying the process with the given PID. explicit CProcessInfo(qint64 pid) : m_pid(pid), m_name(processNameFromId(pid)) {} diff --git a/src/misc/promise.h b/src/misc/promise.h index 4ba1e6a769..500cfdea9c 100644 --- a/src/misc/promise.h +++ b/src/misc/promise.h @@ -27,7 +27,7 @@ namespace swift::misc { public: CPromiseData() { this->reportStarted(); } - ~CPromiseData() + ~CPromiseData() override { if (this->isRunning()) { this->cancel(); } } diff --git a/src/misc/propertyindexlist.cpp b/src/misc/propertyindexlist.cpp index 14922f3c6d..e6d3850643 100644 --- a/src/misc/propertyindexlist.cpp +++ b/src/misc/propertyindexlist.cpp @@ -7,8 +7,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc, CPropertyIndex, CPropertyIndexList) namespace swift::misc { - CPropertyIndexList::CPropertyIndexList() {} - CPropertyIndexList::CPropertyIndexList(const CSequence &other) : CSequence(other) {} CPropertyIndexList CPropertyIndexList::copyFrontRemoved() const diff --git a/src/misc/propertyindexlist.h b/src/misc/propertyindexlist.h index 3885a2b280..5cdd480850 100644 --- a/src/misc/propertyindexlist.h +++ b/src/misc/propertyindexlist.h @@ -27,7 +27,7 @@ namespace swift::misc using CSequence::CSequence; //! Default constructor. - CPropertyIndexList(); + CPropertyIndexList() = default; //! Construct from a base class object. CPropertyIndexList(const CSequence &other); diff --git a/src/misc/provider.cpp b/src/misc/provider.cpp deleted file mode 100644 index 2de9bcccda..0000000000 --- a/src/misc/provider.cpp +++ /dev/null @@ -1,9 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (C) 2018 swift Project Community / Contributors -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -#include "misc/provider.h" - -namespace swift::misc -{ - IProvider::~IProvider() {} -} // namespace swift::misc diff --git a/src/misc/provider.h b/src/misc/provider.h index 8bb7a52978..3cf7a9e05b 100644 --- a/src/misc/provider.h +++ b/src/misc/provider.h @@ -19,7 +19,7 @@ namespace swift::misc { public: //! Dtor - virtual ~IProvider(); + virtual ~IProvider() = default; //! Copy constructor IProvider(const IProvider &) = delete; @@ -44,7 +44,7 @@ namespace swift::misc IProviderAware(PROVIDER *provider = nullptr) { this->setProvider(provider); } //! Dtor - virtual ~IProviderAware() {} + virtual ~IProviderAware() = default; //! Has provider? bool hasProvider() const { return m_provider; } diff --git a/src/misc/sharedstate/datalinkdbus.h b/src/misc/sharedstate/datalinkdbus.h index 083c63aa0b..a3539555db 100644 --- a/src/misc/sharedstate/datalinkdbus.h +++ b/src/misc/sharedstate/datalinkdbus.h @@ -42,7 +42,7 @@ namespace swift::misc CDataLinkDBus(QObject *parent = nullptr); //! Destructor. - virtual ~CDataLinkDBus() override; + ~CDataLinkDBus() override; //! Override identifier for testing purposes. void overrideIdentifier(const CIdentifier &); @@ -53,10 +53,10 @@ namespace swift::misc //! Initialize on client side. void initializeRemote(const QDBusConnection &connection, const QString &service); - virtual void publish(const CPassiveMutator *mutator) override; - virtual void publish(const CActiveMutator *mutator) override; - virtual void subscribe(const CPassiveObserver *observer) override; - virtual void subscribe(const CActiveObserver *observer) override; + void publish(const CPassiveMutator *mutator) override; + void publish(const CActiveMutator *mutator) override; + void subscribe(const CPassiveObserver *observer) override; + void subscribe(const CActiveObserver *observer) override; private: struct Channel diff --git a/src/misc/sharedstate/datalinklocal.h b/src/misc/sharedstate/datalinklocal.h index 9e8680f0b8..6202fe3a02 100644 --- a/src/misc/sharedstate/datalinklocal.h +++ b/src/misc/sharedstate/datalinklocal.h @@ -30,12 +30,12 @@ namespace swift::misc::shared_state CDataLinkLocal(QObject *parent = nullptr); //! Destructor. - virtual ~CDataLinkLocal() override; + ~CDataLinkLocal() override; - virtual void publish(const CPassiveMutator *mutator) override; - virtual void publish(const CActiveMutator *mutator) override; - virtual void subscribe(const CPassiveObserver *observer) override; - virtual void subscribe(const CActiveObserver *observer) override; + void publish(const CPassiveMutator *mutator) override; + void publish(const CActiveMutator *mutator) override; + void subscribe(const CPassiveObserver *observer) override; + void subscribe(const CActiveObserver *observer) override; private: struct Channel diff --git a/src/misc/sharedstate/dbus/dupleximpl.h b/src/misc/sharedstate/dbus/dupleximpl.h index beac408002..8178a80164 100644 --- a/src/misc/sharedstate/dbus/dupleximpl.h +++ b/src/misc/sharedstate/dbus/dupleximpl.h @@ -33,30 +33,29 @@ namespace swift::misc CDuplex(CHub *hub, const CIdentifier &client, CDBusServer *server, QObject *parent = nullptr); //! Destructor. - virtual ~CDuplex() override; + ~CDuplex() override; public slots: //! \name Interface implementations //! @{ //! \copydoc swift::misc::shared_state::dbus::IDuplex::postEvent - virtual void postEvent(const QString &channel, const swift::misc::CVariant ¶m) override; + void postEvent(const QString &channel, const swift::misc::CVariant ¶m) override; //! \copydoc swift::misc::shared_state::dbus::IDuplex::setSubscription - virtual void setSubscription(const QString &channel, const swift::misc::CVariantList &filters) override; + void setSubscription(const QString &channel, const swift::misc::CVariantList &filters) override; //! \copydoc swift::misc::shared_state::dbus::IDuplex::requestPeerSubscriptions - virtual void requestPeerSubscriptions() override; + void requestPeerSubscriptions() override; //! \copydoc swift::misc::shared_state::dbus::IDuplex::submitRequest - virtual void submitRequest(const QString &channel, const swift::misc::CVariant ¶m, - quint32 token) override; + void submitRequest(const QString &channel, const swift::misc::CVariant ¶m, quint32 token) override; //! \copydoc swift::misc::shared_state::dbus::IDuplex::advertise - virtual void advertise(const QString &channel) override; + void advertise(const QString &channel) override; //! \copydoc swift::misc::shared_state::dbus::IDuplex::withdraw - virtual void withdraw(const QString &channel) override; + void withdraw(const QString &channel) override; //! @} private: diff --git a/src/misc/sharedstate/dbus/duplexproxy.h b/src/misc/sharedstate/dbus/duplexproxy.h index 4371cfe8ea..1b471c5daf 100644 --- a/src/misc/sharedstate/dbus/duplexproxy.h +++ b/src/misc/sharedstate/dbus/duplexproxy.h @@ -31,26 +31,25 @@ namespace swift::misc //! @{ //! \copydoc swift::misc::shared_state::dbus::IDuplex::postEvent - virtual void postEvent(const QString &channel, const swift::misc::CVariant ¶m) override; + void postEvent(const QString &channel, const swift::misc::CVariant ¶m) override; //! \copydoc swift::misc::shared_state::dbus::IDuplex::setSubscription - virtual void setSubscription(const QString &channel, const swift::misc::CVariantList &filters) override; + void setSubscription(const QString &channel, const swift::misc::CVariantList &filters) override; //! \copydoc swift::misc::shared_state::dbus::IDuplex::requestPeerSubscriptions - virtual void requestPeerSubscriptions() override; + void requestPeerSubscriptions() override; //! \copydoc swift::misc::shared_state::dbus::IDuplex::submitRequest - virtual void submitRequest(const QString &channel, const swift::misc::CVariant ¶m, - quint32 token) override; + void submitRequest(const QString &channel, const swift::misc::CVariant ¶m, quint32 token) override; //! \copydoc swift::misc::shared_state::dbus::IDuplex::reply - virtual void reply(const swift::misc::CVariant ¶m, quint32 token) override; + void reply(const swift::misc::CVariant ¶m, quint32 token) override; //! \copydoc swift::misc::shared_state::dbus::IDuplex::advertise - virtual void advertise(const QString &channel) override; + void advertise(const QString &channel) override; //! \copydoc swift::misc::shared_state::dbus::IDuplex::withdraw - virtual void withdraw(const QString &channel) override; + void withdraw(const QString &channel) override; //! @} private: diff --git a/src/misc/sharedstate/dbus/hubimpl.h b/src/misc/sharedstate/dbus/hubimpl.h index 07e1fd4429..7f39d4681e 100644 --- a/src/misc/sharedstate/dbus/hubimpl.h +++ b/src/misc/sharedstate/dbus/hubimpl.h @@ -33,15 +33,15 @@ namespace swift::misc CHub(CDBusServer *server, QObject *parent = nullptr); //! Destructor. - virtual ~CHub() override; + ~CHub() override; //! Returns a range containing all duplex objects. const auto &clients() const { return m_clients; } //! \name Interface implementations //! @{ - virtual bool isConnected() const override { return true; } - virtual std::pair, QFuture> getDuplex(const CIdentifier &) override; + bool isConnected() const override { return true; } + std::pair, QFuture> getDuplex(const CIdentifier &) override; //! @} public slots: @@ -49,16 +49,16 @@ namespace swift::misc //! @{ //! \copydoc swift::misc::shared_state::dbus::IHub::openDuplex - virtual bool openDuplex(const swift::misc::CIdentifier &client) override; + bool openDuplex(const swift::misc::CIdentifier &client) override; //! \copydoc swift::misc::shared_state::dbus::IHub::closeDuplex - virtual void closeDuplex(const swift::misc::CIdentifier &client) override; + void closeDuplex(const swift::misc::CIdentifier &client) override; //! @} protected: //! \name Interface implementations //! @{ - virtual QFuture openDuplexAsync(const CIdentifier &client) override; + QFuture openDuplexAsync(const CIdentifier &client) override; //! @} private: diff --git a/src/misc/sharedstate/dbus/hubproxy.h b/src/misc/sharedstate/dbus/hubproxy.h index 180f796f8d..c45d38eed5 100644 --- a/src/misc/sharedstate/dbus/hubproxy.h +++ b/src/misc/sharedstate/dbus/hubproxy.h @@ -29,12 +29,12 @@ namespace swift::misc CHubProxy(const QDBusConnection &connection, const QString &service, QObject *parent = nullptr); //! Destructor. - virtual ~CHubProxy() override; + ~CHubProxy() override; //! \name Interface implementations //! @{ - virtual bool isConnected() const override; - virtual std::pair, QFuture> getDuplex(const CIdentifier &) override; + bool isConnected() const override; + std::pair, QFuture> getDuplex(const CIdentifier &) override; //! @} public slots: @@ -42,16 +42,16 @@ namespace swift::misc //! @{ //! \copydoc swift::misc::shared_state::dbus::IHub::openDuplex - virtual bool openDuplex(const swift::misc::CIdentifier &client) override; + bool openDuplex(const swift::misc::CIdentifier &client) override; //! \copydoc swift::misc::shared_state::dbus::IHub::closeDuplex - virtual void closeDuplex(const swift::misc::CIdentifier &client) override; + void closeDuplex(const swift::misc::CIdentifier &client) override; //! @} protected: //! \name Interface implementations //! @{ - virtual QFuture openDuplexAsync(const CIdentifier &client) override; + QFuture openDuplexAsync(const CIdentifier &client) override; //! @} private: diff --git a/src/misc/sharedstate/listobserver.h b/src/misc/sharedstate/listobserver.h index 65376ee09a..91e4784b8e 100644 --- a/src/misc/sharedstate/listobserver.h +++ b/src/misc/sharedstate/listobserver.h @@ -67,7 +67,7 @@ namespace swift::misc::shared_state public: //! Subscribe using the given transport mechanism. - virtual void initialize(IDataLink *dataLink) override + void initialize(IDataLink *dataLink) override { CGenericListObserver::initialize(dataLink); if (std::is_same_v) { setFilter({}); } @@ -86,14 +86,8 @@ namespace swift::misc::shared_state virtual void onElementsReplaced(const T &values) = 0; private: - virtual void onGenericElementAdded(const CVariant &value) override final - { - onElementAdded(value.to()); - } - virtual void onGenericElementsReplaced(const CVariantList &values) override final - { - onElementsReplaced(values.to()); - } + void onGenericElementAdded(const CVariant &value) final { onElementAdded(value.to()); } + void onGenericElementsReplaced(const CVariantList &values) final { onElementsReplaced(values.to()); } }; } // namespace swift::misc::shared_state diff --git a/src/misc/sharedstate/scalarobserver.h b/src/misc/sharedstate/scalarobserver.h index 3f2fd1712d..65b822947e 100644 --- a/src/misc/sharedstate/scalarobserver.h +++ b/src/misc/sharedstate/scalarobserver.h @@ -67,7 +67,7 @@ namespace swift::misc::shared_state //! Called when the scalar value changes. virtual void onValueChanged(const T &value) = 0; - virtual void onGenericValueChanged(const CVariant &value) override final { onValueChanged(value.to()); } + void onGenericValueChanged(const CVariant &value) final { onValueChanged(value.to()); } }; } // namespace swift::misc::shared_state diff --git a/src/misc/simulation/aircraftmodel.h b/src/misc/simulation/aircraftmodel.h index 2cc21462cf..575751e078 100644 --- a/src/misc/simulation/aircraftmodel.h +++ b/src/misc/simulation/aircraftmodel.h @@ -131,7 +131,7 @@ namespace swift::misc static void registerMetadata(); //! Default constructor. - CAircraftModel() {} + CAircraftModel() = default; //! Constructor. CAircraftModel(const QString &model, ModelType type); diff --git a/src/misc/simulation/aircraftmodelinterfaces.h b/src/misc/simulation/aircraftmodelinterfaces.h index 997652f036..0bed4da4fa 100644 --- a/src/misc/simulation/aircraftmodelinterfaces.h +++ b/src/misc/simulation/aircraftmodelinterfaces.h @@ -20,8 +20,8 @@ namespace swift::misc::simulation //! @{ //! Ctor, dtor, copy operators (CLANG warnings) - IModelsSetable() {} - virtual ~IModelsSetable() {} + IModelsSetable() = default; + virtual ~IModelsSetable() = default; IModelsSetable(const IModelsSetable &) = default; IModelsSetable &operator=(const IModelsSetable &) = default; //! @} @@ -36,8 +36,8 @@ namespace swift::misc::simulation //! @{ //! Ctor, dtor, copy operators (CLANG warnings) - IModelsUpdatable() {} - virtual ~IModelsUpdatable() {} + IModelsUpdatable() = default; + virtual ~IModelsUpdatable() = default; IModelsUpdatable(const IModelsUpdatable &) = default; IModelsUpdatable &operator=(const IModelsUpdatable &) = default; //! @} @@ -52,8 +52,8 @@ namespace swift::misc::simulation //! @{ //! Ctor, dtor, copy operators (CLANG warnings) - IModelsForSimulatorSetable() {} - virtual ~IModelsForSimulatorSetable() {} + IModelsForSimulatorSetable() = default; + virtual ~IModelsForSimulatorSetable() = default; IModelsForSimulatorSetable(const IModelsForSimulatorSetable &) = default; IModelsForSimulatorSetable &operator=(const IModelsForSimulatorSetable &) = default; //! @} @@ -68,8 +68,8 @@ namespace swift::misc::simulation //! @{ //! Ctor, dtor, copy operators (CLANG warnings) - IModelsForSimulatorUpdatable() {} - virtual ~IModelsForSimulatorUpdatable() {} + IModelsForSimulatorUpdatable() = default; + virtual ~IModelsForSimulatorUpdatable() = default; IModelsForSimulatorUpdatable(const IModelsForSimulatorUpdatable &) = default; IModelsForSimulatorUpdatable &operator=(const IModelsForSimulatorUpdatable &) = default; //! @} @@ -84,8 +84,8 @@ namespace swift::misc::simulation //! @{ //! Ctor, dtor, copy operators (CLANG warnings) - ISimulatorSelectable() {} - virtual ~ISimulatorSelectable() {} + ISimulatorSelectable() = default; + virtual ~ISimulatorSelectable() = default; ISimulatorSelectable(const ISimulatorSelectable &) = default; ISimulatorSelectable &operator=(const ISimulatorSelectable &) = default; //! @} diff --git a/src/misc/simulation/aircraftmodellist.cpp b/src/misc/simulation/aircraftmodellist.cpp index 309e865269..f5bab0eafc 100644 --- a/src/misc/simulation/aircraftmodellist.cpp +++ b/src/misc/simulation/aircraftmodellist.cpp @@ -36,8 +36,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::simulation, CAircraftModel, CAircraftM namespace swift::misc::simulation { - CAircraftModelList::CAircraftModelList() {} - CAircraftModelList::CAircraftModelList(const CSequence &other) : CSequence(other) {} bool CAircraftModelList::containsModelString(const QString &modelString, Qt::CaseSensitivity sensitivity) const diff --git a/src/misc/simulation/aircraftmodellist.h b/src/misc/simulation/aircraftmodellist.h index 2fd3c21278..a429e27cd0 100644 --- a/src/misc/simulation/aircraftmodellist.h +++ b/src/misc/simulation/aircraftmodellist.h @@ -63,7 +63,7 @@ namespace swift::misc using CSequence::CSequence; //! Empty constructor. - CAircraftModelList(); + CAircraftModelList() = default; //! Construct from a base class object. CAircraftModelList(const CSequence &other); diff --git a/src/misc/simulation/aircraftmodelloader.cpp b/src/misc/simulation/aircraftmodelloader.cpp index ce08841fe7..a7bf4ccbf5 100644 --- a/src/misc/simulation/aircraftmodelloader.cpp +++ b/src/misc/simulation/aircraftmodelloader.cpp @@ -99,8 +99,6 @@ namespace swift::misc::simulation this->setObjectInfo(simulator); } - IAircraftModelLoader::~IAircraftModelLoader() {} - void IAircraftModelLoader::startLoading(LoadMode mode, const IAircraftModelLoader::ModelConsolidationCallback &modelConsolidation, const QStringList &modelDirectories) diff --git a/src/misc/simulation/aircraftmodelloader.h b/src/misc/simulation/aircraftmodelloader.h index b985f71398..b4d1274e12 100644 --- a/src/misc/simulation/aircraftmodelloader.h +++ b/src/misc/simulation/aircraftmodelloader.h @@ -90,7 +90,7 @@ namespace swift::misc::simulation using ModelConsolidationCallback = std::function; //! Destructor - virtual ~IAircraftModelLoader() override; + ~IAircraftModelLoader() override = default; //! Loading finished? virtual bool isLoadingFinished() const = 0; @@ -121,8 +121,8 @@ namespace swift::misc::simulation bool supportsSimulator(const CSimulatorInfo &simulator) const { return m_simulator == simulator; } // Interface implementations - virtual void setModels(const CAircraftModelList &models) override; - virtual int updateModels(const CAircraftModelList &models) override; + void setModels(const CAircraftModelList &models) override; + int updateModels(const CAircraftModelList &models) override; signals: //! Disk loading started @@ -192,12 +192,12 @@ namespace swift::misc::simulation CDummyModelLoader(const CSimulatorInfo &simulator, QObject *parent); //! IAircraftModelLoader::isLoadingFinished - virtual bool isLoadingFinished() const override; + bool isLoadingFinished() const override; protected: //! IAircraftModelLoader::startLoadingFromDisk - virtual void startLoadingFromDisk(LoadMode mode, const ModelConsolidationCallback &modelConsolidation, - const QStringList &modelDirectories) override; + void startLoadingFromDisk(LoadMode mode, const ModelConsolidationCallback &modelConsolidation, + const QStringList &modelDirectories) override; private: qint64 m_loadingStartedTs = -1; diff --git a/src/misc/simulation/airspaceaircraftsnapshot.cpp b/src/misc/simulation/airspaceaircraftsnapshot.cpp index 6e8be78ac9..60b9949755 100644 --- a/src/misc/simulation/airspaceaircraftsnapshot.cpp +++ b/src/misc/simulation/airspaceaircraftsnapshot.cpp @@ -16,8 +16,6 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::misc::simulation, CAirspaceAircraftSnapsh namespace swift::misc::simulation { - CAirspaceAircraftSnapshot::CAirspaceAircraftSnapshot() {} - CAirspaceAircraftSnapshot::CAirspaceAircraftSnapshot(const CSimulatedAircraftList &allAircraft, bool restricted, bool renderingEnabled, int maxAircraft, const CLength &maxRenderedDistance) diff --git a/src/misc/simulation/airspaceaircraftsnapshot.h b/src/misc/simulation/airspaceaircraftsnapshot.h index f986c93972..123877c4f8 100644 --- a/src/misc/simulation/airspaceaircraftsnapshot.h +++ b/src/misc/simulation/airspaceaircraftsnapshot.h @@ -29,7 +29,7 @@ namespace swift::misc::simulation { public: //! Default constructor - CAirspaceAircraftSnapshot(); + CAirspaceAircraftSnapshot() = default; //! Constructor CAirspaceAircraftSnapshot(const CSimulatedAircraftList &allAircraft, bool restricted = false, diff --git a/src/misc/simulation/backgroundvalidation.h b/src/misc/simulation/backgroundvalidation.h index 45ed7e088d..b92acafe69 100644 --- a/src/misc/simulation/backgroundvalidation.h +++ b/src/misc/simulation/backgroundvalidation.h @@ -78,7 +78,7 @@ namespace swift::misc::simulation protected: //! \copydoc CContinuousWorker::beforeQuit - virtual void beforeQuit() noexcept override; + void beforeQuit() noexcept override; private: mutable QReadWriteLock m_lock; //!< lock snapshot diff --git a/src/misc/simulation/categorymatcher.h b/src/misc/simulation/categorymatcher.h index 8966f8b971..f1c4356684 100644 --- a/src/misc/simulation/categorymatcher.h +++ b/src/misc/simulation/categorymatcher.h @@ -27,7 +27,7 @@ namespace swift::misc static const QStringList &getLogCategories(); //! Constructor - CCategoryMatcher() {} + CCategoryMatcher() = default; //! Used categories void setCategories(const aviation::CAircraftCategoryList &categories); diff --git a/src/misc/simulation/distributor.cpp b/src/misc/simulation/distributor.cpp index d0631dbd68..466fd271ad 100644 --- a/src/misc/simulation/distributor.cpp +++ b/src/misc/simulation/distributor.cpp @@ -16,8 +16,6 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::misc::simulation, CDistributor) namespace swift::misc::simulation { - CDistributor::CDistributor() {} - CDistributor::CDistributor(const QString &key) { this->setDbKey(unifyKeyOrAlias(key)); } CDistributor::CDistributor(const QString &id, const QString &description, const QString &alias1, diff --git a/src/misc/simulation/distributor.h b/src/misc/simulation/distributor.h index e98e9821bd..8fbe8982d4 100644 --- a/src/misc/simulation/distributor.h +++ b/src/misc/simulation/distributor.h @@ -42,7 +42,7 @@ namespace swift::misc::simulation }; //! Default constructor. - CDistributor(); + CDistributor() = default; //! Constructor CDistributor(const QString &key); diff --git a/src/misc/simulation/distributorlist.cpp b/src/misc/simulation/distributorlist.cpp index f4d54db4ed..4753ce4d26 100644 --- a/src/misc/simulation/distributorlist.cpp +++ b/src/misc/simulation/distributorlist.cpp @@ -12,8 +12,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::simulation, CDistributor, CDistributor namespace swift::misc::simulation { - CDistributorList::CDistributorList() {} - CDistributorList::CDistributorList(const CSequence &other) : CSequence(other) {} CDistributor CDistributorList::findByKeyOrAlias(const QString &keyOrAlias) const diff --git a/src/misc/simulation/distributorlist.h b/src/misc/simulation/distributorlist.h index 845b369876..ceebf9dd27 100644 --- a/src/misc/simulation/distributorlist.h +++ b/src/misc/simulation/distributorlist.h @@ -36,7 +36,7 @@ namespace swift::misc::simulation using CSequence::CSequence; //! Default constructor. - CDistributorList(); + CDistributorList() = default; //! Construct from a base class object. CDistributorList(const CSequence &other); diff --git a/src/misc/simulation/distributorlistpreferences.cpp b/src/misc/simulation/distributorlistpreferences.cpp index 306fd8dc43..13658da142 100644 --- a/src/misc/simulation/distributorlistpreferences.cpp +++ b/src/misc/simulation/distributorlistpreferences.cpp @@ -9,8 +9,6 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::misc::simulation, CDistributorListPrefere namespace swift::misc::simulation { - CDistributorListPreferences::CDistributorListPreferences() {} - const CDistributorList &CDistributorListPreferences::getDistributors(const CSimulatorInfo &simulator) const { Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "Need single simulator"); diff --git a/src/misc/simulation/distributorlistpreferences.h b/src/misc/simulation/distributorlistpreferences.h index 4d2ccecc63..46ec98d6e5 100644 --- a/src/misc/simulation/distributorlistpreferences.h +++ b/src/misc/simulation/distributorlistpreferences.h @@ -29,7 +29,7 @@ namespace swift::misc::simulation { public: //! Default constructor. - CDistributorListPreferences(); + CDistributorListPreferences() = default; //! Get distributors const CDistributorList &getDistributors(const CSimulatorInfo &simulator) const; diff --git a/src/misc/simulation/fscommon/aircraftcfgentrieslist.cpp b/src/misc/simulation/fscommon/aircraftcfgentrieslist.cpp index 978286d56c..44eb426334 100644 --- a/src/misc/simulation/fscommon/aircraftcfgentrieslist.cpp +++ b/src/misc/simulation/fscommon/aircraftcfgentrieslist.cpp @@ -17,8 +17,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::simulation::fscommon, CAircraftCfgEntr namespace swift::misc::simulation::fscommon { - CAircraftCfgEntriesList::CAircraftCfgEntriesList() = default; - CAircraftCfgEntriesList::CAircraftCfgEntriesList(const CSequence &other) : CSequence(other) {} bool CAircraftCfgEntriesList::containsModelWithTitle(const QString &title, Qt::CaseSensitivity caseSensitivity) diff --git a/src/misc/simulation/fscommon/aircraftcfgentrieslist.h b/src/misc/simulation/fscommon/aircraftcfgentrieslist.h index cd345a3478..a0953f83f0 100644 --- a/src/misc/simulation/fscommon/aircraftcfgentrieslist.h +++ b/src/misc/simulation/fscommon/aircraftcfgentrieslist.h @@ -35,7 +35,7 @@ namespace swift::misc::simulation::fscommon using CSequence::CSequence; //! Default constructor. - CAircraftCfgEntriesList(); + CAircraftCfgEntriesList() = default; //! Construct from a base class object. CAircraftCfgEntriesList(const CSequence &other); diff --git a/src/misc/simulation/fscommon/aircraftcfgparser.h b/src/misc/simulation/fscommon/aircraftcfgparser.h index 4fdc9bff5b..9850f74bf7 100644 --- a/src/misc/simulation/fscommon/aircraftcfgparser.h +++ b/src/misc/simulation/fscommon/aircraftcfgparser.h @@ -35,14 +35,14 @@ namespace swift::misc CAircraftCfgParser(const CSimulatorInfo &simInfo, QObject *parent = nullptr); //! Virtual destructor - virtual ~CAircraftCfgParser() override; + ~CAircraftCfgParser() override; //! Get parsed aircraft cfg entries list const CAircraftCfgEntriesList &getAircraftCfgEntriesList() const { return m_parsedCfgEntriesList; } //! \name Interface functions //! @{ - virtual bool isLoadingFinished() const override; + bool isLoadingFinished() const override; //! @} //! Parse a single file @@ -55,8 +55,8 @@ namespace swift::misc protected: //! \name Interface functions //! @{ - virtual void startLoadingFromDisk(LoadMode mode, const ModelConsolidationCallback &modelConsolidation, - const QStringList &modelDirectories) override; + void startLoadingFromDisk(LoadMode mode, const ModelConsolidationCallback &modelConsolidation, + const QStringList &modelDirectories) override; //! @} private: diff --git a/src/misc/simulation/fscommon/vpilotmodelrule.cpp b/src/misc/simulation/fscommon/vpilotmodelrule.cpp index 0f5340af50..6ffb9fb9b7 100644 --- a/src/misc/simulation/fscommon/vpilotmodelrule.cpp +++ b/src/misc/simulation/fscommon/vpilotmodelrule.cpp @@ -18,8 +18,6 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::misc::simulation::fscommon, CVPilotModelR namespace swift::misc::simulation::fscommon { - CVPilotModelRule::CVPilotModelRule() {} - CVPilotModelRule::CVPilotModelRule(const QString &modelName, const QString &folder, const QString &typeCode, const QString &callsignPrefix, qint64 updated) : ITimestampBased(updated), m_modelName(modelName.trimmed().toUpper()), m_folder(folder.trimmed().toUpper()), diff --git a/src/misc/simulation/fscommon/vpilotmodelrule.h b/src/misc/simulation/fscommon/vpilotmodelrule.h index 85bc779234..ff85da35a2 100644 --- a/src/misc/simulation/fscommon/vpilotmodelrule.h +++ b/src/misc/simulation/fscommon/vpilotmodelrule.h @@ -36,7 +36,7 @@ namespace swift::misc::simulation::fscommon }; //! Default constructor - CVPilotModelRule(); + CVPilotModelRule() = default; //! Default constructor. CVPilotModelRule(const QString &modelName, const QString &folder, const QString &typeCode, diff --git a/src/misc/simulation/fsx/simconnectutilities.cpp b/src/misc/simulation/fsx/simconnectutilities.cpp index f2853c6c89..d11bde8e0b 100644 --- a/src/misc/simulation/fsx/simconnectutilities.cpp +++ b/src/misc/simulation/fsx/simconnectutilities.cpp @@ -15,8 +15,6 @@ using namespace swift::misc::aviation; namespace swift::misc::simulation::fsx { - CSimConnectUtilities::CSimConnectUtilities() {} - QString CSimConnectUtilities::resolveEnumToString(const DWORD id, const char *enumName) { const int i = CSimConnectUtilities::staticMetaObject.indexOfEnumerator(enumName); diff --git a/src/misc/simulation/fsx/simconnectutilities.h b/src/misc/simulation/fsx/simconnectutilities.h index d9f105bf1a..707ec24933 100644 --- a/src/misc/simulation/fsx/simconnectutilities.h +++ b/src/misc/simulation/fsx/simconnectutilities.h @@ -193,7 +193,7 @@ namespace swift::misc::simulation::fsx static QString resolveEnumToString(const DWORD id, const char *enumName); //! Hidden constructor - CSimConnectUtilities(); + CSimConnectUtilities() = default; }; } // namespace swift::misc::simulation::fsx diff --git a/src/misc/simulation/interpolation/interpolationrenderingsetup.cpp b/src/misc/simulation/interpolation/interpolationrenderingsetup.cpp index 51797bedb2..afdff92e0b 100644 --- a/src/misc/simulation/interpolation/interpolationrenderingsetup.cpp +++ b/src/misc/simulation/interpolation/interpolationrenderingsetup.cpp @@ -19,12 +19,6 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::misc::simulation, CInterpolationAndRender namespace swift::misc::simulation { - CInterpolationAndRenderingSetupBase::CInterpolationAndRenderingSetupBase() - { - // Experimental - // m_fixSceneryOffset = CBuildConfig::isLocalDeveloperDebugBuild(); - } - bool CInterpolationAndRenderingSetupBase::setSendingGndFlagToSimulator(bool sendFLag) { if (sendFLag == m_sendGndToSim) { return false; } @@ -151,8 +145,6 @@ namespace swift::misc::simulation index <= CInterpolationAndRenderingSetupBase::IndexFixSceneryOffset; } - CInterpolationAndRenderingSetupGlobal::CInterpolationAndRenderingSetupGlobal() {} - int CInterpolationAndRenderingSetupGlobal::InfiniteAircraft() { return 100; } bool CInterpolationAndRenderingSetupGlobal::isRenderingEnabled() const @@ -308,8 +300,6 @@ namespace swift::misc::simulation CValueObject::setPropertyByIndex(index, variant); } - CInterpolationAndRenderingSetupPerCallsign::CInterpolationAndRenderingSetupPerCallsign() {} - CInterpolationAndRenderingSetupPerCallsign::CInterpolationAndRenderingSetupPerCallsign( const CCallsign &callsign, const CInterpolationAndRenderingSetupGlobal &globalSetup) : CInterpolationAndRenderingSetupBase(globalSetup), m_callsign(callsign) diff --git a/src/misc/simulation/interpolation/interpolationrenderingsetup.h b/src/misc/simulation/interpolation/interpolationrenderingsetup.h index f4fa75d490..361c2ad556 100644 --- a/src/misc/simulation/interpolation/interpolationrenderingsetup.h +++ b/src/misc/simulation/interpolation/interpolationrenderingsetup.h @@ -125,7 +125,7 @@ namespace swift::misc protected: //! Constructor - CInterpolationAndRenderingSetupBase(); + CInterpolationAndRenderingSetupBase() = default; //! Can handle index? static bool canHandleIndex(int index); @@ -155,7 +155,7 @@ namespace swift::misc }; //! Constructor. - CInterpolationAndRenderingSetupGlobal(); + CInterpolationAndRenderingSetupGlobal() = default; //! Considered as "all aircraft" static int InfiniteAircraft(); @@ -239,7 +239,7 @@ namespace swift::misc }; //! Constructor - CInterpolationAndRenderingSetupPerCallsign(); + CInterpolationAndRenderingSetupPerCallsign() = default; //! Constructor from global setup CInterpolationAndRenderingSetupPerCallsign(const aviation::CCallsign &callsign, diff --git a/src/misc/simulation/interpolation/interpolationsetuplist.cpp b/src/misc/simulation/interpolation/interpolationsetuplist.cpp index c1d12090a8..42b7a4a2af 100644 --- a/src/misc/simulation/interpolation/interpolationsetuplist.cpp +++ b/src/misc/simulation/interpolation/interpolationsetuplist.cpp @@ -8,8 +8,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::simulation, CInterpolationAndRendering namespace swift::misc::simulation { - CInterpolationSetupList::CInterpolationSetupList() {} - CInterpolationSetupList::CInterpolationSetupList(const CInterpolationAndRenderingSetupPerCallsign &setup) { this->push_back(setup); diff --git a/src/misc/simulation/interpolation/interpolationsetuplist.h b/src/misc/simulation/interpolation/interpolationsetuplist.h index 8aaa83a741..3469888e85 100644 --- a/src/misc/simulation/interpolation/interpolationsetuplist.h +++ b/src/misc/simulation/interpolation/interpolationsetuplist.h @@ -28,7 +28,7 @@ namespace swift::misc::simulation using CSequence::CSequence; //! Default constructor. - CInterpolationSetupList(); + CInterpolationSetupList() = default; //! Single object CInterpolationSetupList(const CInterpolationAndRenderingSetupPerCallsign &setup); diff --git a/src/misc/simulation/interpolation/interpolatorlinear.h b/src/misc/simulation/interpolation/interpolatorlinear.h index e7a22146f0..afce53b9d4 100644 --- a/src/misc/simulation/interpolation/interpolatorlinear.h +++ b/src/misc/simulation/interpolation/interpolatorlinear.h @@ -27,7 +27,7 @@ namespace swift::misc //! Linear interpolator, calculation inbetween positions class SWIFT_MISC_EXPORT CInterpolatorLinear : public CInterpolator { - virtual void anchor() override; + void anchor() override; public: //! Constructor diff --git a/src/misc/simulation/interpolation/interpolatormulti.cpp b/src/misc/simulation/interpolation/interpolatormulti.cpp index c21a2598cc..487e983bc7 100644 --- a/src/misc/simulation/interpolation/interpolatormulti.cpp +++ b/src/misc/simulation/interpolation/interpolatormulti.cpp @@ -79,8 +79,6 @@ namespace swift::misc::simulation return ("Illegal mode"); } - CInterpolatorMultiWrapper::CInterpolatorMultiWrapper() {} - CInterpolatorMultiWrapper::CInterpolatorMultiWrapper(const aviation::CCallsign &callsign, ISimulationEnvironmentProvider *p1, IInterpolationSetupProvider *p2, IRemoteAircraftProvider *p3, diff --git a/src/misc/simulation/interpolation/interpolatormulti.h b/src/misc/simulation/interpolation/interpolatormulti.h index cfae825309..5cde6fd3a9 100644 --- a/src/misc/simulation/interpolation/interpolatormulti.h +++ b/src/misc/simulation/interpolation/interpolatormulti.h @@ -56,7 +56,7 @@ namespace swift::misc::simulation { public: //! Default ctor, needed for QMap/QHash - CInterpolatorMultiWrapper(); + CInterpolatorMultiWrapper() = default; //! Constructor CInterpolatorMultiWrapper(const aviation::CCallsign &callsign, ISimulationEnvironmentProvider *p1, diff --git a/src/misc/simulation/interpolation/interpolatorspline.h b/src/misc/simulation/interpolation/interpolatorspline.h index a12dccd6e6..372d786eee 100644 --- a/src/misc/simulation/interpolation/interpolatorspline.h +++ b/src/misc/simulation/interpolation/interpolatorspline.h @@ -17,7 +17,7 @@ namespace swift::misc::simulation //! Cubic spline interpolator class SWIFT_MISC_EXPORT CInterpolatorSpline : public CInterpolator { - virtual void anchor() override; + void anchor() override; public: //! Constructor diff --git a/src/misc/simulation/matchingscript.h b/src/misc/simulation/matchingscript.h index f2adf00406..886077461f 100644 --- a/src/misc/simulation/matchingscript.h +++ b/src/misc/simulation/matchingscript.h @@ -55,7 +55,7 @@ namespace swift::misc::simulation public: //! Ctor - Q_INVOKABLE MSInOutValues() {} + Q_INVOKABLE MSInOutValues() = default; //! Ctor Q_INVOKABLE MSInOutValues(const QString &cs, const QString &csAsSet, const QString &flightNumber, @@ -248,7 +248,7 @@ namespace swift::misc::simulation public: //! Ctor - Q_INVOKABLE MSModelSet() {} + Q_INVOKABLE MSModelSet() = default; //! Get callsign const QString &getSimulator() const { return m_simulator; } diff --git a/src/misc/simulation/matchingstatistics.cpp b/src/misc/simulation/matchingstatistics.cpp index 67edec7048..727a29bb4a 100644 --- a/src/misc/simulation/matchingstatistics.cpp +++ b/src/misc/simulation/matchingstatistics.cpp @@ -7,8 +7,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::simulation, CMatchingStatisticsEntry, namespace swift::misc::simulation { - CMatchingStatistics::CMatchingStatistics() {} - CMatchingStatistics::CMatchingStatistics(const CSequence &other) : CSequence(other) {} diff --git a/src/misc/simulation/matchingstatistics.h b/src/misc/simulation/matchingstatistics.h index fe4498e7ec..a6086e1f78 100644 --- a/src/misc/simulation/matchingstatistics.h +++ b/src/misc/simulation/matchingstatistics.h @@ -28,7 +28,7 @@ namespace swift::misc::simulation using CSequence::CSequence; //! Default constructor. - CMatchingStatistics(); + CMatchingStatistics() = default; //! Construct from a base class object. CMatchingStatistics(const CSequence &other); diff --git a/src/misc/simulation/matchingstatisticsentry.cpp b/src/misc/simulation/matchingstatisticsentry.cpp index 37c196b812..34cad2d109 100644 --- a/src/misc/simulation/matchingstatisticsentry.cpp +++ b/src/misc/simulation/matchingstatisticsentry.cpp @@ -9,8 +9,6 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::misc::simulation, CMatchingStatisticsEntr namespace swift::misc::simulation { - CMatchingStatisticsEntry::CMatchingStatisticsEntry() {} - CMatchingStatisticsEntry::CMatchingStatisticsEntry(EntryType type, const QString &sessionId, const QString &modelSetId, const QString &description, const QString &aircraftDesignator, diff --git a/src/misc/simulation/matchingstatisticsentry.h b/src/misc/simulation/matchingstatisticsentry.h index 5d3284d58e..25aa590447 100644 --- a/src/misc/simulation/matchingstatisticsentry.h +++ b/src/misc/simulation/matchingstatisticsentry.h @@ -43,7 +43,7 @@ namespace swift::misc::simulation }; //! Default constructor. - CMatchingStatisticsEntry(); + CMatchingStatisticsEntry() = default; //! Constructor CMatchingStatisticsEntry(EntryType type, const QString &sessionId, const QString &modelSetId, diff --git a/src/misc/simulation/ownaircraftproviderdummy.h b/src/misc/simulation/ownaircraftproviderdummy.h index 40bef66fef..e95ef629fd 100644 --- a/src/misc/simulation/ownaircraftproviderdummy.h +++ b/src/misc/simulation/ownaircraftproviderdummy.h @@ -47,67 +47,67 @@ namespace swift::misc static COwnAircraftProviderDummy *instance(); //! \copydoc IOwnAircraftProvider::getOwnAircraft - virtual CSimulatedAircraft getOwnAircraft() const override; + CSimulatedAircraft getOwnAircraft() const override; //! \copydoc IOwnAircraftProvider::getOwnCallsign - virtual aviation::CCallsign getOwnCallsign() const override; + aviation::CCallsign getOwnCallsign() const override; //! \copydoc IOwnAircraftProvider::getOwnComSystem - virtual aviation::CComSystem getOwnComSystem(aviation::CComSystem::ComUnit unit) const override; + aviation::CComSystem getOwnComSystem(aviation::CComSystem::ComUnit unit) const override; //! \copydoc IOwnAircraftProvider::getOwnTransponder - virtual aviation::CTransponder getOwnTransponder() const override; + aviation::CTransponder getOwnTransponder() const override; //! \copydoc IOwnAircraftProvider::getOwnAircraftPosition - virtual swift::misc::geo::CCoordinateGeodetic getOwnAircraftPosition() const override; + swift::misc::geo::CCoordinateGeodetic getOwnAircraftPosition() const override; //! \copydoc IOwnAircraftProvider::getOwnAircraftSituation - virtual swift::misc::aviation::CAircraftSituation getOwnAircraftSituation() const override; + swift::misc::aviation::CAircraftSituation getOwnAircraftSituation() const override; //! \copydoc IOwnAircraftProvider::getOwnAircraftParts - virtual swift::misc::aviation::CAircraftParts getOwnAircraftParts() const override; + swift::misc::aviation::CAircraftParts getOwnAircraftParts() const override; //! \copydoc IOwnAircraftProvider::getOwnAircraftModel - virtual swift::misc::simulation::CAircraftModel getOwnAircraftModel() const override; + swift::misc::simulation::CAircraftModel getOwnAircraftModel() const override; //! \copydoc IOwnAircraftProvider::getDistanceToOwnAircraft - virtual swift::misc::physical_quantities::CLength + swift::misc::physical_quantities::CLength getDistanceToOwnAircraft(const swift::misc::geo::ICoordinateGeodetic &position) const override; public slots: //! \copydoc IOwnAircraftProvider::updateCockpit - virtual bool updateCockpit(const swift::misc::aviation::CComSystem &com1, - const swift::misc::aviation::CComSystem &com2, - const swift::misc::aviation::CTransponder &transponder, - const swift::misc::CIdentifier &originator) override; + bool updateCockpit(const swift::misc::aviation::CComSystem &com1, + const swift::misc::aviation::CComSystem &com2, + const swift::misc::aviation::CTransponder &transponder, + const swift::misc::CIdentifier &originator) override; //! \copydoc IOwnAircraftProvider::updateActiveComFrequency - virtual bool updateActiveComFrequency(const swift::misc::physical_quantities::CFrequency &frequency, - swift::misc::aviation::CComSystem::ComUnit comUnit, - const swift::misc::CIdentifier &originator) override; + bool updateActiveComFrequency(const swift::misc::physical_quantities::CFrequency &frequency, + swift::misc::aviation::CComSystem::ComUnit comUnit, + const swift::misc::CIdentifier &originator) override; //! \copydoc IOwnAircraftProvider::updateSelcal - virtual bool updateSelcal(const swift::misc::aviation::CSelcal &selcal, - const swift::misc::CIdentifier &originator) override; + bool updateSelcal(const swift::misc::aviation::CSelcal &selcal, + const swift::misc::CIdentifier &originator) override; //! \copydoc IOwnAircraftProvider::updateOwnCallsign - virtual bool updateOwnCallsign(const swift::misc::aviation::CCallsign &callsign) override; + bool updateOwnCallsign(const swift::misc::aviation::CCallsign &callsign) override; //! \copydoc IOwnAircraftProvider::updateOwnModel - virtual bool updateOwnModel(const swift::misc::simulation::CAircraftModel &model) override; + bool updateOwnModel(const swift::misc::simulation::CAircraftModel &model) override; //! \copydoc IOwnAircraftProvider::updateOwnIcaoCodes - virtual bool updateOwnIcaoCodes(const swift::misc::aviation::CAircraftIcaoCode &aircraftIcaoCode, - const swift::misc::aviation::CAirlineIcaoCode &airlineIcaoCode) override; + bool updateOwnIcaoCodes(const swift::misc::aviation::CAircraftIcaoCode &aircraftIcaoCode, + const swift::misc::aviation::CAirlineIcaoCode &airlineIcaoCode) override; //! \copydoc IOwnAircraftProvider::updateOwnSituation - virtual bool updateOwnSituation(const swift::misc::aviation::CAircraftSituation &situation) override; + bool updateOwnSituation(const swift::misc::aviation::CAircraftSituation &situation) override; //! \copydoc IOwnAircraftProvider::updateOwnParts - virtual bool updateOwnParts(const swift::misc::aviation::CAircraftParts &parts) override; + bool updateOwnParts(const swift::misc::aviation::CAircraftParts &parts) override; //! \copydoc IOwnAircraftProvider::updateOwnCG - virtual bool updateOwnCG(const swift::misc::physical_quantities::CLength &cg) override; + bool updateOwnCG(const swift::misc::physical_quantities::CLength &cg) override; private: swift::misc::simulation::CSimulatedAircraft m_ownAircraft; diff --git a/src/misc/simulation/remoteaircraftprovider.cpp b/src/misc/simulation/remoteaircraftprovider.cpp index bea4817a7e..d68b79f0d7 100644 --- a/src/misc/simulation/remoteaircraftprovider.cpp +++ b/src/misc/simulation/remoteaircraftprovider.cpp @@ -18,10 +18,6 @@ using namespace swift::config; namespace swift::misc::simulation { - IRemoteAircraftProvider::IRemoteAircraftProvider() {} - - IRemoteAircraftProvider::~IRemoteAircraftProvider() {} - const QStringList &CRemoteAircraftProvider::getLogCategories() { static const QStringList cats { CLogCategories::matching(), CLogCategories::network() }; @@ -962,8 +958,6 @@ namespace swift::misc::simulation return removedCallsign; } - CRemoteAircraftAware::~CRemoteAircraftAware() {} - CSimulatedAircraftList CRemoteAircraftAware::getAircraftInRange() const { Q_ASSERT_X(this->provider(), Q_FUNC_INFO, "No object available"); diff --git a/src/misc/simulation/remoteaircraftprovider.h b/src/misc/simulation/remoteaircraftprovider.h index fe485d6b35..a0b7cffdd4 100644 --- a/src/misc/simulation/remoteaircraftprovider.h +++ b/src/misc/simulation/remoteaircraftprovider.h @@ -49,7 +49,7 @@ namespace swift::misc static constexpr int MaxPartsAgePerCallsignSecs = 60; //!< How many seconds to keep parts for interpolation //! Destructor - virtual ~IRemoteAircraftProvider() override; + ~IRemoteAircraftProvider() override = default; //! Copy constructor IRemoteAircraftProvider(const IRemoteAircraftProvider &) = delete; @@ -292,7 +292,7 @@ namespace swift::misc protected: //! Constructor - IRemoteAircraftProvider(); + IRemoteAircraftProvider() = default; }; } // namespace simulation } // namespace swift::misc @@ -318,79 +318,74 @@ namespace swift::misc::simulation CRemoteAircraftProvider(QObject *parent); // remoteaircraftprovider - virtual CSimulatedAircraftList getAircraftInRange() const override; - virtual aviation::CCallsignSet getAircraftInRangeCallsigns() const override; - virtual CSimulatedAircraft getAircraftInRangeForCallsign(const aviation::CCallsign &callsign) const override; - virtual CAircraftModel getAircraftInRangeModelForCallsign(const aviation::CCallsign &callsign) const override; - virtual int getAircraftInRangeCount() const override; - virtual bool isAircraftInRange(const aviation::CCallsign &callsign) const override; - virtual bool isVtolAircraft(const aviation::CCallsign &callsign) const override; - virtual aviation::CAircraftSituationList - remoteAircraftSituations(const aviation::CCallsign &callsign) const override; - virtual aviation::CAircraftSituation remoteAircraftSituation(const aviation::CCallsign &callsign, - int index) const override; - virtual MillisecondsMinMaxMean + CSimulatedAircraftList getAircraftInRange() const override; + aviation::CCallsignSet getAircraftInRangeCallsigns() const override; + CSimulatedAircraft getAircraftInRangeForCallsign(const aviation::CCallsign &callsign) const override; + CAircraftModel getAircraftInRangeModelForCallsign(const aviation::CCallsign &callsign) const override; + int getAircraftInRangeCount() const override; + bool isAircraftInRange(const aviation::CCallsign &callsign) const override; + bool isVtolAircraft(const aviation::CCallsign &callsign) const override; + aviation::CAircraftSituationList remoteAircraftSituations(const aviation::CCallsign &callsign) const override; + aviation::CAircraftSituation remoteAircraftSituation(const aviation::CCallsign &callsign, + int index) const override; + MillisecondsMinMaxMean remoteAircraftSituationsTimestampDifferenceMinMaxMean(const aviation::CCallsign &callsign) const override; - virtual aviation::CAircraftSituationList latestRemoteAircraftSituations() const override; - virtual aviation::CAircraftSituationList latestOnGroundProviderElevations() const override; - virtual int remoteAircraftSituationsCount(const aviation::CCallsign &callsign) const override; - virtual aviation::CAircraftPartsList remoteAircraftParts(const aviation::CCallsign &callsign) const override; - virtual int remoteAircraftPartsCount(const aviation::CCallsign &callsign) const override; - virtual bool isRemoteAircraftSupportingParts(const aviation::CCallsign &callsign) const override; - virtual int getRemoteAircraftSupportingPartsCount() const override; - virtual aviation::CCallsignSet remoteAircraftSupportingParts() const override; - virtual aviation::CAircraftSituationChangeList + aviation::CAircraftSituationList latestRemoteAircraftSituations() const override; + aviation::CAircraftSituationList latestOnGroundProviderElevations() const override; + int remoteAircraftSituationsCount(const aviation::CCallsign &callsign) const override; + aviation::CAircraftPartsList remoteAircraftParts(const aviation::CCallsign &callsign) const override; + int remoteAircraftPartsCount(const aviation::CCallsign &callsign) const override; + bool isRemoteAircraftSupportingParts(const aviation::CCallsign &callsign) const override; + int getRemoteAircraftSupportingPartsCount() const override; + aviation::CCallsignSet remoteAircraftSupportingParts() const override; + aviation::CAircraftSituationChangeList remoteAircraftSituationChanges(const aviation::CCallsign &callsign) const override; - virtual int remoteAircraftSituationChangesCount(const aviation::CCallsign &callsign) const override; - virtual bool updateAircraftEnabled(const aviation::CCallsign &callsign, bool enabledForRendering) override; - virtual bool setAircraftEnabledFlag(const swift::misc::aviation::CCallsign &callsign, - bool enabledForRendering) override; - virtual int updateMultipleAircraftEnabled(const aviation::CCallsignSet &callsigns, - bool enabledForRendering) override; - virtual bool updateAircraftModel(const aviation::CCallsign &callsign, const CAircraftModel &model, - const CIdentifier &originator) override; - virtual bool updateAircraftNetworkModel(const aviation::CCallsign &callsign, const CAircraftModel &model, - const CIdentifier &originator) override; - virtual bool updateFastPositionEnabled(const aviation::CCallsign &callsign, - bool enableFastPositonUpdates) override; - virtual bool updateAircraftRendered(const aviation::CCallsign &callsign, bool rendered) override; - virtual int updateMultipleAircraftRendered(const aviation::CCallsignSet &callsigns, bool rendered) override; - virtual int updateAircraftGroundElevation(const aviation::CCallsign &callsign, - const geo::CElevationPlane &elevation, - aviation::CAircraftSituation::GndElevationInfo info, - bool *setForOnGroundPosition) override; - virtual bool updateCG(const aviation::CCallsign &callsign, const physical_quantities::CLength &cg) override; - virtual bool updateCGAndModelString(const aviation::CCallsign &callsign, const physical_quantities::CLength &cg, - const QString &modelString) override; - virtual aviation::CCallsignSet updateCGForModel(const QString &modelString, - const physical_quantities::CLength &cg) override; - virtual physical_quantities::CLength getCGFromDB(const aviation::CCallsign &callsign) const override; - virtual physical_quantities::CLength getCGFromDB(const QString &modelString) const override; - virtual void rememberCGFromDB(const physical_quantities::CLength &cgFromDB, - const aviation::CCallsign &callsign) override; - virtual void rememberCGFromDB(const physical_quantities::CLength &cgFromDB, - const QString &modelString) override; - virtual void updateMarkAllAsNotRendered() override; - virtual CStatusMessageList getAircraftPartsHistory(const aviation::CCallsign &callsign) const override; - virtual bool isAircraftPartsHistoryEnabled() const override; - virtual void enableAircraftPartsHistory(bool enabled) override; - virtual int aircraftSituationsAdded() const override; - virtual int aircraftPartsAdded() const override; - virtual qint64 situationsLastModified(const aviation::CCallsign &callsign) const override; - virtual qint64 partsLastModified(const aviation::CCallsign &callsign) const override; - virtual geo::CElevationPlane averageElevationOfNonMovingAircraft(const aviation::CAircraftSituation &reference, - const physical_quantities::CLength &range, - int minValues = 1, - int sufficientValues = 2) const override; - virtual QList connectRemoteAircraftProviderSignals( + int remoteAircraftSituationChangesCount(const aviation::CCallsign &callsign) const override; + bool updateAircraftEnabled(const aviation::CCallsign &callsign, bool enabledForRendering) override; + bool setAircraftEnabledFlag(const swift::misc::aviation::CCallsign &callsign, + bool enabledForRendering) override; + int updateMultipleAircraftEnabled(const aviation::CCallsignSet &callsigns, bool enabledForRendering) override; + bool updateAircraftModel(const aviation::CCallsign &callsign, const CAircraftModel &model, + const CIdentifier &originator) override; + bool updateAircraftNetworkModel(const aviation::CCallsign &callsign, const CAircraftModel &model, + const CIdentifier &originator) override; + bool updateFastPositionEnabled(const aviation::CCallsign &callsign, bool enableFastPositonUpdates) override; + bool updateAircraftRendered(const aviation::CCallsign &callsign, bool rendered) override; + int updateMultipleAircraftRendered(const aviation::CCallsignSet &callsigns, bool rendered) override; + int updateAircraftGroundElevation(const aviation::CCallsign &callsign, const geo::CElevationPlane &elevation, + aviation::CAircraftSituation::GndElevationInfo info, + bool *setForOnGroundPosition) override; + bool updateCG(const aviation::CCallsign &callsign, const physical_quantities::CLength &cg) override; + bool updateCGAndModelString(const aviation::CCallsign &callsign, const physical_quantities::CLength &cg, + const QString &modelString) override; + aviation::CCallsignSet updateCGForModel(const QString &modelString, + const physical_quantities::CLength &cg) override; + physical_quantities::CLength getCGFromDB(const aviation::CCallsign &callsign) const override; + physical_quantities::CLength getCGFromDB(const QString &modelString) const override; + void rememberCGFromDB(const physical_quantities::CLength &cgFromDB, + const aviation::CCallsign &callsign) override; + void rememberCGFromDB(const physical_quantities::CLength &cgFromDB, const QString &modelString) override; + void updateMarkAllAsNotRendered() override; + CStatusMessageList getAircraftPartsHistory(const aviation::CCallsign &callsign) const override; + bool isAircraftPartsHistoryEnabled() const override; + void enableAircraftPartsHistory(bool enabled) override; + int aircraftSituationsAdded() const override; + int aircraftPartsAdded() const override; + qint64 situationsLastModified(const aviation::CCallsign &callsign) const override; + qint64 partsLastModified(const aviation::CCallsign &callsign) const override; + geo::CElevationPlane averageElevationOfNonMovingAircraft(const aviation::CAircraftSituation &reference, + const physical_quantities::CLength &range, + int minValues = 1, + int sufficientValues = 2) const override; + QList connectRemoteAircraftProviderSignals( QObject *receiver, std::function addedSituationSlot, std::function addedPartsSlot, std::function removedAircraftSlot, std::function aircraftSnapshotSlot) override; - virtual void enableReverseLookupMessages(ReverseLookupLogging enable) override; - virtual ReverseLookupLogging isReverseLookupMessagesEnabled() const override; - virtual swift::misc::CStatusMessageList + void enableReverseLookupMessages(ReverseLookupLogging enable) override; + ReverseLookupLogging isReverseLookupMessagesEnabled() const override; + swift::misc::CStatusMessageList getReverseLookupMessages(const swift::misc::aviation::CCallsign &callsign) const override; //! @{ @@ -404,7 +399,7 @@ namespace swift::misc::simulation //! @} //! \copydoc swift::misc::IProvider::asQObject - virtual QObject *asQObject() override { return this; } + QObject *asQObject() override { return this; } //! Clear all data void clear(); @@ -565,7 +560,7 @@ namespace swift::misc::simulation { public: //! Destructor - virtual ~CRemoteAircraftAware() override; + ~CRemoteAircraftAware() override = default; //! \copydoc IRemoteAircraftProvider::getAircraftInRange CSimulatedAircraftList getAircraftInRange() const; diff --git a/src/misc/simulation/remoteaircraftproviderdummy.h b/src/misc/simulation/remoteaircraftproviderdummy.h index e894917352..988f514deb 100644 --- a/src/misc/simulation/remoteaircraftproviderdummy.h +++ b/src/misc/simulation/remoteaircraftproviderdummy.h @@ -41,8 +41,8 @@ namespace swift::misc::simulation //! @{ //! Members not implenented or fully implenented by CRemoteAircraftProvider //! \ingroup remoteaircraftprovider - virtual QObject *asQObject() override { return this; } - virtual CAirspaceAircraftSnapshot getLatestAirspaceAircraftSnapshot() const override; + QObject *asQObject() override { return this; } + CAirspaceAircraftSnapshot getLatestAirspaceAircraftSnapshot() const override; //! @} }; } // namespace swift::misc::simulation diff --git a/src/misc/simulation/settings/modelsettings.cpp b/src/misc/simulation/settings/modelsettings.cpp index 397bdcfa46..331f73927a 100644 --- a/src/misc/simulation/settings/modelsettings.cpp +++ b/src/misc/simulation/settings/modelsettings.cpp @@ -9,8 +9,6 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::misc::simulation::settings, CModelSetting namespace swift::misc::simulation::settings { - CModelSettings::CModelSettings() {} - QString CModelSettings::convertToQString(bool i18n) const { Q_UNUSED(i18n); diff --git a/src/misc/simulation/settings/modelsettings.h b/src/misc/simulation/settings/modelsettings.h index 4fc5aa0241..316557c351 100644 --- a/src/misc/simulation/settings/modelsettings.h +++ b/src/misc/simulation/settings/modelsettings.h @@ -26,7 +26,7 @@ namespace swift::misc::simulation::settings }; //! Default constructor - CModelSettings(); + CModelSettings() = default; //! Allow excluded models? bool getAllowExcludedModels() const { return m_allowExcludeModels; } diff --git a/src/misc/simulation/settings/simulatorsettings.cpp b/src/misc/simulation/settings/simulatorsettings.cpp index 5a1757663c..613418e9a9 100644 --- a/src/misc/simulation/settings/simulatorsettings.cpp +++ b/src/misc/simulation/settings/simulatorsettings.cpp @@ -44,8 +44,6 @@ namespace swift::misc::simulation::settings return u; } - CSimulatorSettings::CSimulatorSettings() {} - void CSimulatorSettings::setSimulatorDirectory(const QString &simulatorDirectory) { m_simulatorDirectory = simulatorDirectory.trimmed(); diff --git a/src/misc/simulation/settings/simulatorsettings.h b/src/misc/simulation/settings/simulatorsettings.h index c683177b30..056635ef76 100644 --- a/src/misc/simulation/settings/simulatorsettings.h +++ b/src/misc/simulation/settings/simulatorsettings.h @@ -55,7 +55,7 @@ namespace swift::misc::simulation::settings static const QString &cgSourceAsString(CGSource source); //! Default constructor - CSimulatorSettings(); + CSimulatorSettings() = default; //! Constructor CSimulatorSettings(const QString &simDir) : m_simulatorDirectory(simDir) {} @@ -160,7 +160,7 @@ namespace swift::misc::simulation::settings { public: //! Default constructor - CFsxP3DSettings() {} + CFsxP3DSettings() = default; //! Constructor CFsxP3DSettings(bool simulatedObject, bool sbOffsets) @@ -607,7 +607,7 @@ namespace swift::misc::simulation::settings Q_DECLARE_FLAGS(TextMessageType, TextMessageTypeFlag) //! Default constructor - CSimulatorMessagesSettings() {} + CSimulatorMessagesSettings() = default; //! Log severity void setTechnicalLogSeverity(CStatusMessage::StatusSeverity severity); diff --git a/src/misc/simulation/settings/swiftpluginsettings.cpp b/src/misc/simulation/settings/swiftpluginsettings.cpp index e28b4bfde3..5d7bb9eae3 100644 --- a/src/misc/simulation/settings/swiftpluginsettings.cpp +++ b/src/misc/simulation/settings/swiftpluginsettings.cpp @@ -9,8 +9,6 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::misc::simulation::settings, CSwiftPluginS namespace swift::misc::simulation::settings { - CSwiftPluginSettings::CSwiftPluginSettings() {} - void CSwiftPluginSettings::setEmulatedSimulator(const CSimulatorInfo &simulator) { Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "need single simulator"); diff --git a/src/misc/simulation/settings/swiftpluginsettings.h b/src/misc/simulation/settings/swiftpluginsettings.h index fac15b3f8f..297102e4ec 100644 --- a/src/misc/simulation/settings/swiftpluginsettings.h +++ b/src/misc/simulation/settings/swiftpluginsettings.h @@ -30,7 +30,7 @@ namespace swift::misc::simulation::settings }; //! Default constructor - CSwiftPluginSettings(); + CSwiftPluginSettings() = default; //! Emulated simualtor CSimulatorInfo getEmulatedSimulator() const { return m_emulatedSimulator; } diff --git a/src/misc/simulation/settings/xswiftbussettings.cpp b/src/misc/simulation/settings/xswiftbussettings.cpp index 73c1ec5858..ec689fd136 100644 --- a/src/misc/simulation/settings/xswiftbussettings.cpp +++ b/src/misc/simulation/settings/xswiftbussettings.cpp @@ -9,8 +9,6 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::misc::simulation::settings, CXSwiftBusSet namespace swift::misc::simulation::settings { - CXSwiftBusSettings::CXSwiftBusSettings() {} - CXSwiftBusSettings::CXSwiftBusSettings(const QString &json) { this->parseXSwiftBusStringQt(json); } QVariant CXSwiftBusSettings::propertyByIndex(CPropertyIndexRef index) const diff --git a/src/misc/simulation/settings/xswiftbussettings.h b/src/misc/simulation/settings/xswiftbussettings.h index 8daba1ced3..8f674ef0bc 100644 --- a/src/misc/simulation/settings/xswiftbussettings.h +++ b/src/misc/simulation/settings/xswiftbussettings.h @@ -40,7 +40,7 @@ namespace swift::misc::simulation::settings }; //! Default constructor - CXSwiftBusSettings(); + CXSwiftBusSettings() = default; //! From JSON constructor CXSwiftBusSettings(const QString &json); @@ -79,7 +79,7 @@ namespace swift::misc::simulation::settings void parseXSwiftBusStringQt(const QString &json) { this->parseXSwiftBusString(json.toStdString()); } //! Sets both timestamps - virtual void setCurrentUtcTime() override; + void setCurrentUtcTime() override; //! Valid settings? CStatusMessageList validate() const; @@ -89,7 +89,7 @@ namespace swift::misc::simulation::settings protected: //! \copydoc CXSwiftBusSettingsQtFree::objectUpdated - virtual void objectUpdated() override final; + void objectUpdated() override; private: SWIFT_METACLASS( diff --git a/src/misc/simulation/settings/xswiftbussettingsqtfree.h b/src/misc/simulation/settings/xswiftbussettingsqtfree.h index 13bf940837..b2e153dc22 100644 --- a/src/misc/simulation/settings/xswiftbussettingsqtfree.h +++ b/src/misc/simulation/settings/xswiftbussettingsqtfree.h @@ -19,10 +19,10 @@ namespace swift::misc::simulation::settings { protected: //! Constructor. - CXSwiftBusSettingsQtFree() {} + CXSwiftBusSettingsQtFree() = default; //! Destructor. - virtual ~CXSwiftBusSettingsQtFree() {} + virtual ~CXSwiftBusSettingsQtFree() = default; public: //! DBus server diff --git a/src/misc/simulation/simulatedaircraft.h b/src/misc/simulation/simulatedaircraft.h index 7d8ffcd472..0ecf5ba99f 100644 --- a/src/misc/simulation/simulatedaircraft.h +++ b/src/misc/simulation/simulatedaircraft.h @@ -210,22 +210,19 @@ namespace swift::misc const physical_quantities::CSpeed &getGroundSpeed() const { return m_situation.getGroundSpeed(); } //! \copydoc swift::misc::geo::ICoordinateGeodetic::latitude - virtual geo::CLatitude latitude() const override { return m_situation.latitude(); } + geo::CLatitude latitude() const override { return m_situation.latitude(); } //! \copydoc swift::misc::geo::ICoordinateGeodetic::longitude - virtual geo::CLongitude longitude() const override { return m_situation.longitude(); } + geo::CLongitude longitude() const override { return m_situation.longitude(); } //! \copydoc swift::misc::geo::ICoordinateGeodetic::geodeticHeight const aviation::CAltitude &geodeticHeight() const override { return m_situation.geodeticHeight(); } //! \copydoc swift::misc::geo::ICoordinateGeodetic::normalVector - virtual QVector3D normalVector() const override { return m_situation.normalVector(); } + QVector3D normalVector() const override { return m_situation.normalVector(); } //! \copydoc swift::misc::geo::ICoordinateGeodetic::normalVectorDouble - virtual std::array normalVectorDouble() const override - { - return m_situation.normalVectorDouble(); - } + std::array normalVectorDouble() const override { return m_situation.normalVectorDouble(); } //! \copydoc swift::misc::aviation::CAircraftSituation::getGroundElevation const aviation::CAltitude &getGroundElevation() const { return m_situation.getGroundElevation(); } diff --git a/src/misc/simulation/simulatedaircraftlist.cpp b/src/misc/simulation/simulatedaircraftlist.cpp index 0b86bc85c1..136cab0d64 100644 --- a/src/misc/simulation/simulatedaircraftlist.cpp +++ b/src/misc/simulation/simulatedaircraftlist.cpp @@ -25,8 +25,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::simulation, CSimulatedAircraft, CSimul namespace swift::misc::simulation { - CSimulatedAircraftList::CSimulatedAircraftList() {} - CSimulatedAircraftList::CSimulatedAircraftList(const CSequence &other) : CSequence(other) {} diff --git a/src/misc/simulation/simulatedaircraftlist.h b/src/misc/simulation/simulatedaircraftlist.h index b445ba82ec..565a48b1ee 100644 --- a/src/misc/simulation/simulatedaircraftlist.h +++ b/src/misc/simulation/simulatedaircraftlist.h @@ -45,7 +45,7 @@ namespace swift::misc using CSequence::CSequence; //! Default constructor. - CSimulatedAircraftList(); + CSimulatedAircraftList() = default; //! Construct from a base class object. CSimulatedAircraftList(const CSequence &other); diff --git a/src/misc/simulation/simulatorinfo.cpp b/src/misc/simulation/simulatorinfo.cpp index 56d4ad93ea..de1bb720c8 100644 --- a/src/misc/simulation/simulatorinfo.cpp +++ b/src/misc/simulation/simulatorinfo.cpp @@ -27,8 +27,6 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::misc::simulation, CSimulatorInfo) namespace swift::misc::simulation { - CSimulatorInfo::CSimulatorInfo() {} - CSimulatorInfo::CSimulatorInfo(const QString &identifierString) : m_simulator(identifierToSimulator(identifierString)) {} diff --git a/src/misc/simulation/simulatorinfo.h b/src/misc/simulation/simulatorinfo.h index ce9bda03cf..e54c3cff1e 100644 --- a/src/misc/simulation/simulatorinfo.h +++ b/src/misc/simulation/simulatorinfo.h @@ -61,7 +61,7 @@ namespace swift::misc::simulation static constexpr int NumberOfSimulators = 7; //! Default constructor - CSimulatorInfo(); + CSimulatorInfo() = default; //! Constructor CSimulatorInfo(const QString &identifierString); diff --git a/src/misc/simulation/simulatorinfolist.cpp b/src/misc/simulation/simulatorinfolist.cpp index 8df66ecea0..967db56e28 100644 --- a/src/misc/simulation/simulatorinfolist.cpp +++ b/src/misc/simulation/simulatorinfolist.cpp @@ -11,8 +11,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::simulation, CSimulatorInfo, CSimulator namespace swift::misc::simulation { - CSimulatorInfoList::CSimulatorInfoList() {} - CSimulatorInfoList::CSimulatorInfoList(const CSequence &other) : CSequence(other) {} CSimulatorInfoList CSimulatorInfoList::withNoDuplicates() const diff --git a/src/misc/simulation/simulatorinfolist.h b/src/misc/simulation/simulatorinfolist.h index be90420d85..41c690f8af 100644 --- a/src/misc/simulation/simulatorinfolist.h +++ b/src/misc/simulation/simulatorinfolist.h @@ -27,7 +27,7 @@ namespace swift::misc::simulation using CSequence::CSequence; //! Default constructor. - CSimulatorInfoList(); + CSimulatorInfoList() = default; //! Construct from a base class object. CSimulatorInfoList(const CSequence &other); diff --git a/src/misc/simulation/simulatorinternals.h b/src/misc/simulation/simulatorinternals.h index fc50c91d0f..672c25111e 100644 --- a/src/misc/simulation/simulatorinternals.h +++ b/src/misc/simulation/simulatorinternals.h @@ -37,7 +37,7 @@ namespace swift::misc::simulation }; //! Default constructor - CSimulatorInternals() {} + CSimulatorInternals() = default; //! All values swift::misc::CNameVariantPairList getData() const { return this->m_data; } diff --git a/src/misc/simulation/simulatorplugininfolist.cpp b/src/misc/simulation/simulatorplugininfolist.cpp index c19afdb9d3..44e558c667 100644 --- a/src/misc/simulation/simulatorplugininfolist.cpp +++ b/src/misc/simulation/simulatorplugininfolist.cpp @@ -12,8 +12,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::simulation, CSimulatorPluginInfo, CSim namespace swift::misc::simulation { - CSimulatorPluginInfoList::CSimulatorPluginInfoList() {} - bool CSimulatorPluginInfoList::supportsSimulator(const QString &simulator) const { return std::find_if(begin(), end(), [&simulator](const CSimulatorPluginInfo &info) { diff --git a/src/misc/simulation/simulatorplugininfolist.h b/src/misc/simulation/simulatorplugininfolist.h index 1c2bcef528..08de5ee77f 100644 --- a/src/misc/simulation/simulatorplugininfolist.h +++ b/src/misc/simulation/simulatorplugininfolist.h @@ -32,7 +32,7 @@ namespace swift::misc::simulation using CSequence::CSequence; //! Default constructor - CSimulatorPluginInfoList(); + CSimulatorPluginInfoList() = default; //! Construct from a base class object. CSimulatorPluginInfoList(const CSequence &other); diff --git a/src/misc/simulation/xplane/aircraftmodelloaderxplane.h b/src/misc/simulation/xplane/aircraftmodelloaderxplane.h index 24d7c300e3..dda28f676e 100644 --- a/src/misc/simulation/xplane/aircraftmodelloaderxplane.h +++ b/src/misc/simulation/xplane/aircraftmodelloaderxplane.h @@ -36,11 +36,11 @@ namespace swift::misc CAircraftModelLoaderXPlane(QObject *parent = nullptr); //! Virtual destructor - virtual ~CAircraftModelLoaderXPlane() override; + ~CAircraftModelLoaderXPlane() override; //! \name Interface functions //! @{ - virtual bool isLoadingFinished() const override; + bool isLoadingFinished() const override; //! @} //! Parsed or injected models @@ -49,8 +49,8 @@ namespace swift::misc protected: //! \name Interface functions //! @{ - virtual void startLoadingFromDisk(LoadMode mode, const ModelConsolidationCallback &modelConsolidation, - const QStringList &modelDirectories) override; + void startLoadingFromDisk(LoadMode mode, const ModelConsolidationCallback &modelConsolidation, + const QStringList &modelDirectories) override; //! @} private: diff --git a/src/misc/simulation/xplane/navdatareference.cpp b/src/misc/simulation/xplane/navdatareference.cpp index 08cddca2c3..c98b169f40 100644 --- a/src/misc/simulation/xplane/navdatareference.cpp +++ b/src/misc/simulation/xplane/navdatareference.cpp @@ -12,8 +12,6 @@ SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::simulation::xplane, CNavDataReference, namespace swift::misc::simulation::xplane { - CNavDataReference::CNavDataReference() = default; - CNavDataReference::CNavDataReference(int id, const geo::CLatitude &latitude, const geo::CLongitude &longitude) : m_id(id), m_position(latitude, longitude, {}) {} @@ -44,8 +42,6 @@ namespace swift::misc::simulation::xplane return QString::number(id()) + ":" + m_position.convertToQString(i18n); } - CNavDataReferenceList::CNavDataReferenceList() = default; - CNavDataReferenceList::CNavDataReferenceList(const CSequence &other) : CSequence(other) {} diff --git a/src/misc/simulation/xplane/navdatareference.h b/src/misc/simulation/xplane/navdatareference.h index d3e32b7408..260b02b399 100644 --- a/src/misc/simulation/xplane/navdatareference.h +++ b/src/misc/simulation/xplane/navdatareference.h @@ -37,7 +37,7 @@ namespace swift::misc::simulation::xplane { public: //! Default constructor. - CNavDataReference(); + CNavDataReference() = default; //! Construct from a navdata reference ID and position. CNavDataReference(int id, const geo::CLatitude &latitude, const geo::CLongitude &longitude); @@ -48,14 +48,11 @@ namespace swift::misc::simulation::xplane //! Return the navdata reference ID. int id() const { return m_id; } - virtual geo::CLatitude latitude() const override { return m_position.latitude(); } - virtual geo::CLongitude longitude() const override { return m_position.longitude(); } - virtual const aviation::CAltitude &geodeticHeight() const override { return m_position.geodeticHeight(); } - virtual QVector3D normalVector() const override { return m_position.normalVector(); } - virtual std::array normalVectorDouble() const override - { - return this->m_position.normalVectorDouble(); - } + geo::CLatitude latitude() const override { return m_position.latitude(); } + geo::CLongitude longitude() const override { return m_position.longitude(); } + const aviation::CAltitude &geodeticHeight() const override { return m_position.geodeticHeight(); } + QVector3D normalVector() const override { return m_position.normalVector(); } + std::array normalVectorDouble() const override { return this->m_position.normalVectorDouble(); } //! \copydoc swift::misc::mixin::Index::propertyByIndex QVariant propertyByIndex(swift::misc::CPropertyIndexRef index) const; @@ -89,7 +86,7 @@ namespace swift::misc::simulation::xplane using CSequence::CSequence; //! Default constructor. - CNavDataReferenceList(); + CNavDataReferenceList() = default; //! Construct from a base class object. CNavDataReferenceList(const CSequence &other); diff --git a/src/misc/slot.h b/src/misc/slot.h index d1fda9fb1a..f4bb3d3520 100644 --- a/src/misc/slot.h +++ b/src/misc/slot.h @@ -70,7 +70,7 @@ namespace swift::misc { public: //! Construct an empty slot. - CSlot() {} + CSlot() = default; //! Construct a slot from the given member function of the given object. template diff --git a/src/misc/statusexception.h b/src/misc/statusexception.h index 5d824f4825..15bd6b30e2 100644 --- a/src/misc/statusexception.h +++ b/src/misc/statusexception.h @@ -32,13 +32,13 @@ namespace swift::misc CStatusException &operator=(const CStatusException &) = delete; //! Return null-terminated message string. - virtual const char *what() const noexcept override; + const char *what() const noexcept override; //! Return the contained status message. const CStatusMessage &status() const { return m_payload; } //! Destructor. - ~CStatusException() override {} + ~CStatusException() override = default; //! If the message is not empty then throw it. static void maybeThrow(const CStatusMessage &); diff --git a/src/misc/statusmessage.h b/src/misc/statusmessage.h index 2b01e0c0b2..15a1492a01 100644 --- a/src/misc/statusmessage.h +++ b/src/misc/statusmessage.h @@ -159,7 +159,7 @@ namespace swift::misc { public: //! Default constructor. - CMessageBase() {} + CMessageBase() = default; //! Construct a message with some specific category. explicit CMessageBase(const CLogCategory &category) : m_categories({ category }) {} diff --git a/src/misc/test/testserviceinterface.cpp b/src/misc/test/testserviceinterface.cpp index c89c57a877..2139f4f200 100644 --- a/src/misc/test/testserviceinterface.cpp +++ b/src/misc/test/testserviceinterface.cpp @@ -27,8 +27,6 @@ namespace swift::misc::test : QDBusAbstractInterface(service, path, ITestServiceInterface::InterfaceName(), connection, parent) {} - ITestServiceInterface::~ITestServiceInterface() {} - int ITestServiceInterface::pingTests(ITestServiceInterface &testServiceInterface, bool verbose) { int errors = 0; diff --git a/src/misc/test/testserviceinterface.h b/src/misc/test/testserviceinterface.h index 881efbcca0..6db058d79a 100644 --- a/src/misc/test/testserviceinterface.h +++ b/src/misc/test/testserviceinterface.h @@ -68,7 +68,7 @@ namespace swift::misc::test QObject *parent = nullptr); //! Destructor - virtual ~ITestServiceInterface(); + ~ITestServiceInterface() override = default; //! Ping via DBus, tests object marshalling/unmarshalling static int pingTests(ITestServiceInterface &testServiceInterface, bool verbose); diff --git a/src/misc/timestampbased.cpp b/src/misc/timestampbased.cpp index eaf5ed9d99..90696954c0 100644 --- a/src/misc/timestampbased.cpp +++ b/src/misc/timestampbased.cpp @@ -12,8 +12,6 @@ namespace swift::misc { - ITimestampBased::ITimestampBased() {} - ITimestampBased::ITimestampBased(qint64 msSincePoch) : m_timestampMSecsSinceEpoch(msSincePoch) {} ITimestampBased::ITimestampBased(const QDateTime ×tamp) diff --git a/src/misc/timestampbased.h b/src/misc/timestampbased.h index 749ca6e575..97ef2b6fb5 100644 --- a/src/misc/timestampbased.h +++ b/src/misc/timestampbased.h @@ -150,7 +150,7 @@ namespace swift::misc protected: //! Constructor - ITimestampBased(); + ITimestampBased() = default; //! Constructor ITimestampBased(qint64 msSincePoch); diff --git a/src/misc/variant.h b/src/misc/variant.h index 873edca608..d7a82f14d1 100644 --- a/src/misc/variant.h +++ b/src/misc/variant.h @@ -70,7 +70,7 @@ namespace swift::misc public: //! Default constructor. - CVariant() {} + CVariant() = default; //! Copy constructor. CVariant(const CVariant &) = default; diff --git a/src/misc/variantlist.h b/src/misc/variantlist.h index 75db1cfec8..c67f59c564 100644 --- a/src/misc/variantlist.h +++ b/src/misc/variantlist.h @@ -32,7 +32,7 @@ namespace swift::misc using CSequence::CSequence; //! Default constructor. - CVariantList() {} + CVariantList() = default; //! Construct from a base class object. CVariantList(const CSequence &other); diff --git a/src/misc/variantmap.h b/src/misc/variantmap.h index 2d6aae1a60..c42a72927d 100644 --- a/src/misc/variantmap.h +++ b/src/misc/variantmap.h @@ -38,7 +38,7 @@ namespace swift::misc using CDictionary::CDictionary; //! Default constructor. - CVariantMap() {} + CVariantMap() = default; //! Copy constructor. CVariantMap(const CVariantMap &) = default; diff --git a/src/misc/variantprivate.h b/src/misc/variantprivate.h index 6fd09f55fe..b6c9f87fea 100644 --- a/src/misc/variantprivate.h +++ b/src/misc/variantprivate.h @@ -71,7 +71,7 @@ namespace swift::misc const QString &operationName() const { return m_operationName; } - ~CVariantException() {} + ~CVariantException() override = default; private: QString m_operationName; @@ -224,42 +224,39 @@ namespace swift::misc struct CValueObjectMetaInfo : public IValueObjectMetaInfo { CValueObjectMetaInfo(); - virtual ~CValueObjectMetaInfo() override; + ~CValueObjectMetaInfo() override; static CValueObjectMetaInfo *instance(const T &); CValueObjectMetaInfo(const CValueObjectMetaInfo &) = delete; CValueObjectMetaInfo &operator=(const CValueObjectMetaInfo &) = delete; - virtual QString toQString(const void *object, bool i18n) const override; - virtual QJsonObject toJson(const void *object) const override; - virtual void convertFromJson(const QJsonObject &json, void *object) const override; - virtual QJsonObject toMemoizedJson(const void *object) const override; - virtual void convertFromMemoizedJson(const QJsonObject &json, void *object, - bool allowFallbackToJson) const override; - virtual void unmarshall(const QDBusArgument &arg, void *object) const override; - virtual size_t getValueHash(const void *object) const override; - virtual int getMetaTypeId() const override; - virtual const void *upCastTo(const void *object, int metaTypeId) const override; - virtual int compareImpl(const void *lhs, const void *rhs) const override; - virtual void setPropertyByIndex(void *object, const QVariant &variant, - CPropertyIndexRef index) const override; - virtual void propertyByIndex(const void *object, QVariant &o_variant, - swift::misc::CPropertyIndexRef index) const override; - virtual bool equalsPropertyByIndex(const void *object, const QVariant &compareValue, - CPropertyIndexRef index) const override; - virtual int toIcon(const void *object) const override; - virtual bool matches(const void *object, const CVariant &value) const override; + QString toQString(const void *object, bool i18n) const override; + QJsonObject toJson(const void *object) const override; + void convertFromJson(const QJsonObject &json, void *object) const override; + QJsonObject toMemoizedJson(const void *object) const override; + void convertFromMemoizedJson(const QJsonObject &json, void *object, + bool allowFallbackToJson) const override; + void unmarshall(const QDBusArgument &arg, void *object) const override; + size_t getValueHash(const void *object) const override; + int getMetaTypeId() const override; + const void *upCastTo(const void *object, int metaTypeId) const override; + int compareImpl(const void *lhs, const void *rhs) const override; + void setPropertyByIndex(void *object, const QVariant &variant, CPropertyIndexRef index) const override; + void propertyByIndex(const void *object, QVariant &o_variant, + swift::misc::CPropertyIndexRef index) const override; + bool equalsPropertyByIndex(const void *object, const QVariant &compareValue, + CPropertyIndexRef index) const override; + int toIcon(const void *object) const override; + bool matches(const void *object, const CVariant &value) const override; static const T &cast(const void *object); static T &cast(void *object); }; template - CValueObjectMetaInfo::CValueObjectMetaInfo() - {} + CValueObjectMetaInfo::CValueObjectMetaInfo() = default; template - CValueObjectMetaInfo::~CValueObjectMetaInfo() - {} + CValueObjectMetaInfo::~CValueObjectMetaInfo() = default; template CValueObjectMetaInfo *CValueObjectMetaInfo::instance(const T &) { diff --git a/src/misc/weather/metardecoder.cpp b/src/misc/weather/metardecoder.cpp index cc814f808b..66b4495ec0 100644 --- a/src/misc/weather/metardecoder.cpp +++ b/src/misc/weather/metardecoder.cpp @@ -922,7 +922,7 @@ namespace swift::misc::weather CMetarDecoder::CMetarDecoder() { allocateDecoders(); } - CMetarDecoder::~CMetarDecoder() {} + CMetarDecoder::~CMetarDecoder() = default; // Needs to stay in .cpp because of IMetarDecoderPart CMetar CMetarDecoder::decode(const QString &metarString) const { diff --git a/src/plugins/simulator/emulated/simulatoremulated.h b/src/plugins/simulator/emulated/simulatoremulated.h index 1942d89825..3dfe870a6e 100644 --- a/src/plugins/simulator/emulated/simulatoremulated.h +++ b/src/plugins/simulator/emulated/simulatoremulated.h @@ -43,39 +43,37 @@ namespace swift::simplugin::emulated swift::misc::network::IClientProvider *clientProvider, QObject *parent = nullptr); //! Destructor - virtual ~CSimulatorEmulated() override; + ~CSimulatorEmulated() override; // functions implemented - virtual bool connectTo() override; - virtual bool disconnectFrom() override; - virtual void unload() override; - virtual bool isConnected() const override; - virtual bool isPaused() const override; - virtual bool isSimulating() const override; - virtual bool changeRemoteAircraftModel(const swift::misc::simulation::CSimulatedAircraft &aircraft) override; - virtual bool changeRemoteAircraftEnabled(const swift::misc::simulation::CSimulatedAircraft &aircraft) override; - virtual bool updateOwnSimulatorCockpit(const swift::misc::simulation::CSimulatedAircraft &aircraft, - const swift::misc::CIdentifier &originator) override; - virtual bool updateOwnSimulatorSelcal(const swift::misc::aviation::CSelcal &selcal, - const swift::misc::CIdentifier &originator) override; - virtual void displayStatusMessage(const swift::misc::CStatusMessage &message) const override; - virtual void displayTextMessage(const swift::misc::network::CTextMessage &message) const override; - virtual bool isPhysicallyRenderedAircraft(const swift::misc::aviation::CCallsign &callsign) const override; - virtual swift::misc::aviation::CCallsignSet physicallyRenderedAircraft() const override; - virtual swift::misc::CStatusMessageList + bool connectTo() override; + bool disconnectFrom() override; + void unload() override; + bool isConnected() const override; + bool isPaused() const override; + bool isSimulating() const override; + bool changeRemoteAircraftModel(const swift::misc::simulation::CSimulatedAircraft &aircraft) override; + bool changeRemoteAircraftEnabled(const swift::misc::simulation::CSimulatedAircraft &aircraft) override; + bool updateOwnSimulatorCockpit(const swift::misc::simulation::CSimulatedAircraft &aircraft, + const swift::misc::CIdentifier &originator) override; + bool updateOwnSimulatorSelcal(const swift::misc::aviation::CSelcal &selcal, + const swift::misc::CIdentifier &originator) override; + void displayStatusMessage(const swift::misc::CStatusMessage &message) const override; + void displayTextMessage(const swift::misc::network::CTextMessage &message) const override; + bool isPhysicallyRenderedAircraft(const swift::misc::aviation::CCallsign &callsign) const override; + swift::misc::aviation::CCallsignSet physicallyRenderedAircraft() const override; + swift::misc::CStatusMessageList getInterpolationMessages(const swift::misc::aviation::CCallsign &callsign) const override; - virtual bool testSendSituationAndParts(const swift::misc::aviation::CCallsign &callsign, - const swift::misc::aviation::CAircraftSituation &situation, - const swift::misc::aviation::CAircraftParts &parts) override; - virtual bool requestElevation(const swift::misc::geo::ICoordinateGeodetic &reference, - const swift::misc::aviation::CCallsign &callsign) override; + bool testSendSituationAndParts(const swift::misc::aviation::CCallsign &callsign, + const swift::misc::aviation::CAircraftSituation &situation, + const swift::misc::aviation::CAircraftParts &parts) override; + bool requestElevation(const swift::misc::geo::ICoordinateGeodetic &reference, + const swift::misc::aviation::CCallsign &callsign) override; // ----- functions just logged ------- - virtual bool - logicallyAddRemoteAircraft(const swift::misc::simulation::CSimulatedAircraft &remoteAircraft) override; - virtual bool logicallyRemoveRemoteAircraft(const swift::misc::aviation::CCallsign &callsign) override; - virtual int - physicallyRemoveMultipleRemoteAircraft(const swift::misc::aviation::CCallsignSet &callsigns) override; + bool logicallyAddRemoteAircraft(const swift::misc::simulation::CSimulatedAircraft &remoteAircraft) override; + bool logicallyRemoveRemoteAircraft(const swift::misc::aviation::CCallsign &callsign) override; + int physicallyRemoveMultipleRemoteAircraft(const swift::misc::aviation::CCallsignSet &callsigns) override; // functions logged and used //! \ingroup swiftdotcommands @@ -84,7 +82,7 @@ namespace swift::simplugin::emulated //! .drv hide hide emulated driver window swift::simplugin::emulated::CSimulatorEmulated //! //! \copydoc swift::core::ISimulator::parseCommandLine - virtual bool parseCommandLine(const QString &commandLine, const swift::misc::CIdentifier &originator) override; + bool parseCommandLine(const QString &commandLine, const swift::misc::CIdentifier &originator) override; //! UI setter void setCombinedStatus(bool connected, bool simulating, bool paused); @@ -131,13 +129,12 @@ namespace swift::simplugin::emulated void internalAircraftChanged(); protected: - virtual bool - physicallyAddRemoteAircraft(const swift::misc::simulation::CSimulatedAircraft &remoteAircraft) override; - virtual bool physicallyRemoveRemoteAircraft(const swift::misc::aviation::CCallsign &callsign) override; - virtual int physicallyRemoveAllRemoteAircraft() override; + bool physicallyAddRemoteAircraft(const swift::misc::simulation::CSimulatedAircraft &remoteAircraft) override; + bool physicallyRemoveRemoteAircraft(const swift::misc::aviation::CCallsign &callsign) override; + int physicallyRemoveAllRemoteAircraft() override; //! \copydoc swift::core::ISimulator::parseDetails - virtual bool parseDetails(const swift::misc::CSimpleCommandParser &parser) override; + bool parseDetails(const swift::misc::CSimpleCommandParser &parser) override; private: //! Set object name @@ -195,13 +192,13 @@ namespace swift::simplugin::emulated protected: //! \copydoc swift::core::ISimulatorListener::startImpl - virtual void startImpl() override; + void startImpl() override; //! \copydoc swift::core::ISimulatorListener::stopImpl - virtual void stopImpl() override; + void stopImpl() override; //! \copydoc swift::core::ISimulatorListener::stopImpl - virtual void checkImpl() override; + void checkImpl() override; }; } // namespace swift::simplugin::emulated diff --git a/src/plugins/simulator/emulated/simulatoremulatedfactory.h b/src/plugins/simulator/emulated/simulatoremulatedfactory.h index c3a73b4184..936c9bac70 100644 --- a/src/plugins/simulator/emulated/simulatoremulatedfactory.h +++ b/src/plugins/simulator/emulated/simulatoremulatedfactory.h @@ -23,14 +23,13 @@ namespace swift::simplugin::emulated public: //! \copydoc swift::core::ISimulatorFactory::create - virtual swift::core::ISimulator * - create(const swift::misc::simulation::CSimulatorPluginInfo &info, - swift::misc::simulation::IOwnAircraftProvider *ownAircraftProvider, - swift::misc::simulation::IRemoteAircraftProvider *remoteAircraftProvider, - swift::misc::network::IClientProvider *clientProvider) override; + swift::core::ISimulator *create(const swift::misc::simulation::CSimulatorPluginInfo &info, + swift::misc::simulation::IOwnAircraftProvider *ownAircraftProvider, + swift::misc::simulation::IRemoteAircraftProvider *remoteAircraftProvider, + swift::misc::network::IClientProvider *clientProvider) override; //! \copydoc swift::core::ISimulatorFactory::createListener - virtual swift::core::ISimulatorListener * + swift::core::ISimulatorListener * createListener(const swift::misc::simulation::CSimulatorPluginInfo &info) override; }; } // namespace swift::simplugin::emulated diff --git a/src/plugins/simulator/emulated/simulatoremulatedmonitordialog.cpp b/src/plugins/simulator/emulated/simulatoremulatedmonitordialog.cpp index 7d12179344..86d2f4052d 100644 --- a/src/plugins/simulator/emulated/simulatoremulatedmonitordialog.cpp +++ b/src/plugins/simulator/emulated/simulatoremulatedmonitordialog.cpp @@ -96,7 +96,7 @@ namespace swift::simplugin::emulated this->updateWindowTitleAndUiValues(simulator->getSimulatorInfo()); } - CSimulatorEmulatedMonitorDialog::~CSimulatorEmulatedMonitorDialog() {} + CSimulatorEmulatedMonitorDialog::~CSimulatorEmulatedMonitorDialog() = default; void CSimulatorEmulatedMonitorDialog::appendStatusMessageToList(const swift::misc::CStatusMessage &statusMessage) { diff --git a/src/plugins/simulator/emulated/simulatoremulatedmonitordialog.h b/src/plugins/simulator/emulated/simulatoremulatedmonitordialog.h index 21b6a06c1b..9bbd199640 100644 --- a/src/plugins/simulator/emulated/simulatoremulatedmonitordialog.h +++ b/src/plugins/simulator/emulated/simulatoremulatedmonitordialog.h @@ -39,7 +39,7 @@ namespace swift::simplugin::emulated explicit CSimulatorEmulatedMonitorDialog(CSimulatorEmulated *simulator, QWidget *parent = nullptr); //! Dtor - virtual ~CSimulatorEmulatedMonitorDialog() override; + ~CSimulatorEmulatedMonitorDialog() override; //! Append status message void appendStatusMessageToList(const swift::misc::CStatusMessage &statusMessage); diff --git a/src/plugins/simulator/emulatedconfig/simulatoremulatedconfig.h b/src/plugins/simulator/emulatedconfig/simulatoremulatedconfig.h index b153482085..1c37ba1b3a 100644 --- a/src/plugins/simulator/emulatedconfig/simulatoremulatedconfig.h +++ b/src/plugins/simulator/emulatedconfig/simulatoremulatedconfig.h @@ -24,7 +24,7 @@ namespace swift::simplugin::emulated CSimulatorEmulatedConfig(QObject *parent = nullptr); //! Dtor - virtual ~CSimulatorEmulatedConfig() override {} + ~CSimulatorEmulatedConfig() override = default; //! \copydoc swift::gui::IPluginConfig::createConfigWindow() swift::gui::CPluginConfigWindow *createConfigWindow(QWidget *parent) override; diff --git a/src/plugins/simulator/emulatedconfig/simulatoremulatedconfigwidget.cpp b/src/plugins/simulator/emulatedconfig/simulatoremulatedconfigwidget.cpp index a934947f4d..576be7d4f6 100644 --- a/src/plugins/simulator/emulatedconfig/simulatoremulatedconfigwidget.cpp +++ b/src/plugins/simulator/emulatedconfig/simulatoremulatedconfigwidget.cpp @@ -17,5 +17,5 @@ namespace swift::simplugin::emulated connect(ui->bb_Close, &QDialogButtonBox::rejected, this, &CSimulatorEmulatedConfigWidget::close); } - CSimulatorEmulatedConfigWidget::~CSimulatorEmulatedConfigWidget() {} + CSimulatorEmulatedConfigWidget::~CSimulatorEmulatedConfigWidget() = default; } // namespace swift::simplugin::emulated diff --git a/src/plugins/simulator/emulatedconfig/simulatoremulatedconfigwidget.h b/src/plugins/simulator/emulatedconfig/simulatoremulatedconfigwidget.h index 909d4241e3..43f825d088 100644 --- a/src/plugins/simulator/emulatedconfig/simulatoremulatedconfigwidget.h +++ b/src/plugins/simulator/emulatedconfig/simulatoremulatedconfigwidget.h @@ -28,7 +28,7 @@ namespace swift::simplugin::emulated explicit CSimulatorEmulatedConfigWidget(QWidget *parent = nullptr); //! Dtor - virtual ~CSimulatorEmulatedConfigWidget(); + ~CSimulatorEmulatedConfigWidget() override; private: QScopedPointer ui; diff --git a/src/plugins/simulator/flightgear/flightgearmpaircraft.cpp b/src/plugins/simulator/flightgear/flightgearmpaircraft.cpp index 866a3ee174..02ec254d99 100644 --- a/src/plugins/simulator/flightgear/flightgearmpaircraft.cpp +++ b/src/plugins/simulator/flightgear/flightgearmpaircraft.cpp @@ -13,8 +13,6 @@ using namespace swift::misc::simulation; namespace swift::simplugin::flightgear { - CFlightgearMPAircraft::CFlightgearMPAircraft() {} - CFlightgearMPAircraft::CFlightgearMPAircraft(const CSimulatedAircraft &aircraft, ISimulator *simulator, CInterpolationLogger *logger) : m_aircraft(aircraft), diff --git a/src/plugins/simulator/flightgear/flightgearmpaircraft.h b/src/plugins/simulator/flightgear/flightgearmpaircraft.h index 0a116cf3d3..1f71a1a38e 100644 --- a/src/plugins/simulator/flightgear/flightgearmpaircraft.h +++ b/src/plugins/simulator/flightgear/flightgearmpaircraft.h @@ -31,7 +31,7 @@ namespace swift::simplugin::flightgear swift::misc::simulation::CInterpolationLogger *logger); //! Destructor - ~CFlightgearMPAircraft() {} + ~CFlightgearMPAircraft() = default; //! Set simulated aircraft void setSimulatedAircraft(const swift::misc::simulation::CSimulatedAircraft &simulatedAircraft); diff --git a/src/plugins/simulator/flightgear/simulatorflightgear.h b/src/plugins/simulator/flightgear/simulatorflightgear.h index 6f8201e48e..7fbe5cdcc5 100644 --- a/src/plugins/simulator/flightgear/simulatorflightgear.h +++ b/src/plugins/simulator/flightgear/simulatorflightgear.h @@ -119,42 +119,41 @@ namespace swift::simplugin::flightgear swift::misc::network::IClientProvider *clientProvider, QObject *parent = nullptr); //! Dtor - virtual ~CSimulatorFlightgear() override; + ~CSimulatorFlightgear() override; //! \name ISimulator implementations //! @{ - virtual bool connectTo() override; - virtual bool disconnectFrom() override; - virtual bool updateOwnSimulatorCockpit(const swift::misc::simulation::CSimulatedAircraft &aircraft, - const swift::misc::CIdentifier &originator) override; - virtual bool updateOwnSimulatorSelcal(const swift::misc::aviation::CSelcal &selcal, - const swift::misc::CIdentifier &originator) override; - virtual void displayStatusMessage(const swift::misc::CStatusMessage &message) const override; - virtual void displayTextMessage(const swift::misc::network::CTextMessage &message) const override; - virtual bool isPhysicallyRenderedAircraft(const swift::misc::aviation::CCallsign &callsign) const override; - virtual swift::misc::aviation::CCallsignSet physicallyRenderedAircraft() const override; - virtual void unload() override; - virtual QString getStatisticsSimulatorSpecific() const override; - virtual void resetAircraftStatistics() override; - virtual swift::misc::CStatusMessageList + bool connectTo() override; + bool disconnectFrom() override; + bool updateOwnSimulatorCockpit(const swift::misc::simulation::CSimulatedAircraft &aircraft, + const swift::misc::CIdentifier &originator) override; + bool updateOwnSimulatorSelcal(const swift::misc::aviation::CSelcal &selcal, + const swift::misc::CIdentifier &originator) override; + void displayStatusMessage(const swift::misc::CStatusMessage &message) const override; + void displayTextMessage(const swift::misc::network::CTextMessage &message) const override; + bool isPhysicallyRenderedAircraft(const swift::misc::aviation::CCallsign &callsign) const override; + swift::misc::aviation::CCallsignSet physicallyRenderedAircraft() const override; + void unload() override; + QString getStatisticsSimulatorSpecific() const override; + void resetAircraftStatistics() override; + swift::misc::CStatusMessageList getInterpolationMessages(const swift::misc::aviation::CCallsign &callsign) const override; - virtual bool testSendSituationAndParts(const swift::misc::aviation::CCallsign &callsign, - const swift::misc::aviation::CAircraftSituation &situation, - const swift::misc::aviation::CAircraftParts &parts) override; - virtual bool requestElevation(const swift::misc::geo::ICoordinateGeodetic &reference, - const swift::misc::aviation::CCallsign &callsign) override; + bool testSendSituationAndParts(const swift::misc::aviation::CCallsign &callsign, + const swift::misc::aviation::CAircraftSituation &situation, + const swift::misc::aviation::CAircraftParts &parts) override; + bool requestElevation(const swift::misc::geo::ICoordinateGeodetic &reference, + const swift::misc::aviation::CCallsign &callsign) override; //! @} protected: //! \name ISimulator implementations //! @{ - virtual bool isConnected() const override; - virtual bool - physicallyAddRemoteAircraft(const swift::misc::simulation::CSimulatedAircraft &newRemoteAircraft) override; - virtual bool physicallyRemoveRemoteAircraft(const swift::misc::aviation::CCallsign &callsign) override; - virtual int physicallyRemoveAllRemoteAircraft() override; - virtual void clearAllRemoteAircraftData() override; - virtual bool isPaused() const override { return false; } + bool isConnected() const override; + bool physicallyAddRemoteAircraft(const swift::misc::simulation::CSimulatedAircraft &newRemoteAircraft) override; + bool physicallyRemoveRemoteAircraft(const swift::misc::aviation::CCallsign &callsign) override; + int physicallyRemoveAllRemoteAircraft() override; + void clearAllRemoteAircraftData() override; + bool isPaused() const override { return false; } //! @} private slots: @@ -259,13 +258,13 @@ namespace swift::simplugin::flightgear protected: //! \copydoc swift::core::ISimulatorListener::startImpl - virtual void startImpl() override; + void startImpl() override; //! \copydoc swift::core::ISimulatorListener::stopImpl - virtual void stopImpl() override; + void stopImpl() override; //! \copydoc swift::core::ISimulatorListener::checkImpl - virtual void checkImpl() override; + void checkImpl() override; private: void checkConnection(); @@ -292,14 +291,13 @@ namespace swift::simplugin::flightgear public: //! \copydoc swift::core::ISimulatorFactory::create - virtual swift::core::ISimulator * - create(const swift::misc::simulation::CSimulatorPluginInfo &info, - swift::misc::simulation::IOwnAircraftProvider *ownAircraftProvider, - swift::misc::simulation::IRemoteAircraftProvider *remoteAircraftProvider, - swift::misc::network::IClientProvider *clientProvider) override; + swift::core::ISimulator *create(const swift::misc::simulation::CSimulatorPluginInfo &info, + swift::misc::simulation::IOwnAircraftProvider *ownAircraftProvider, + swift::misc::simulation::IRemoteAircraftProvider *remoteAircraftProvider, + swift::misc::network::IClientProvider *clientProvider) override; //! \copydoc swift::core::ISimulatorFactory::createListener - virtual swift::core::ISimulatorListener * + swift::core::ISimulatorListener * createListener(const swift::misc::simulation::CSimulatorPluginInfo &info) override { return new CSimulatorFlightgearListener(info); diff --git a/src/plugins/simulator/flightgearconfig/simulatorflightgearconfig.h b/src/plugins/simulator/flightgearconfig/simulatorflightgearconfig.h index dc0d26d6a4..e0fa7c8981 100644 --- a/src/plugins/simulator/flightgearconfig/simulatorflightgearconfig.h +++ b/src/plugins/simulator/flightgearconfig/simulatorflightgearconfig.h @@ -34,7 +34,7 @@ namespace swift::simplugin::flightgear CSimulatorFlightgearConfig(QObject *parent = nullptr); //! Dtor - virtual ~CSimulatorFlightgearConfig() {} + ~CSimulatorFlightgearConfig() override = default; //! \copydoc swift::gui::IPluginConfig::createConfigWindow() swift::gui::CPluginConfigWindow *createConfigWindow(QWidget *parent) override; diff --git a/src/plugins/simulator/flightgearconfig/simulatorflightgearconfigwindow.cpp b/src/plugins/simulator/flightgearconfig/simulatorflightgearconfigwindow.cpp index 6c297c8a39..fa1f424c9e 100644 --- a/src/plugins/simulator/flightgearconfig/simulatorflightgearconfigwindow.cpp +++ b/src/plugins/simulator/flightgearconfig/simulatorflightgearconfigwindow.cpp @@ -32,7 +32,7 @@ namespace swift::simplugin::flightgear connect(ui->bb_OkCancel, &QDialogButtonBox::rejected, this, &CSimulatorFlightgearConfigWindow::close); } - CSimulatorFlightgearConfigWindow::~CSimulatorFlightgearConfigWindow() {} + CSimulatorFlightgearConfigWindow::~CSimulatorFlightgearConfigWindow() = default; CFGSwiftBusSettings CSimulatorFlightgearConfigWindow::getSettingsFromUI() const { diff --git a/src/plugins/simulator/flightgearconfig/simulatorflightgearconfigwindow.h b/src/plugins/simulator/flightgearconfig/simulatorflightgearconfigwindow.h index 762904da18..9f9233f4e7 100644 --- a/src/plugins/simulator/flightgearconfig/simulatorflightgearconfigwindow.h +++ b/src/plugins/simulator/flightgearconfig/simulatorflightgearconfigwindow.h @@ -32,7 +32,7 @@ namespace swift::simplugin::flightgear CSimulatorFlightgearConfigWindow(QWidget *parent); //! Dtor. - virtual ~CSimulatorFlightgearConfigWindow(); + ~CSimulatorFlightgearConfigWindow() override; private: //! Settings have been accepted diff --git a/src/plugins/simulator/plugincommon/simulatorplugincommon.h b/src/plugins/simulator/plugincommon/simulatorplugincommon.h index 613a8e7e5a..a5d2a08112 100644 --- a/src/plugins/simulator/plugincommon/simulatorplugincommon.h +++ b/src/plugins/simulator/plugincommon/simulatorplugincommon.h @@ -28,11 +28,11 @@ namespace swift::simplugin::common public: //! Destructor - virtual ~CSimulatorPluginCommon() override; + ~CSimulatorPluginCommon() override; // --------- ISimulator implementations ------------ - virtual void unload() override; - virtual bool disconnectFrom() override; + void unload() override; + bool disconnectFrom() override; protected: //! Constructor @@ -45,7 +45,7 @@ namespace swift::simplugin::common //!
         //! .drv intdisplay interpolation log display
         //! 
- virtual bool parseDetails(const swift::misc::CSimpleCommandParser &parser) override; + bool parseDetails(const swift::misc::CSimpleCommandParser &parser) override; //! Register help static void registerHelp(); diff --git a/src/plugins/simulator/xplane/simulatorxplane.h b/src/plugins/simulator/xplane/simulatorxplane.h index 4725dc5f9b..4403c33c14 100644 --- a/src/plugins/simulator/xplane/simulatorxplane.h +++ b/src/plugins/simulator/xplane/simulatorxplane.h @@ -123,49 +123,48 @@ namespace swift::simplugin::xplane swift::misc::network::IClientProvider *clientProvider, QObject *parent = nullptr); //! Dtor - virtual ~CSimulatorXPlane() override; + ~CSimulatorXPlane() override; //! \name ISimulator implementations //! @{ - virtual bool connectTo() override; - virtual bool disconnectFrom() override; - virtual bool updateOwnSimulatorCockpit(const swift::misc::simulation::CSimulatedAircraft &aircraft, - const swift::misc::CIdentifier &originator) override; - virtual bool updateOwnSimulatorSelcal(const swift::misc::aviation::CSelcal &selcal, - const swift::misc::CIdentifier &originator) override; - virtual void displayStatusMessage(const swift::misc::CStatusMessage &message) const override; - virtual void displayTextMessage(const swift::misc::network::CTextMessage &message) const override; - virtual bool isPhysicallyRenderedAircraft(const swift::misc::aviation::CCallsign &callsign) const override; - virtual swift::misc::aviation::CCallsignSet physicallyRenderedAircraft() const override; - virtual bool followAircraft(const swift::misc::aviation::CCallsign &callsign) override; - virtual void unload() override; - virtual QString getStatisticsSimulatorSpecific() const override; - virtual void resetAircraftStatistics() override; - virtual swift::misc::CStatusMessageList + bool connectTo() override; + bool disconnectFrom() override; + bool updateOwnSimulatorCockpit(const swift::misc::simulation::CSimulatedAircraft &aircraft, + const swift::misc::CIdentifier &originator) override; + bool updateOwnSimulatorSelcal(const swift::misc::aviation::CSelcal &selcal, + const swift::misc::CIdentifier &originator) override; + void displayStatusMessage(const swift::misc::CStatusMessage &message) const override; + void displayTextMessage(const swift::misc::network::CTextMessage &message) const override; + bool isPhysicallyRenderedAircraft(const swift::misc::aviation::CCallsign &callsign) const override; + swift::misc::aviation::CCallsignSet physicallyRenderedAircraft() const override; + bool followAircraft(const swift::misc::aviation::CCallsign &callsign) override; + void unload() override; + QString getStatisticsSimulatorSpecific() const override; + void resetAircraftStatistics() override; + swift::misc::CStatusMessageList getInterpolationMessages(const swift::misc::aviation::CCallsign &callsign) const override; - virtual bool testSendSituationAndParts(const swift::misc::aviation::CCallsign &callsign, - const swift::misc::aviation::CAircraftSituation &situation, - const swift::misc::aviation::CAircraftParts &parts) override; - virtual void callbackReceivedRequestedElevation(const swift::misc::geo::CElevationPlane &plane, - const swift::misc::aviation::CCallsign &callsign, - bool isWater) override; - virtual void setFlightNetworkConnected(bool connected) override; + bool testSendSituationAndParts(const swift::misc::aviation::CCallsign &callsign, + const swift::misc::aviation::CAircraftSituation &situation, + const swift::misc::aviation::CAircraftParts &parts) override; + void callbackReceivedRequestedElevation(const swift::misc::geo::CElevationPlane &plane, + const swift::misc::aviation::CCallsign &callsign, + bool isWater) override; + void setFlightNetworkConnected(bool connected) override; //! @} //! \copydoc swift::misc::simulation::ISimulationEnvironmentProvider::requestElevation - virtual bool requestElevation(const swift::misc::geo::ICoordinateGeodetic &reference, - const swift::misc::aviation::CCallsign &callsign) override; + bool requestElevation(const swift::misc::geo::ICoordinateGeodetic &reference, + const swift::misc::aviation::CCallsign &callsign) override; protected: //! \name ISimulator implementations //! @{ - virtual bool isConnected() const override; - virtual bool - physicallyAddRemoteAircraft(const swift::misc::simulation::CSimulatedAircraft &newRemoteAircraft) override; - virtual bool physicallyRemoveRemoteAircraft(const swift::misc::aviation::CCallsign &callsign) override; - virtual int physicallyRemoveAllRemoteAircraft() override; - virtual void clearAllRemoteAircraftData() override; - virtual bool isPaused() const override + bool isConnected() const override; + bool physicallyAddRemoteAircraft(const swift::misc::simulation::CSimulatedAircraft &newRemoteAircraft) override; + bool physicallyRemoveRemoteAircraft(const swift::misc::aviation::CCallsign &callsign) override; + int physicallyRemoveAllRemoteAircraft() override; + void clearAllRemoteAircraftData() override; + bool isPaused() const override { //! \todo XP: provide correct pause state return false; @@ -307,13 +306,13 @@ namespace swift::simplugin::xplane protected: //! \copydoc swift::core::ISimulatorListener::startImpl - virtual void startImpl() override; + void startImpl() override; //! \copydoc swift::core::ISimulatorListener::stopImpl - virtual void stopImpl() override; + void stopImpl() override; //! \copydoc swift::core::ISimulatorListener::checkImpl - virtual void checkImpl() override; + void checkImpl() override; private: void checkConnection(); @@ -341,14 +340,13 @@ namespace swift::simplugin::xplane public: //! \copydoc swift::core::ISimulatorFactory::create - virtual swift::core::ISimulator * - create(const swift::misc::simulation::CSimulatorPluginInfo &info, - swift::misc::simulation::IOwnAircraftProvider *ownAircraftProvider, - swift::misc::simulation::IRemoteAircraftProvider *remoteAircraftProvider, - swift::misc::network::IClientProvider *clientProvider) override; + swift::core::ISimulator *create(const swift::misc::simulation::CSimulatorPluginInfo &info, + swift::misc::simulation::IOwnAircraftProvider *ownAircraftProvider, + swift::misc::simulation::IRemoteAircraftProvider *remoteAircraftProvider, + swift::misc::network::IClientProvider *clientProvider) override; //! \copydoc swift::core::ISimulatorFactory::createListener - virtual swift::core::ISimulatorListener * + swift::core::ISimulatorListener * createListener(const swift::misc::simulation::CSimulatorPluginInfo &info) override { return new CSimulatorXPlaneListener(info); diff --git a/src/plugins/simulator/xplane/xplanempaircraft.cpp b/src/plugins/simulator/xplane/xplanempaircraft.cpp index f42bccde34..dd3381a523 100644 --- a/src/plugins/simulator/xplane/xplanempaircraft.cpp +++ b/src/plugins/simulator/xplane/xplanempaircraft.cpp @@ -13,8 +13,6 @@ using namespace swift::misc::simulation; namespace swift::simplugin::xplane { - CXPlaneMPAircraft::CXPlaneMPAircraft() {} - CXPlaneMPAircraft::CXPlaneMPAircraft(const CSimulatedAircraft &aircraft, ISimulator *simulator, CInterpolationLogger *logger) : m_aircraft(aircraft), diff --git a/src/plugins/simulator/xplane/xplanempaircraft.h b/src/plugins/simulator/xplane/xplanempaircraft.h index 7c676998bc..339e05f83e 100644 --- a/src/plugins/simulator/xplane/xplanempaircraft.h +++ b/src/plugins/simulator/xplane/xplanempaircraft.h @@ -23,14 +23,14 @@ namespace swift::simplugin::xplane { public: //! Constructor - CXPlaneMPAircraft(); + CXPlaneMPAircraft() = default; //! Constructor providing initial situation/parts CXPlaneMPAircraft(const swift::misc::simulation::CSimulatedAircraft &aircraft, swift::core::ISimulator *simulator, swift::misc::simulation::CInterpolationLogger *logger); //! Destructor - ~CXPlaneMPAircraft() {} + ~CXPlaneMPAircraft() = default; //! Set simulated aircraft void setSimulatedAircraft(const swift::misc::simulation::CSimulatedAircraft &simulatedAircraft); diff --git a/src/plugins/simulator/xplaneconfig/simulatorxplaneconfig.h b/src/plugins/simulator/xplaneconfig/simulatorxplaneconfig.h index b46a3c3bdc..1456ed7aac 100644 --- a/src/plugins/simulator/xplaneconfig/simulatorxplaneconfig.h +++ b/src/plugins/simulator/xplaneconfig/simulatorxplaneconfig.h @@ -34,7 +34,7 @@ namespace swift::simplugin::xplane CSimulatorXPlaneConfig(QObject *parent = nullptr); //! Dtor - virtual ~CSimulatorXPlaneConfig() override {} + ~CSimulatorXPlaneConfig() override = default; //! \copydoc swift::gui::IPluginConfig::createConfigWindow() swift::gui::CPluginConfigWindow *createConfigWindow(QWidget *parent) override; diff --git a/src/plugins/simulator/xplaneconfig/simulatorxplaneconfigwindow.cpp b/src/plugins/simulator/xplaneconfig/simulatorxplaneconfigwindow.cpp index d2e969abc6..91b3dc01dc 100644 --- a/src/plugins/simulator/xplaneconfig/simulatorxplaneconfigwindow.cpp +++ b/src/plugins/simulator/xplaneconfig/simulatorxplaneconfigwindow.cpp @@ -42,7 +42,7 @@ namespace swift::simplugin::xplane connect(ui->bb_OkCancel, &QDialogButtonBox::rejected, this, &CSimulatorXPlaneConfigWindow::close); } - CSimulatorXPlaneConfigWindow::~CSimulatorXPlaneConfigWindow() {} + CSimulatorXPlaneConfigWindow::~CSimulatorXPlaneConfigWindow() = default; void CSimulatorXPlaneConfigWindow::onSettingsAccepted() { diff --git a/src/plugins/simulator/xplaneconfig/simulatorxplaneconfigwindow.h b/src/plugins/simulator/xplaneconfig/simulatorxplaneconfigwindow.h index 051462274f..0dedde9b8b 100644 --- a/src/plugins/simulator/xplaneconfig/simulatorxplaneconfigwindow.h +++ b/src/plugins/simulator/xplaneconfig/simulatorxplaneconfigwindow.h @@ -32,7 +32,7 @@ namespace swift::simplugin::xplane CSimulatorXPlaneConfigWindow(QWidget *parent); //! Dtor. - virtual ~CSimulatorXPlaneConfigWindow() override; + ~CSimulatorXPlaneConfigWindow() override; private: //! Settings from UI diff --git a/src/sound/notificationplayer.h b/src/sound/notificationplayer.h index bac7adaade..3ff597be28 100644 --- a/src/sound/notificationplayer.h +++ b/src/sound/notificationplayer.h @@ -26,7 +26,7 @@ namespace swift::sound CNotificationPlayer(QObject *parent = nullptr); //! Destructor - virtual ~CNotificationPlayer() override {} + ~CNotificationPlayer() override = default; //! Play notification sound void play(swift::misc::audio::CNotificationSounds::NotificationFlag notification, int volume = 100); diff --git a/src/sound/sampleprovider/bufferedwaveprovider.h b/src/sound/sampleprovider/bufferedwaveprovider.h index fec0174f6c..2049c36470 100644 --- a/src/sound/sampleprovider/bufferedwaveprovider.h +++ b/src/sound/sampleprovider/bufferedwaveprovider.h @@ -28,7 +28,7 @@ namespace swift::sound::sample_provider void addSamples(const QVector &samples); //! ISampleProvider::readSamples - virtual int readSamples(QVector &samples, qint64 count) override; + int readSamples(QVector &samples, qint64 count) override; //! Bytes from buffer int getBufferedBytes() const { return m_audioBuffer.size(); } diff --git a/src/sound/sampleprovider/equalizersampleprovider.h b/src/sound/sampleprovider/equalizersampleprovider.h index 721494d7fd..007416de9e 100644 --- a/src/sound/sampleprovider/equalizersampleprovider.h +++ b/src/sound/sampleprovider/equalizersampleprovider.h @@ -31,7 +31,7 @@ namespace swift::sound::sample_provider CEqualizerSampleProvider(ISampleProvider *sourceProvider, EqualizerPresets preset, QObject *parent = nullptr); //! \copydoc ISampleProvider::readSamples - virtual int readSamples(QVector &samples, qint64 count) override; + int readSamples(QVector &samples, qint64 count) override; //! Bypassing? void setBypassEffects(bool value) { m_bypass = value; } diff --git a/src/sound/sampleprovider/mixingsampleprovider.h b/src/sound/sampleprovider/mixingsampleprovider.h index 6eea28721c..54b1bfb51c 100644 --- a/src/sound/sampleprovider/mixingsampleprovider.h +++ b/src/sound/sampleprovider/mixingsampleprovider.h @@ -25,7 +25,7 @@ namespace swift::sound::sample_provider void addMixerInput(ISampleProvider *provider); //! \copydoc ISampleProvider::readSamples - virtual int readSamples(QVector &samples, qint64 count) override; + int readSamples(QVector &samples, qint64 count) override; private: QVector m_sources; diff --git a/src/sound/sampleprovider/pinknoisegenerator.h b/src/sound/sampleprovider/pinknoisegenerator.h index 380940315b..84cc5b1059 100644 --- a/src/sound/sampleprovider/pinknoisegenerator.h +++ b/src/sound/sampleprovider/pinknoisegenerator.h @@ -26,7 +26,7 @@ namespace swift::sound::sample_provider CPinkNoiseGenerator(QObject *parent = nullptr) : ISampleProvider(parent) {} //! Read samples - virtual int readSamples(QVector &samples, qint64 count) override; + int readSamples(QVector &samples, qint64 count) override; //! Gain void setGain(double gain) { m_gain = gain; } diff --git a/src/sound/sampleprovider/resourcesoundsampleprovider.h b/src/sound/sampleprovider/resourcesoundsampleprovider.h index c61958c578..138ad423c0 100644 --- a/src/sound/sampleprovider/resourcesoundsampleprovider.h +++ b/src/sound/sampleprovider/resourcesoundsampleprovider.h @@ -20,10 +20,10 @@ namespace swift::sound::sample_provider CResourceSoundSampleProvider(const CResourceSound &resourceSound, QObject *parent = nullptr); //! copydoc ISampleProvider::readSamples - virtual int readSamples(QVector &samples, qint64 count) override; + int readSamples(QVector &samples, qint64 count) override; //! copydoc ISampleProvider::isFinished - virtual bool isFinished() const override { return m_isFinished; } + bool isFinished() const override { return m_isFinished; } //! @{ //! Looping diff --git a/src/sound/sampleprovider/sampleprovider.h b/src/sound/sampleprovider/sampleprovider.h index 3cdad10155..e5f75cf25f 100644 --- a/src/sound/sampleprovider/sampleprovider.h +++ b/src/sound/sampleprovider/sampleprovider.h @@ -24,7 +24,7 @@ namespace swift::sound::sample_provider ISampleProvider(QObject *parent = nullptr) : QObject(parent) {} //! Dtor - virtual ~ISampleProvider() override {} + ~ISampleProvider() override = default; //! Read samples virtual int readSamples(QVector &samples, qint64 count) = 0; diff --git a/src/sound/sampleprovider/sawtoothgenerator.h b/src/sound/sampleprovider/sawtoothgenerator.h index b29e9a0476..de90607b58 100644 --- a/src/sound/sampleprovider/sawtoothgenerator.h +++ b/src/sound/sampleprovider/sawtoothgenerator.h @@ -26,7 +26,7 @@ namespace swift::sound::sample_provider CSawToothGenerator(double frequency, QObject *parent = nullptr); //! \copydoc ISampleProvider::readSamples - virtual int readSamples(QVector &samples, qint64 count) override; + int readSamples(QVector &samples, qint64 count) override; //! Set the gain void setGain(double gain) { m_gain = gain; } diff --git a/src/sound/sampleprovider/simplecompressoreffect.h b/src/sound/sampleprovider/simplecompressoreffect.h index f84dd55caa..59b7d0d3e0 100644 --- a/src/sound/sampleprovider/simplecompressoreffect.h +++ b/src/sound/sampleprovider/simplecompressoreffect.h @@ -26,7 +26,7 @@ namespace swift::sound::sample_provider CSimpleCompressorEffect(ISampleProvider *source, QObject *parent = nullptr); //! \copydoc ISampleProvider::readSamples - virtual int readSamples(QVector &samples, qint64 count) override; + int readSamples(QVector &samples, qint64 count) override; //! Enable void setEnabled(bool enabled); diff --git a/src/sound/sampleprovider/sinusgenerator.h b/src/sound/sampleprovider/sinusgenerator.h index e760026062..0be09561d0 100644 --- a/src/sound/sampleprovider/sinusgenerator.h +++ b/src/sound/sampleprovider/sinusgenerator.h @@ -23,7 +23,7 @@ namespace swift::sound::sample_provider CSinusGenerator(double frequencyHz, QObject *parent = nullptr); //! \copydoc ISampleProvider::readSamples - virtual int readSamples(QVector &samples, qint64 count) override; + int readSamples(QVector &samples, qint64 count) override; //! Set the gain void setGain(double gain) { m_gain = gain; } diff --git a/src/sound/sampleprovider/volumesampleprovider.h b/src/sound/sampleprovider/volumesampleprovider.h index 6ca19f2289..80288f1170 100644 --- a/src/sound/sampleprovider/volumesampleprovider.h +++ b/src/sound/sampleprovider/volumesampleprovider.h @@ -21,7 +21,7 @@ namespace swift::sound::sample_provider CVolumeSampleProvider(ISampleProvider *sourceProvider, QObject *parent = nullptr); //! \copydoc ISampleProvider::readSamples - virtual int readSamples(QVector &samples, qint64 count) override; + int readSamples(QVector &samples, qint64 count) override; //! @{ //! Gain ratio, value a amplitude need to be multiplied with diff --git a/src/sound/selcalplayer.h b/src/sound/selcalplayer.h index 965a364008..a6b30fe131 100644 --- a/src/sound/selcalplayer.h +++ b/src/sound/selcalplayer.h @@ -27,7 +27,7 @@ namespace swift::sound CSelcalPlayer(const swift::misc::audio::CAudioDeviceInfo &device, QObject *parent = nullptr); //! Destructor - virtual ~CSelcalPlayer() override; + ~CSelcalPlayer() override; //! Stop the player thread void gracefulShutdown(); diff --git a/src/sound/threadedtonepairplayer.h b/src/sound/threadedtonepairplayer.h index b941167f2b..8ec4a8765f 100644 --- a/src/sound/threadedtonepairplayer.h +++ b/src/sound/threadedtonepairplayer.h @@ -34,7 +34,7 @@ namespace swift::sound const swift::misc::audio::CAudioDeviceInfo &device); //! Destructor - virtual ~CThreadedTonePairPlayer() override = default; + ~CThreadedTonePairPlayer() override = default; //! Play the list of tones. //! If the player is currently active, this call will be ignored. @@ -48,10 +48,10 @@ namespace swift::sound protected: //! \copydoc swift::misc::CContinuousWorker::initialize - virtual void initialize() override; + void initialize() override; //! \copydoc swift::misc::CContinuousWorker::beforeQuit - virtual void beforeQuit() noexcept override; + void beforeQuit() noexcept override; private: void handleStateChanged(QAudio::State newState); diff --git a/src/swiftcore/swiftcore.cpp b/src/swiftcore/swiftcore.cpp index a9f9e1fb98..bd80fec1a6 100644 --- a/src/swiftcore/swiftcore.cpp +++ b/src/swiftcore/swiftcore.cpp @@ -72,7 +72,7 @@ CSwiftCore::CSwiftCore(QWidget *parent) &CCoreFacade::parseCommandLine); } -CSwiftCore::~CSwiftCore() {} +CSwiftCore::~CSwiftCore() = default; void CSwiftCore::initStyleSheet() { diff --git a/src/swiftcore/swiftcore.h b/src/swiftcore/swiftcore.h index 02089f2d88..37960aa20a 100644 --- a/src/swiftcore/swiftcore.h +++ b/src/swiftcore/swiftcore.h @@ -45,7 +45,7 @@ class CSwiftCore : CSwiftCore(QWidget *parent = nullptr); //! Destructor - virtual ~CSwiftCore() override; + ~CSwiftCore() override; private: //! @{ diff --git a/src/swiftdata/swiftdata.cpp b/src/swiftdata/swiftdata.cpp index f5d55cab67..e399f40424 100644 --- a/src/swiftdata/swiftdata.cpp +++ b/src/swiftdata/swiftdata.cpp @@ -59,7 +59,7 @@ void CSwiftData::initStyleSheet() this->setStyleSheet(s); } -CSwiftData::~CSwiftData() {} +CSwiftData::~CSwiftData() = default; void CSwiftData::closeEvent(QCloseEvent *event) { diff --git a/src/swiftdata/swiftdata.h b/src/swiftdata/swiftdata.h index 4989e913dd..2b278cb5c2 100644 --- a/src/swiftdata/swiftdata.h +++ b/src/swiftdata/swiftdata.h @@ -44,14 +44,14 @@ class CSwiftData : public QMainWindow, public swift::misc::CIdentifiable, public CSwiftData(QWidget *parent = nullptr); //! Destructor - virtual ~CSwiftData() override; + ~CSwiftData() override; protected: //! \name QMainWindow events //! @{ //! \copydoc QMainWindow::closeEvent - virtual void closeEvent(QCloseEvent *event) override; + void closeEvent(QCloseEvent *event) override; //! @} private: diff --git a/src/swiftguistandard/swiftguistd.cpp b/src/swiftguistandard/swiftguistd.cpp index 78a0781b3e..ff4442190f 100644 --- a/src/swiftguistandard/swiftguistd.cpp +++ b/src/swiftguistandard/swiftguistd.cpp @@ -86,7 +86,7 @@ SwiftGuiStd::SwiftGuiStd(swift::gui::CEnableForFramelessWindow::WindowMode windo this->init(); } -SwiftGuiStd::~SwiftGuiStd() {} +SwiftGuiStd::~SwiftGuiStd() = default; void SwiftGuiStd::mouseMoveEvent(QMouseEvent *event) { diff --git a/src/swiftguistandard/swiftguistd.h b/src/swiftguistandard/swiftguistd.h index 659a3d0e31..6220cf9af1 100644 --- a/src/swiftguistandard/swiftguistd.h +++ b/src/swiftguistandard/swiftguistd.h @@ -79,7 +79,7 @@ class SwiftGuiStd : SwiftGuiStd(WindowMode windowMode, QWidget *parent = nullptr); //! Destructor - virtual ~SwiftGuiStd() override; + ~SwiftGuiStd() override; signals: //! Main info area has changed @@ -91,19 +91,19 @@ class SwiftGuiStd : //! @{ //! \copydoc QMainWindow::mouseMoveEvent - virtual void mouseMoveEvent(QMouseEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; //! \copydoc QMainWindow::mousePressEvent - virtual void mousePressEvent(QMouseEvent *event) override; + void mousePressEvent(QMouseEvent *event) override; //! \copydoc QMainWindow::mouseReleaseEvent - virtual void mouseReleaseEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; //! \copydoc QMainWindow::closeEvent - virtual void closeEvent(QCloseEvent *event) override; + void closeEvent(QCloseEvent *event) override; //! \copydoc QMainWindow::changeEvent - virtual void changeEvent(QEvent *event) override; + void changeEvent(QEvent *event) override; //! @} //! Get a minimize action which minimizes the window diff --git a/src/swiftguistandard/swiftguistdapplication.h b/src/swiftguistandard/swiftguistdapplication.h index 047e106238..9a5f6ae364 100644 --- a/src/swiftguistandard/swiftguistdapplication.h +++ b/src/swiftguistandard/swiftguistdapplication.h @@ -31,10 +31,10 @@ class CSwiftGuiStdApplication : public swift::gui::CGuiApplication protected: //! Parsing of special CMD args - virtual bool parsingHookIn() override; + bool parsingHookIn() override; //! Start facade by cmd arguments - virtual swift::misc::CStatusMessageList startHookIn() override; + swift::misc::CStatusMessageList startHookIn() override; private: static swift::core::CCoreFacadeConfig coreModeToCoreFacadeConfig(swift::core::CoreModes::CoreMode, diff --git a/src/swiftlauncher/swiftlauncher.h b/src/swiftlauncher/swiftlauncher.h index 4ad08b49b7..025dc7e3b3 100644 --- a/src/swiftlauncher/swiftlauncher.h +++ b/src/swiftlauncher/swiftlauncher.h @@ -87,9 +87,9 @@ class CSwiftLauncher : protected: //! Mouse events for frameless window //! @{ - virtual void mousePressEvent(QMouseEvent *event) override; - virtual void mouseMoveEvent(QMouseEvent *event) override; - virtual void mouseReleaseEvent(QMouseEvent *event) override; + void mousePressEvent(QMouseEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; //! @} private slots: diff --git a/src/xswiftbus/service.cpp b/src/xswiftbus/service.cpp index ec810ab8ac..f3f0ea152a 100644 --- a/src/xswiftbus/service.cpp +++ b/src/xswiftbus/service.cpp @@ -95,6 +95,7 @@ namespace XSwiftBus m_framePeriodSampler->show(); } + // Explicitly in cpp file to allow use of forward declaration CService::~CService() = default; void CService::onAircraftModelChanged() diff --git a/tests/core/fsd/testfsdclient/testfsdclient.cpp b/tests/core/fsd/testfsdclient/testfsdclient.cpp index 35cf4d4ccb..182cbcf1d5 100644 --- a/tests/core/fsd/testfsdclient/testfsdclient.cpp +++ b/tests/core/fsd/testfsdclient/testfsdclient.cpp @@ -46,7 +46,7 @@ namespace SwiftFsdTest explicit CTestFSDClient(QObject *parent = nullptr) : QObject(parent) {} //! Destructor - virtual ~CTestFSDClient() {} + ~CTestFSDClient() override = default; private slots: void initTestCase(); diff --git a/tests/core/fsd/testfsdmessages/testfsdmessages.cpp b/tests/core/fsd/testfsdmessages/testfsdmessages.cpp index 28db8be8d0..ae043cfce5 100644 --- a/tests/core/fsd/testfsdmessages/testfsdmessages.cpp +++ b/tests/core/fsd/testfsdmessages/testfsdmessages.cpp @@ -61,7 +61,7 @@ namespace MiscTest explicit CTestFsdMessages(QObject *parent = nullptr) : QObject(parent) {} //! Destructor - virtual ~CTestFsdMessages() {} + ~CTestFsdMessages() override = default; private slots: void testAddAtc(); diff --git a/tests/misc/testcompress/testcompress.cpp b/tests/misc/testcompress/testcompress.cpp index dd975dd71f..c67f3d55a6 100644 --- a/tests/misc/testcompress/testcompress.cpp +++ b/tests/misc/testcompress/testcompress.cpp @@ -36,7 +36,7 @@ namespace MiscTest explicit CTestCompress(QObject *parent = nullptr) : QObject(parent) {} //! Destructor - virtual ~CTestCompress() {} + ~CTestCompress() override = default; private slots: //! Uncompress file diff --git a/tests/misc/testsharedstate/testsharedstate.h b/tests/misc/testsharedstate/testsharedstate.h index 6a40b20a06..c9c89825e2 100644 --- a/tests/misc/testsharedstate/testsharedstate.h +++ b/tests/misc/testsharedstate/testsharedstate.h @@ -71,7 +71,7 @@ namespace MiscTest public: //! Ctor CTestScalarObserver(QObject *parent) : CScalarObserver(parent) {} - virtual void onValueChanged(const int &) override {} + void onValueChanged(const int &) override {} }; //! List mutator subclass @@ -107,10 +107,10 @@ namespace MiscTest //! @{ //! \copydoc swift::misc::shared_state::CListObserver::onElementAdded - virtual void onElementAdded(const int &) override {} + void onElementAdded(const int &) override {} //! \copydoc swift::misc::shared_state::CListObserver::onElementsReplaced - virtual void onElementsReplaced(const QList &) override {} + void onElementsReplaced(const QList &) override {} //! @} }; } // namespace MiscTest diff --git a/tests/misc/testvalueobject.h b/tests/misc/testvalueobject.h index ac84aed429..0f089e9179 100644 --- a/tests/misc/testvalueobject.h +++ b/tests/misc/testvalueobject.h @@ -41,7 +41,7 @@ namespace swift::misc }; //! Default constructor. - CTestValueObject() {} + CTestValueObject() = default; //! Constructor. CTestValueObject(const QString &name, const QString &description) : m_name(name), m_description(description) {} From e09413614a1bc1375d0c24a0f8b3b80a2f7a010b Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Fri, 10 Oct 2025 23:43:20 +0200 Subject: [PATCH 09/21] refactor: Fix clang-tidy modernize-return-braced-init-list --- .clang-tidy | 1 + src/core/afv/crypto/cryptodtoserializer.cpp | 2 +- src/core/afv/model/atcstationmodel.cpp | 4 +- src/core/aircraftmatcher.cpp | 60 +++++++++---------- src/core/application.cpp | 14 ++--- src/core/application.h | 2 +- src/core/context/contextapplicationempty.h | 18 +++--- src/core/context/contextnetworkempty.h | 38 ++++++------ src/core/context/contextnetworkimpl.cpp | 11 ++-- src/core/context/contextownaircraftempty.h | 8 +-- src/core/context/contextsimulatorempty.h | 38 ++++++------ src/core/context/contextsimulatorimpl.cpp | 19 +++--- src/core/corefacade.cpp | 16 ++--- src/core/db/databasereader.cpp | 4 +- src/core/db/databasereaderconfig.cpp | 2 +- src/core/db/databaseutils.cpp | 10 ++-- src/core/db/icaodatareader.cpp | 2 +- src/core/db/infodatareader.cpp | 4 +- src/core/db/modeldatareader.cpp | 24 ++++---- src/core/fsd/addatc.cpp | 2 +- src/core/fsd/authchallenge.cpp | 2 +- src/core/fsd/authresponse.cpp | 2 +- src/core/fsd/clientquery.cpp | 2 +- src/core/fsd/clientresponse.cpp | 2 +- src/core/fsd/deleteatc.cpp | 2 +- src/core/fsd/euroscopesimdata.cpp | 19 ++++-- src/core/fsd/flightplan.cpp | 10 ++-- src/core/fsd/fsdidentification.cpp | 2 +- src/core/fsd/interimpilotdataupdate.cpp | 12 +++- src/core/fsd/killrequest.cpp | 2 +- src/core/fsd/mute.cpp | 2 +- src/core/fsd/pilotdataupdate.cpp | 17 ++++-- src/core/fsd/ping.cpp | 2 +- src/core/fsd/planeinforequest.cpp | 2 +- src/core/fsd/planeinforequestfsinn.cpp | 2 +- src/core/fsd/planeinformation.cpp | 2 +- src/core/fsd/planeinformationfsinn.cpp | 2 +- src/core/fsd/pong.cpp | 2 +- src/core/fsd/rehost.cpp | 2 +- src/core/fsd/revbclientparts.cpp | 2 +- src/core/fsd/servererror.cpp | 2 +- src/core/fsd/textmessage.cpp | 2 +- src/core/fsd/visualpilotdataperiodic.cpp | 25 +++++--- src/core/fsd/visualpilotdatastopped.cpp | 16 +++-- src/core/fsd/visualpilotdatatoggle.cpp | 2 +- src/core/fsd/visualpilotdataupdate.cpp | 29 ++++++--- src/core/modelsetbuilder.cpp | 2 +- src/core/threadedreader.cpp | 2 +- src/core/vatsim/vatsimdatafilereader.cpp | 6 +- src/core/vatsim/vatsimserverfilereader.cpp | 12 +++- src/gui/components/airportsmallcompleter.cpp | 2 +- .../audiodevicevolumesetupcomponent.cpp | 4 +- src/gui/components/callsigncompleter.cpp | 4 +- src/gui/components/cockpitcomcomponent.cpp | 2 +- .../components/cockpitinfoareacomponent.cpp | 2 +- .../cockpittranspondermodeledscomponent.cpp | 4 +- src/gui/components/coreinfoareacomponent.cpp | 4 +- src/gui/components/datainfoareacomponent.cpp | 2 +- .../components/datamaininfoareacomponent.cpp | 2 +- .../dbaircrafticaoselectorcomponent.cpp | 4 +- .../components/dbautostashingcomponent.cpp | 2 +- .../components/dbcountryselectorcomponent.cpp | 4 +- .../dbdistributorselectorcomponent.cpp | 4 +- .../components/dbliveryselectorcomponent.cpp | 2 +- src/gui/components/dbmappingcomponent.cpp | 6 +- src/gui/components/dbownmodelsetcomponent.cpp | 20 +++---- src/gui/components/dbstashcomponent.cpp | 13 ++-- src/gui/components/flightplancomponent.cpp | 2 +- src/gui/components/maininfoareacomponent.cpp | 6 +- src/gui/components/mappingcomponent.cpp | 4 +- .../components/networkdetailscomponent.cpp | 2 +- src/gui/components/serverlistselector.cpp | 2 +- .../settingssimulatorbasicscomponent.cpp | 2 +- src/gui/components/simbriefdownloaddialog.cpp | 2 +- src/gui/components/simulatorselector.cpp | 14 ++--- src/gui/components/textmessagecomponent.cpp | 2 +- src/gui/dockwidget.cpp | 2 +- src/gui/ecosystemcombobox.cpp | 2 +- src/gui/editors/form.cpp | 2 +- src/gui/editors/interpolationsetupform.cpp | 2 +- src/gui/editors/matchingform.cpp | 2 +- src/gui/editors/modelmappingform.cpp | 2 +- src/gui/editors/ownmodelsetform.cpp | 2 +- src/gui/editors/pbhsform.cpp | 10 ++-- src/gui/editors/situationform.cpp | 10 ++-- src/gui/guiutility.cpp | 24 ++++---- src/gui/loadindicator.cpp | 2 +- src/gui/menus/menuaction.cpp | 26 ++++---- src/gui/models/actionhotkeylistmodel.cpp | 4 +- src/gui/models/actionmodel.cpp | 4 +- src/gui/models/aircraftmodellistmodel.cpp | 4 +- src/gui/models/clientlistmodel.cpp | 4 +- src/gui/models/columnformatters.cpp | 22 +++---- src/gui/models/columns.cpp | 14 ++--- src/gui/models/listmodelbase.cpp | 2 +- src/gui/models/listmodelbasenontemplate.cpp | 14 ++--- src/gui/models/listmodelcallsignobjects.cpp | 2 +- src/gui/overlaymessagesframe.h | 2 +- src/gui/sharedstringlistcompleter.cpp | 2 +- src/gui/stylesheetutility.cpp | 2 +- src/gui/views/aircraftcategorytreeview.cpp | 2 +- src/gui/views/aircraftmodelview.cpp | 2 +- src/gui/views/atcstationtreeview.cpp | 2 +- src/gui/views/viewcallsignobjects.cpp | 2 +- src/misc/audio/audiodeviceinfolist.cpp | 4 +- src/misc/aviation/aircraftcategorylist.cpp | 2 +- src/misc/aviation/aircrafticaocode.cpp | 6 +- src/misc/aviation/aircrafticaocodelist.cpp | 29 ++++----- src/misc/aviation/aircraftsituation.cpp | 6 +- src/misc/aviation/aircraftsituationchange.h | 2 +- src/misc/aviation/aircraftsituationlist.cpp | 17 +++--- src/misc/aviation/airlineicaocode.cpp | 2 +- src/misc/aviation/airlineicaocodelist.cpp | 22 +++---- src/misc/aviation/airport.cpp | 4 +- src/misc/aviation/airportlist.cpp | 4 +- src/misc/aviation/atcstationlist.cpp | 4 +- src/misc/aviation/callsign.cpp | 8 +-- src/misc/aviation/callsignobjectlist.h | 2 +- src/misc/aviation/comsystem.cpp | 26 ++++---- src/misc/aviation/flightplan.cpp | 16 ++--- src/misc/aviation/livery.cpp | 4 +- src/misc/aviation/liverylist.cpp | 24 ++++---- src/misc/aviation/navsystem.h | 32 +++++----- src/misc/aviation/transponder.cpp | 2 +- src/misc/cachesettingsutils.cpp | 8 +-- src/misc/country.cpp | 6 +- src/misc/countrylist.cpp | 8 +-- src/misc/datacache.cpp | 2 +- src/misc/db/artifact.cpp | 4 +- src/misc/db/artifactlist.cpp | 4 +- src/misc/db/datastore.cpp | 10 ++-- src/misc/db/datastoreobjectlist.h | 4 +- src/misc/db/datastoreutility.cpp | 2 +- src/misc/db/dbinfo.cpp | 2 +- src/misc/db/dbinfolist.cpp | 2 +- src/misc/db/distributionlist.cpp | 2 +- src/misc/db/updateinfo.cpp | 8 +-- src/misc/dbusserver.cpp | 2 +- src/misc/directoryutils.cpp | 2 +- src/misc/fileutils.cpp | 4 +- src/misc/geo/coordinategeodetic.cpp | 8 +-- src/misc/geo/coordinategeodeticlist.cpp | 2 +- src/misc/icon.cpp | 2 +- src/misc/icons.cpp | 2 +- src/misc/imageutils.cpp | 8 +-- src/misc/input/keyboardkey.cpp | 2 +- src/misc/json.cpp | 4 +- src/misc/math/mathutils.cpp | 2 +- src/misc/namevariantpair.cpp | 4 +- src/misc/namevariantpairlist.cpp | 10 ++-- src/misc/network/client.cpp | 8 +-- src/misc/network/clientprovider.cpp | 8 +-- src/misc/network/networkutils.cpp | 6 +- src/misc/network/remotefilelist.cpp | 12 ++-- src/misc/network/url.cpp | 2 +- src/misc/network/urlloglist.cpp | 2 +- src/misc/network/user.cpp | 10 ++-- src/misc/network/voicecapabilities.cpp | 15 ++--- src/misc/obfuscation.cpp | 2 +- src/misc/propertyindex.cpp | 2 +- src/misc/propertyindexlist.cpp | 2 +- src/misc/rgbcolor.cpp | 2 +- src/misc/simulation/aircraftmodel.cpp | 24 ++++---- src/misc/simulation/aircraftmodellist.cpp | 44 +++++++------- src/misc/simulation/data/modelcaches.cpp | 16 ++--- src/misc/simulation/distributor.cpp | 2 +- src/misc/simulation/distributorlist.cpp | 12 ++-- .../simulation/fscommon/aircraftcfgparser.cpp | 10 ++-- .../interpolation/interpolationlogger.cpp | 16 ++--- .../interpolationsetupprovider.cpp | 11 ++-- .../interpolation/interpolatorlinearpbh.cpp | 3 +- .../interpolation/interpolatormulti.cpp | 2 +- src/misc/simulation/matchingscript.cpp | 10 ++-- .../simulation/remoteaircraftprovider.cpp | 8 +-- .../remoteaircraftproviderdummy.cpp | 5 +- .../simulation/settings/fgswiftbussettings.h | 2 +- .../simulation/settings/simulatorsettings.cpp | 8 +-- src/misc/simulation/simulatedaircraft.cpp | 2 +- .../simulationenvironmentprovider.cpp | 20 +++---- src/misc/simulation/simulatorinfo.cpp | 16 ++--- src/misc/simulation/simulatorinfolist.cpp | 4 +- .../simulation/simulatorplugininfolist.cpp | 2 +- src/misc/simulation/xplane/xplaneutil.cpp | 6 +- src/misc/statusmessagelist.cpp | 2 +- src/misc/swiftdirectories.cpp | 2 +- src/misc/timestampbased.cpp | 4 +- src/misc/timestampobjectlist.h | 6 +- src/misc/valuecache.cpp | 2 +- src/misc/variant.cpp | 2 +- .../simulator/emulated/simulatoremulated.cpp | 2 +- .../flightgear/flightgearmpaircraft.cpp | 2 +- .../flightgear/simulatorflightgear.cpp | 4 +- .../simulator/xplane/simulatorxplane.cpp | 6 +- .../simulator/xplane/xplanempaircraft.cpp | 2 +- .../swiftguistdapplication.cpp | 2 +- 195 files changed, 724 insertions(+), 690 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 73f03d9b27..c924a8f3e5 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -5,6 +5,7 @@ Checks: > -*, modernize-use-auto, modernize-use-override, + modernize-return-braced-init-list, CheckOptions: diff --git a/src/core/afv/crypto/cryptodtoserializer.cpp b/src/core/afv/crypto/cryptodtoserializer.cpp index b29f5a7b14..027ac3c315 100644 --- a/src/core/afv/crypto/cryptodtoserializer.cpp +++ b/src/core/afv/crypto/cryptodtoserializer.cpp @@ -8,7 +8,7 @@ namespace swift::core::afv::crypto CryptoDtoSerializer::Deserializer CryptoDtoSerializer::deserialize(CCryptoDtoChannel &channel, const QByteArray &bytes, bool loopback) { - return Deserializer(channel, bytes, loopback); + return { channel, bytes, loopback }; } CryptoDtoSerializer::Deserializer::Deserializer(CCryptoDtoChannel &channel, const QByteArray &bytes, bool loopback) diff --git a/src/core/afv/model/atcstationmodel.cpp b/src/core/afv/model/atcstationmodel.cpp index bb77a703f7..db07b11e77 100644 --- a/src/core/afv/model/atcstationmodel.cpp +++ b/src/core/afv/model/atcstationmodel.cpp @@ -71,7 +71,7 @@ namespace swift::core::afv::model QVariant CSampleAtcStationModel::data(const QModelIndex &index, int role) const { - if (index.row() < 0 || index.row() >= m_atcStations.count()) return QVariant(); + if (index.row() < 0 || index.row() >= m_atcStations.count()) return {}; const CSampleAtcStation &atcStation = m_atcStations[index.row()]; if (role == CallsignRole) return atcStation.callsign(); @@ -80,7 +80,7 @@ namespace swift::core::afv::model if (role == RadioDistanceRole) return atcStation.radioDistanceM(); if (role == FrequencyRole) return atcStation.formattedFrequency(); if (role == FrequencyKhzRole) return atcStation.frequency() / 1000; - return QVariant(); + return {}; } QHash CSampleAtcStationModel::roleNames() const diff --git a/src/core/aircraftmatcher.cpp b/src/core/aircraftmatcher.cpp index b83fd71a67..8d1163a91a 100644 --- a/src/core/aircraftmatcher.cpp +++ b/src/core/aircraftmatcher.cpp @@ -164,7 +164,7 @@ namespace swift::core if (models.isEmpty()) { CCallsign::addLogDetailsToList(log, callsign, QStringLiteral("No models to find airline from")); - return CAirlineIcaoCode(); + return {}; } static const QString info("Multiple models (%1) with airline ICAOs for '%2'"); @@ -641,7 +641,7 @@ namespace swift::core const CAircraftModelList &modelSet, CStatusMessageList *log) { - if (!setup.doRunMsReverseLookupScript()) { return MatchingScriptReturnValues(inModel); } + if (!setup.doRunMsReverseLookupScript()) { return { inModel }; } if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return inModel; } const QString js = CFileUtils::readFileToString(setup.getMsReverseLookupFile()); const MatchingScriptReturnValues rv = @@ -655,7 +655,7 @@ namespace swift::core const CAircraftModelList &modelSet, CStatusMessageList *log) { - if (!setup.doRunMsMatchingStageScript()) { return MatchingScriptReturnValues(inModel); } + if (!setup.doRunMsMatchingStageScript()) { return { inModel }; } if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return inModel; } const QString js = CFileUtils::readFileToString(setup.getMsMatchingStageFile()); const MatchingScriptReturnValues rv = @@ -874,7 +874,7 @@ namespace swift::core const CAircraftMatcherSetup &setup, const CAircraftModelList &modelSet, CStatusMessageList *log) { - if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return CAircraftModel(); } + if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return {}; } // already DB model? CAircraftModel model(modelToLookup); // copy @@ -1147,7 +1147,7 @@ namespace swift::core CAircraftModel CAircraftMatcher::reverseLookupModelStringInDB(const QString &modelString, const CCallsign &callsign, bool doLookupString, CStatusMessageList *log) { - if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return CAircraftModel(); } + if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return {}; } if (!doLookupString) { if (log) @@ -1156,7 +1156,7 @@ namespace swift::core log, callsign, QStringLiteral("Ignore model string in reverse lookup (disabled), ignoring '%1'").arg(modelString)); } - return CAircraftModel(); + return {}; } CAircraftModel model = sApp->getWebDataServices()->getModelForModelString(modelString); const bool isDBModel = model.hasValidDbKey(); @@ -1177,7 +1177,7 @@ namespace swift::core } } - if (!isDBModel) { return CAircraftModel(); } // not found + if (!isDBModel) { return {}; } // not found // found model.setCallsign(callsign); @@ -1190,7 +1190,7 @@ namespace swift::core const CAircraftModelList &modelSet, bool useNonDbEntries, CStatusMessageList *log) { - if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return CAircraftModel(); } + if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return {}; } if (modelString.isEmpty()) { if (log) @@ -1198,7 +1198,7 @@ namespace swift::core CCallsign::addLogDetailsToList( log, callsign, QStringLiteral("Empty model string for lookup in %1 models").arg(modelSet.size())); } - return CAircraftModel(); + return {}; } if (modelSet.isEmpty()) { @@ -1207,7 +1207,7 @@ namespace swift::core CCallsign::addLogDetailsToList(log, callsign, QStringLiteral("Empty models, ignoring '%1'").arg(modelString)); } - return CAircraftModel(); + return {}; } CAircraftModel model = modelSet.findFirstByModelStringOrDefault(modelString, Qt::CaseInsensitive); @@ -1219,7 +1219,7 @@ namespace swift::core log, callsign, QStringLiteral("Model '%1' not found in %2 models").arg(modelString).arg(modelSet.size())); } - return CAircraftModel(); + return {}; } const bool isDBModel = model.hasValidDbKey(); @@ -1241,7 +1241,7 @@ namespace swift::core } } - if (!isDBModel && !useNonDbEntries) { return CAircraftModel(); } // ignore DB entries + if (!isDBModel && !useNonDbEntries) { return {}; } // ignore DB entries // found model.setCallsign(callsign); @@ -1251,7 +1251,7 @@ namespace swift::core CAircraftModel CAircraftMatcher::reverseLookupModelId(int id, const CCallsign &callsign, CStatusMessageList *log) { - if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return CAircraftModel(); } + if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return {}; } CAircraftModel model = sApp->getWebDataServices()->getModelForDbKey(id); if (log) { @@ -1273,7 +1273,7 @@ namespace swift::core CAircraftIcaoCode CAircraftMatcher::reverseLookupAircraftIcao(const CAircraftIcaoCode &icaoCandidate, const CCallsign &logCallsign, CStatusMessageList *log) { - if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return CAircraftIcaoCode(); } + if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return {}; } const QString designator(icaoCandidate.getDesignator()); CAircraftIcaoCodeList foundIcaos = sApp->getWebDataServices()->getAircraftIcaoCodesForDesignator(designator); @@ -1321,7 +1321,7 @@ namespace swift::core CCallsign::addLogDetailsToList(log, logCallsign, QStringLiteral("No DB data for ICAO '%1', valid ICAO?").arg(designator), CAircraftMatcher::getLogCategories()); - return CAircraftIcaoCode(icaoCandidate); + return { icaoCandidate }; } } @@ -1330,7 +1330,7 @@ namespace swift::core CCallsign::addLogDetailsToList( log, logCallsign, QStringLiteral("Reverse lookup of aircraft ICAO '%1', nothing found").arg(designator), CAircraftMatcher::getLogCategories()); - return CAircraftIcaoCode(icaoCandidate); + return { icaoCandidate }; } else if (foundIcaos.size() == 1) { @@ -1377,7 +1377,7 @@ namespace swift::core CAircraftIcaoCode CAircraftMatcher::reverseLookupAircraftIcaoId(int id, const CCallsign &logCallsign, CStatusMessageList *log) { - if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return CAircraftIcaoCode(); } + if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return {}; } const CAircraftIcaoCode icao = sApp->getWebDataServices()->getAircraftIcaoCodeForDbKey(id); if (log) { @@ -1398,7 +1398,7 @@ namespace swift::core CAirlineIcaoCode CAircraftMatcher::reverseLookupAirlineIcao(const CAirlineIcaoCode &icaoPattern, const CCallsign &callsign, CStatusMessageList *log) { - if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return CAirlineIcaoCode(); } + if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return {}; } const CAirlineIcaoCode icao = sApp->getWebDataServices()->smartAirlineIcaoSelector(icaoPattern, callsign); if (log) { @@ -1426,7 +1426,7 @@ namespace swift::core CLivery CAircraftMatcher::reverseLookupStandardLivery(const CAirlineIcaoCode &airline, const CCallsign &callsign, CStatusMessageList *log) { - if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return CLivery(); } + if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return {}; } if (!airline.hasValidDesignator()) { if (log) @@ -1435,7 +1435,7 @@ namespace swift::core log, callsign, QStringLiteral("Reverse lookup of standard livery skipped, no airline designator"), CAircraftMatcher::getLogCategories(), CStatusMessage::SeverityWarning); } - return CLivery(); + return {}; } const CLivery livery = sApp->getWebDataServices()->getStdLiveryForAirlineCode(airline); @@ -1461,7 +1461,7 @@ namespace swift::core CLivery CAircraftMatcher::reverseLookupLiveryId(int id, const CCallsign &logCallsign, CStatusMessageList *log) { - if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return CLivery(); } + if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return {}; } const CLivery livery = sApp->getWebDataServices()->getLiveryForDbKey(id); if (log) { @@ -1564,12 +1564,12 @@ namespace swift::core const CAirlineIcaoCode &airline, const CCallsign &callsign, CStatusMessageList *log) { - if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return CAircraftIcaoCode(); } + if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return {}; } if (!airline.isLoadedFromDb()) { CCallsign::addLogDetailsToList( log, callsign, QStringLiteral("No valid airline from DB '%1'").arg(airline.getDesignator())); - return CAircraftIcaoCode(); + return {}; } Q_ASSERT_X(sApp->getWebDataServices(), Q_FUNC_INFO, "No web services"); @@ -1579,7 +1579,7 @@ namespace swift::core { CCallsign::addLogDetailsToList( log, callsign, QStringLiteral("No aircraft known for airline '%1'").arg(airline.getDesignator())); - return CAircraftIcaoCode(); + return {}; } const QSet allIcaos = aircraft.allDesignators(); @@ -1602,7 +1602,7 @@ namespace swift::core CAirlineIcaoCode CAircraftMatcher::callsignToAirline(const CCallsign &callsign, CStatusMessageList *log) { - if (callsign.isEmpty() || !sApp || !sApp->getWebDataServices()) { return CAirlineIcaoCode(); } + if (callsign.isEmpty() || !sApp || !sApp->getWebDataServices()) { return {}; } const CAirlineIcaoCode icao = sApp->getWebDataServices()->findBestMatchByCallsign(callsign); if (icao.hasValidDesignator()) @@ -1893,7 +1893,7 @@ namespace swift::core map = modelSet.scoreFull(remoteAircraft.getModel(), preferColorLiveries, noZeroScores, scoreLog); CAircraftModel matchedModel; - if (map.isEmpty()) { return CAircraftModelList(); } + if (map.isEmpty()) { return {}; } maxScore = map.lastKey(); const CAircraftModelList maxScoreAircraft(map.values(maxScore)); @@ -1972,7 +1972,7 @@ namespace swift::core CMatchingUtils::addLogDetailsToList(log, remoteAircraft, QStringLiteral("No model string, no exact match possible")); } - return CAircraftModel(); + return {}; } CAircraftModel model = models.findFirstByModelStringAliasOrDefault(remoteAircraft.getModelString()); @@ -2694,10 +2694,10 @@ namespace swift::core const QString &airlineTelephony, bool useSwiftDbData, CStatusMessageList *log) { - if (!useSwiftDbData) { return CAirlineIcaoCode(designator); } - if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return CAirlineIcaoCode(designator); } + if (!useSwiftDbData) { return { designator }; } + if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return { designator }; } const CAirlineIcaoCodeList codes = sApp->getWebDataServices()->getAirlineIcaoCodesForDesignator(designator); - if (codes.isEmpty()) { return CAirlineIcaoCode(designator); } + if (codes.isEmpty()) { return { designator }; } if (codes.size() == 1) { return codes.front(); } // more than 1 diff --git a/src/core/application.cpp b/src/core/application.cpp index 04f396cdf5..bbd0ab7b4f 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -259,16 +259,16 @@ namespace swift::core CGlobalSetup CApplication::getGlobalSetup() const { - if (m_shutdown) { return CGlobalSetup(); } + if (m_shutdown) { return {}; } const CSetupReader *r = m_setupReader.data(); - if (!r) { return CGlobalSetup(); } + if (!r) { return {}; } return r->getSetup(); } CUpdateInfo CApplication::getUpdateInfo() const { - if (m_shutdown) { return CUpdateInfo(); } - if (!m_gitHubPackagesReader) { return CUpdateInfo(); } + if (m_shutdown) { return {}; } + if (!m_gitHubPackagesReader) { return {}; } return m_gitHubPackagesReader->getUpdateInfo(); } @@ -412,7 +412,7 @@ namespace swift::core CStatusMessage CApplication::initLocalSettings() { - if (m_localSettingsLoaded) { return CStatusMessage(); } + if (m_localSettingsLoaded) { return {}; } m_localSettingsLoaded = true; // trigger loading and saving of settings in appropriate scenarios @@ -427,7 +427,7 @@ namespace swift::core // sent to swiftcore and saved by swiftcore. CSettingsCache::instance()->enableLocalSave(); } - return CStatusMessage(); + return {}; } bool CApplication::hasUnsavedSettings() const { return !this->getUnsavedSettingsKeys().isEmpty(); } @@ -442,7 +442,7 @@ namespace swift::core CStatusMessage CApplication::saveSettingsByKey(const QStringList &keys) { - if (keys.isEmpty()) { return CStatusMessage(); } + if (keys.isEmpty()) { return {}; } return this->supportsContexts() ? this->getIContextApplication()->saveSettingsByKey(keys) : CSettingsCache::instance()->saveToStore(keys); } diff --git a/src/core/application.h b/src/core/application.h index ac31faf9dd..b5f22cee14 100644 --- a/src/core/application.h +++ b/src/core/application.h @@ -543,7 +543,7 @@ namespace swift::core virtual void onCoreFacadeStarted(); //! Can be used to start special services - virtual swift::misc::CStatusMessageList startHookIn() { return swift::misc::CStatusMessageList(); } + virtual swift::misc::CStatusMessageList startHookIn() { return {}; } //! Flag set or explicitly set to true bool isSet(const QCommandLineOption &option) const; diff --git a/src/core/context/contextapplicationempty.h b/src/core/context/contextapplicationempty.h index 03d4cca7b6..f5d09c2b46 100644 --- a/src/core/context/contextapplicationempty.h +++ b/src/core/context/contextapplicationempty.h @@ -41,21 +41,21 @@ namespace swift::core swift::misc::CValueCachePacket getAllSettings() const override { logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::CValueCachePacket(); + return {}; } //! \copydoc IContextApplication::getUnsavedSettingsKeys QStringList getUnsavedSettingsKeys() const override { logEmptyContextWarning(Q_FUNC_INFO); - return QStringList(); + return {}; } //! \copydoc IContextApplication::getUnsavedSettingsKeys swift::core::context::CSettingsDictionary getUnsavedSettingsKeysDescribed() const override { logEmptyContextWarning(Q_FUNC_INFO); - return CSettingsDictionary(); + return {}; } //! \copydoc IContextApplication::synchronizeLocalSettings @@ -66,7 +66,7 @@ namespace swift::core { Q_UNUSED(keyPrefix); logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::CStatusMessage(); + return {}; } //! \copydoc IContextApplication::saveSettingsByKey @@ -74,14 +74,14 @@ namespace swift::core { Q_UNUSED(keys); logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::CStatusMessage(); + return {}; } //! \copydoc IContextApplication::loadSettings swift::misc::CStatusMessage loadSettings() override { logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::CStatusMessage(); + return {}; } //! \copydoc IContextApplication::registerHotkeyActions @@ -107,7 +107,7 @@ namespace swift::core { Q_UNUSED(application); logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::CIdentifier(); + return {}; } //! \copydoc IContextApplication::unregisterApplication @@ -121,14 +121,14 @@ namespace swift::core swift::misc::CIdentifierList getRegisteredApplications() const override { logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::CIdentifierList(); + return {}; } //! \copydoc IContextApplication::getApplicationIdentifier swift::misc::CIdentifier getApplicationIdentifier() const override { logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::CIdentifier(); + return {}; } }; } // namespace context diff --git a/src/core/context/contextnetworkempty.h b/src/core/context/contextnetworkempty.h index a41a9d8723..6ff259ef16 100644 --- a/src/core/context/contextnetworkempty.h +++ b/src/core/context/contextnetworkempty.h @@ -29,7 +29,7 @@ namespace swift::core::context { Q_UNUSED(recalculateDistance) logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::aviation::CAtcStationList(); + return {}; } //! \copydoc IContextNetwork::getClosestAtcStationsOnline() @@ -37,14 +37,14 @@ namespace swift::core::context { Q_UNUSED(number) logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::aviation::CAtcStationList(); + return {}; } //! \copydoc IContextNetwork::getAircraftInRange() swift::misc::simulation::CSimulatedAircraftList getAircraftInRange() const override { logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::simulation::CSimulatedAircraftList(); + return {}; } //! \copydoc IContextNetwork::getAircraftInRangeForCallsign @@ -53,7 +53,7 @@ namespace swift::core::context { Q_UNUSED(callsign) logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::simulation::CSimulatedAircraft(); + return {}; } //! \copydoc IContextNetwork::getOnlineStationsForFrequency @@ -62,14 +62,14 @@ namespace swift::core::context { Q_UNUSED(frequency) logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::aviation::CAtcStationList(); + return {}; } //! \copydoc IContextNetwork::getAircraftInRangeCallsigns() swift::misc::aviation::CCallsignSet getAircraftInRangeCallsigns() const override { logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::aviation::CCallsignSet(); + return {}; } //! \copydoc IContextNetwork::getAircraftInRangeCount @@ -93,7 +93,7 @@ namespace swift::core::context { Q_UNUSED(callsign) logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::aviation::CAtcStation(); + return {}; } //! \copydoc IContextNetwork::isOnlineStation @@ -154,7 +154,7 @@ namespace swift::core::context swift::misc::network::CServer getConnectedServer() const override { logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::network::CServer(); + return {}; } //! \copydoc IContextNetwork::getLoginMode @@ -184,7 +184,7 @@ namespace swift::core::context { Q_UNUSED(callsign) logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::aviation::CFlightPlan(); + return {}; } //! \copydoc IContextNetwork::getMetarForAirport @@ -200,7 +200,7 @@ namespace swift::core::context swift::misc::network::CUserList getUsers() const override { logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::network::CUserList(); + return {}; } //! \copydoc IContextNetwork::getUsersForCallsigns @@ -209,7 +209,7 @@ namespace swift::core::context { Q_UNUSED(callsigns) logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::network::CUserList(); + return {}; } //! \copydoc IContextNetwork::getUserForCallsign @@ -217,14 +217,14 @@ namespace swift::core::context { Q_UNUSED(callsign) logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::network::CUser(); + return {}; } //! \copydoc IContextNetwork::getClients swift::misc::network::CClientList getClients() const override { logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::network::CClientList(); + return {}; } //! \copydoc IContextNetwork::getClientsForCallsigns @@ -233,7 +233,7 @@ namespace swift::core::context { Q_UNUSED(callsigns) logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::network::CClientList(); + return {}; } //! \copydoc IContextNetwork::setOtherClient @@ -314,7 +314,7 @@ namespace swift::core::context swift::misc::network::CServerList getVatsimFsdServers() const override { logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::network::CServerList(); + return {}; } //! \copydoc IContextNetwork::updateAircraftEnabled @@ -393,7 +393,7 @@ namespace swift::core::context swift::misc::aviation::CCallsignSet getFastPositionEnabledCallsigns() const override { logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::aviation::CCallsignSet(); + return {}; } //! \copydoc IContextNetwork::getReverseLookupMessages @@ -402,7 +402,7 @@ namespace swift::core::context { logEmptyContextWarning(Q_FUNC_INFO); Q_UNUSED(callsign) - return swift::misc::CStatusMessageList(); + return {}; } //! \copydoc IContextNetwork::isReverseLookupMessagesEnabled @@ -425,7 +425,7 @@ namespace swift::core::context { logEmptyContextWarning(Q_FUNC_INFO); Q_UNUSED(callsign) - return swift::misc::CStatusMessageList(); + return {}; } //! \copydoc IContextNetwork::getRemoteAircraftParts @@ -434,7 +434,7 @@ namespace swift::core::context { logEmptyContextWarning(Q_FUNC_INFO); Q_UNUSED(callsign) - return swift::misc::aviation::CAircraftPartsList(); + return {}; } //! \copydoc IContextNetwork::isAircraftPartsHistoryEnabled diff --git a/src/core/context/contextnetworkimpl.cpp b/src/core/context/contextnetworkimpl.cpp index f8c0e237ab..4fdd059c49 100644 --- a/src/core/context/contextnetworkimpl.cpp +++ b/src/core/context/contextnetworkimpl.cpp @@ -255,10 +255,7 @@ namespace swift::core::context return CStatusMessage({ CLogCategories::validation() }, CStatusMessage::SeverityError, u"Invalid ICAO data for own aircraft"); } - if (!CNetworkUtils::canConnect(server, msg, 5000)) - { - return CStatusMessage(CStatusMessage::SeverityError, msg); - } + if (!CNetworkUtils::canConnect(server, msg, 5000)) { return { CStatusMessage::SeverityError, msg }; } if (m_fsdClient->isConnected()) { return CStatusMessage({ CLogCategories::validation() }, CStatusMessage::SeverityError, @@ -620,7 +617,7 @@ namespace swift::core::context CCallsignSet callsigns; callsigns.push_back(callsign); const CUserList users = this->getUsersForCallsigns(callsigns); - if (users.isEmpty()) { return CUser(); } + if (users.isEmpty()) { return {}; } return users[0]; } @@ -894,7 +891,7 @@ namespace swift::core::context CAtcStationList CContextNetwork::getClosestAtcStationsOnline(int number) const { - if (!this->getIContextOwnAircraft()) { return CAtcStationList(); } + if (!this->getIContextOwnAircraft()) { return {}; } const CAircraftSituation ownSituation = this->getIContextOwnAircraft()->getOwnAircraftSituation(); const CAtcStationList stations = m_airspace->getAtcStationsOnline().findClosest(number, ownSituation); return stations; @@ -1036,7 +1033,7 @@ namespace swift::core::context QString CContextNetwork::getNetworkStatistics(bool reset, const QString &separator) { if (this->isDebugEnabled()) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; } - if (!m_fsdClient) { return QString(); } + if (!m_fsdClient) { return {}; } return m_fsdClient->getNetworkStatisticsAsText(reset, separator); } diff --git a/src/core/context/contextownaircraftempty.h b/src/core/context/contextownaircraftempty.h index 8b0bc43119..4b0f6c2192 100644 --- a/src/core/context/contextownaircraftempty.h +++ b/src/core/context/contextownaircraftempty.h @@ -27,7 +27,7 @@ namespace swift::core::context swift::misc::simulation::CSimulatedAircraft getOwnAircraft() const override { logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::simulation::CSimulatedAircraft(); + return {}; } //! \copydoc IContextOwnAircraft::getOwnComSystem @@ -36,21 +36,21 @@ namespace swift::core::context { Q_UNUSED((unit);) logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::aviation::CComSystem(); + return {}; } //! \copydoc IContextOwnAircraft::getOwnTransponder() swift::misc::aviation::CTransponder getOwnTransponder() const override { logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::aviation::CTransponder(); + return {}; } //! \copydoc IContextOwnAircraft::getOwnAircraftSituation() swift::misc::aviation::CAircraftSituation getOwnAircraftSituation() const override { logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::aviation::CAircraftSituation(); + return {}; } //! \copydoc IContextOwnAircraft::updateOwnPosition diff --git a/src/core/context/contextsimulatorempty.h b/src/core/context/contextsimulatorempty.h index fc374a50c8..11213dd3d1 100644 --- a/src/core/context/contextsimulatorempty.h +++ b/src/core/context/contextsimulatorempty.h @@ -28,21 +28,21 @@ namespace swift::core::context swift::misc::simulation::CSimulatorPluginInfo getSimulatorPluginInfo() const override { logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::simulation::CSimulatorPluginInfo(); + return {}; } //! \copydoc IContextSimulator::getAvailableSimulatorPlugins swift::misc::simulation::CSimulatorPluginInfoList getAvailableSimulatorPlugins() const override { logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::simulation::CSimulatorPluginInfoList(); + return {}; } //! \copydoc IContextSimulator::getSimulatorSettings swift::misc::simulation::settings::CSimulatorSettings getSimulatorSettings() const override { logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::simulation::settings::CSimulatorSettings(); + return {}; } //! \copydoc IContextSimulator::setSimulatorSettings @@ -84,28 +84,28 @@ namespace swift::core::context swift::misc::simulation::CAircraftModelList getModelSet() const override { logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::simulation::CAircraftModelList(); + return {}; } //! \copydoc IContextSimulator::simulatorsWithInitializedModelSet swift::misc::simulation::CSimulatorInfo simulatorsWithInitializedModelSet() const override { logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::simulation::CSimulatorInfo(); + return {}; } //! \copydoc IContextSimulator::verifyPrerequisites swift::misc::CStatusMessageList verifyPrerequisites() const override { logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::CStatusMessageList(); + return {}; } //! \copydoc IContextSimulator::getModelSetLoaderSimulator swift::misc::simulation::CSimulatorInfo getModelSetLoaderSimulator() const override { logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::simulation::CSimulatorInfo(); + return {}; } //! \copydoc IContextSimulator::setModelSetLoaderSimulator @@ -119,7 +119,7 @@ namespace swift::core::context QStringList getModelSetStrings() const override { logEmptyContextWarning(Q_FUNC_INFO); - return QStringList(); + return {}; } //! \copydoc IContextSimulator::getModelSetCompleterStrings @@ -127,7 +127,7 @@ namespace swift::core::context { Q_UNUSED(sorted); logEmptyContextWarning(Q_FUNC_INFO); - return QStringList(); + return {}; } //! \copydoc IContextSimulator::removeModelsFromSet @@ -151,7 +151,7 @@ namespace swift::core::context swift::misc::simulation::CAircraftModelList getDisabledModelsForMatching() const override { logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::simulation::CAircraftModelList(); + return {}; } //! \copydoc CAircraftMatcher::restoreDisabledModels @@ -186,7 +186,7 @@ namespace swift::core::context { Q_UNUSED(modelString); logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::simulation::CAircraftModelList(); + return {}; } //! \copydoc IContextSimulator::getModelSetCount @@ -200,7 +200,7 @@ namespace swift::core::context swift::misc::simulation::CSimulatorInternals getSimulatorInternals() const override { logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::simulation::CSimulatorInternals(); + return {}; } //! \copydoc ISimulator::getInterpolationSetupGlobal @@ -208,14 +208,14 @@ namespace swift::core::context getInterpolationAndRenderingSetupGlobal() const override { logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::simulation::CInterpolationAndRenderingSetupGlobal(); + return {}; } //! \copydoc ISimulator::getInterpolationSetupsPerCallsign swift::misc::simulation::CInterpolationSetupList getInterpolationAndRenderingSetupsPerCallsign() const override { logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::simulation::CInterpolationSetupList(); + return {}; } //! \copydoc ISimulator::getInterpolationSetupPerCallsignOrDefault @@ -225,7 +225,7 @@ namespace swift::core::context { Q_UNUSED(callsign) logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::simulation::CInterpolationAndRenderingSetupPerCallsign(); + return {}; } //! \copydoc swift::misc::simulation::IInterpolationSetupProvider::setInterpolationSetupGlobal @@ -253,7 +253,7 @@ namespace swift::core::context { Q_UNUSED(callsign) logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::CStatusMessageList(); + return {}; } //! \copydoc IContextSimulator::followAircraft @@ -309,7 +309,7 @@ namespace swift::core::context { Q_UNUSED(callsign); logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::CStatusMessageList(); + return {}; } //! \copydoc IContextSimulator::enableMatchingMessages @@ -340,7 +340,7 @@ namespace swift::core::context { Q_UNUSED(missingOnly) logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::simulation::CMatchingStatistics(); + return {}; } //! \copydoc IContextSimulator::setMatchingSetup @@ -375,7 +375,7 @@ namespace swift::core::context swift::misc::simulation::CAircraftMatcherSetup getMatchingSetup() const override { logEmptyContextWarning(Q_FUNC_INFO); - return swift::misc::simulation::CAircraftMatcherSetup(); + return {}; } }; } // namespace swift::core::context diff --git a/src/core/context/contextsimulatorimpl.cpp b/src/core/context/contextsimulatorimpl.cpp index 6cb1f64559..4b55066568 100644 --- a/src/core/context/contextsimulatorimpl.cpp +++ b/src/core/context/contextsimulatorimpl.cpp @@ -205,7 +205,7 @@ namespace swift::core::context CSimulatorInternals CContextSimulator::getSimulatorInternals() const { if (isDebugEnabled()) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; } - if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return CSimulatorInternals(); } + if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return {}; } return m_simulatorPlugin.second->getSimulatorInternals(); } @@ -213,7 +213,7 @@ namespace swift::core::context { if (isDebugEnabled()) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; } const CSimulatorInfo simulator = this->getModelSetLoaderSimulator(); - if (!simulator.isSingleSimulator()) { return CAircraftModelList(); } + if (!simulator.isSingleSimulator()) { return {}; } CCentralMultiSimulatorModelSetCachesProvider::modelCachesInstance().synchronizeCache(simulator); return CCentralMultiSimulatorModelSetCachesProvider::modelCachesInstance().getCachedModels(simulator); @@ -321,7 +321,7 @@ namespace swift::core::context CAircraftModelList CContextSimulator::getDisabledModelsForMatching() const { if (isDebugEnabled()) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; } - if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return CAircraftModelList(); } + if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return {}; } return m_aircraftMatcher.getDisabledModelsForMatching(); } @@ -354,7 +354,7 @@ namespace swift::core::context { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << modelString; } - if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return CAircraftModelList(); } + if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return {}; } return this->getModelSet().findModelsStartingWith(modelString); } @@ -369,7 +369,7 @@ namespace swift::core::context CInterpolationSetupList CContextSimulator::getInterpolationAndRenderingSetupsPerCallsign() const { if (isDebugEnabled()) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; } - if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return CInterpolationSetupList(); } + if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return {}; } return m_simulatorPlugin.second->getInterpolationSetupsPerCallsign(); } @@ -377,10 +377,7 @@ namespace swift::core::context CContextSimulator::getInterpolationAndRenderingSetupPerCallsignOrDefault(const CCallsign &callsign) const { if (isDebugEnabled()) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; } - if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) - { - return CInterpolationAndRenderingSetupPerCallsign(); - } + if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return {}; } return m_simulatorPlugin.second->getInterpolationSetupPerCallsignOrDefault(callsign); } @@ -408,8 +405,8 @@ namespace swift::core::context CStatusMessageList CContextSimulator::getInterpolationMessages(const CCallsign &callsign) const { if (isDebugEnabled()) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; } - if (callsign.isEmpty()) { return CStatusMessageList(); } - if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return CStatusMessageList(); } + if (callsign.isEmpty()) { return {}; } + if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return {}; } return m_simulatorPlugin.second->getInterpolationMessages(callsign); } diff --git a/src/core/corefacade.cpp b/src/core/corefacade.cpp index 793e2fd1bf..ac3322c4f2 100644 --- a/src/core/corefacade.cpp +++ b/src/core/corefacade.cpp @@ -51,21 +51,15 @@ namespace swift::core CStatusMessage CCoreFacade::tryToReconnectWithDBus() { - if (m_shuttingDown) { return CStatusMessage(this, CStatusMessage::SeverityInfo, u"Shutdown"); } - if (!m_config.requiresDBusConnection()) - { - return CStatusMessage(this, CStatusMessage::SeverityInfo, u"Not DBus based"); - } + if (m_shuttingDown) { return { this, CStatusMessage::SeverityInfo, u"Shutdown" }; } + if (!m_config.requiresDBusConnection()) { return { this, CStatusMessage::SeverityInfo, u"Not DBus based" }; } const QString dBusAddress = this->getDBusAddress(); - if (dBusAddress.isEmpty()) - { - return CStatusMessage(this, CStatusMessage::SeverityInfo, u"Not DBus based, no address"); - } + if (dBusAddress.isEmpty()) { return { this, CStatusMessage::SeverityInfo, u"Not DBus based, no address" }; } QString connectMsg; if (!CContextApplicationProxy::isContextResponsive(dBusAddress, connectMsg)) { - return CStatusMessage(this, CStatusMessage::SeverityError, - u"Cannot connect DBus at '" % dBusAddress % u"', reason: " % connectMsg); + return { this, CStatusMessage::SeverityError, + u"Cannot connect DBus at '" % dBusAddress % u"', reason: " % connectMsg }; } // re-init diff --git a/src/core/db/databasereader.cpp b/src/core/db/databasereader.cpp index 40cf66cbd0..bad212982b 100644 --- a/src/core/db/databasereader.cpp +++ b/src/core/db/databasereader.cpp @@ -493,7 +493,7 @@ namespace swift::core::db CUrl CDatabaseReader::getBaseUrl(CDbFlags::DataRetrievalModeFlag mode) const { - if (!sApp || sApp->isShuttingDown()) { return CUrl(); } + if (!sApp || sApp->isShuttingDown()) { return {}; } switch (mode) { case CDbFlags::DbReading: return this->getDbServiceBaseUrl().withAppendedPath("/service"); @@ -501,7 +501,7 @@ namespace swift::core::db case CDbFlags::Shared: return sApp->getGlobalSetup().getSharedDbDataDirectoryUrl(); default: qFatal("Wrong mode"); break; } - return CUrl(); + return {}; } bool CDatabaseReader::isChangedUrl(const CUrl &oldUrl, const CUrl ¤tUrl) diff --git a/src/core/db/databasereaderconfig.cpp b/src/core/db/databasereaderconfig.cpp index 79060625de..9a1a1df510 100644 --- a/src/core/db/databasereaderconfig.cpp +++ b/src/core/db/databasereaderconfig.cpp @@ -110,7 +110,7 @@ namespace swift::core::db if (config.getEntities() == entities) { return config; } } } - return CDatabaseReaderConfig(); // not found + return {}; // not found } void CDatabaseReaderConfigList::markAsDbDown() diff --git a/src/core/db/databaseutils.cpp b/src/core/db/databaseutils.cpp index fca32ae61b..505b152e57 100644 --- a/src/core/db/databaseutils.cpp +++ b/src/core/db/databaseutils.cpp @@ -353,7 +353,7 @@ namespace swift::core::db IProgressIndicator *progressIndicator, bool processEvents) { - if (!sApp || !sApp->getWebDataServices() || sApp->isShuttingDown()) { return CAircraftModelList(); } + if (!sApp || !sApp->getWebDataServices() || sApp->isShuttingDown()) { return {}; } const CAircraftModelList dbFsFamilyModels(sApp->getWebDataServices()->getModels().findFsFamilyModels()); CAircraftModelList stashModels; if (dbFsFamilyModels.isEmpty() || ownModels.isEmpty()) { return stashModels; } @@ -410,7 +410,7 @@ namespace swift::core::db QJsonDocument CDatabaseUtils::databaseJsonToQJsonDocument(const QString &content) { static const QString compressed("swift:"); - if (content.isEmpty()) { return QJsonDocument(); } + if (content.isEmpty()) { return {}; } QByteArray byteData; if (json::looksLikeJson(content)) { @@ -439,21 +439,21 @@ namespace swift::core::db while (false); } - if (byteData.isEmpty()) { return QJsonDocument(); } + if (byteData.isEmpty()) { return {}; } return QJsonDocument::fromJson(byteData); } QJsonDocument CDatabaseUtils::readQJsonDocumentFromDatabaseFile(const QString &filename) { const QString raw = CFileUtils::readFileToString(filename); - if (raw.isEmpty()) { return QJsonDocument(); } + if (raw.isEmpty()) { return {}; } return CDatabaseUtils::databaseJsonToQJsonDocument(raw); } QJsonObject CDatabaseUtils::readQJsonObjectFromDatabaseFile(const QString &filename) { const QString raw = CFileUtils::readFileToString(filename); - if (raw.isEmpty()) { return QJsonObject(); } + if (raw.isEmpty()) { return {}; } // allow also compressed format const QJsonDocument jsonDoc = CDatabaseUtils::databaseJsonToQJsonDocument(raw); diff --git a/src/core/db/icaodatareader.cpp b/src/core/db/icaodatareader.cpp index 44551abb8f..d9faa78f66 100644 --- a/src/core/db/icaodatareader.cpp +++ b/src/core/db/icaodatareader.cpp @@ -741,7 +741,7 @@ namespace swift::core::db case CEntityFlags::AirlineIcaoEntity: return m_airlineIcaoCache.getAvailableTimestamp(); case CEntityFlags::CountryEntity: return m_countryCache.getAvailableTimestamp(); case CEntityFlags::AircraftCategoryEntity: return m_categoryCache.getAvailableTimestamp(); - default: return QDateTime(); + default: return {}; } } diff --git a/src/core/db/infodatareader.cpp b/src/core/db/infodatareader.cpp index c7881608a9..82d317732c 100644 --- a/src/core/db/infodatareader.cpp +++ b/src/core/db/infodatareader.cpp @@ -73,7 +73,7 @@ namespace swift::core::db if (entity == CEntityFlags::DbInfoObjectEntity || entity == CEntityFlags::SharedInfoObjectEntity) { SWIFT_VERIFY_X(false, Q_FUNC_INFO, "Using this for CInfoDataReader makes no sense"); - return QDateTime(); + return {}; } // Forward to web data services so I get cache data from other readers @@ -214,7 +214,7 @@ namespace swift::core::db case CDbFlags::Shared: return getSharedInfoObjectsUrl(); default: qFatal("Wrong mode"); } - return CUrl(); + return {}; } CStatusMessageList CInfoDataReader::readFromJsonFiles(const QString &dir, CEntityFlags::Entity whatToRead, diff --git a/src/core/db/modeldatareader.cpp b/src/core/db/modeldatareader.cpp index bc48ef1e77..ec0af260ec 100644 --- a/src/core/db/modeldatareader.cpp +++ b/src/core/db/modeldatareader.cpp @@ -49,21 +49,21 @@ namespace swift::core::db CLivery CModelDataReader::getLiveryForCombinedCode(const QString &combinedCode) const { - if (!CLivery::isValidCombinedCode(combinedCode)) { return CLivery(); } + if (!CLivery::isValidCombinedCode(combinedCode)) { return {}; } const CLiveryList liveries(getLiveries()); return liveries.findByCombinedCode(combinedCode); } CLivery CModelDataReader::getStdLiveryForAirlineVDesignator(const CAirlineIcaoCode &icao) const { - if (!icao.hasValidDesignator()) { return CLivery(); } + if (!icao.hasValidDesignator()) { return {}; } const CLiveryList liveries(getLiveries()); return liveries.findStdLiveryByAirlineIcaoVDesignator(icao); } CLivery CModelDataReader::getLiveryForDbKey(int id) const { - if (id < 0) { return CLivery(); } + if (id < 0) { return {}; } const CLiveryList liveries(getLiveries()); return liveries.findByKey(id); } @@ -78,7 +78,7 @@ namespace swift::core::db CDistributor CModelDataReader::getDistributorForDbKey(const QString &dbKey) const { - if (dbKey.isEmpty()) { return CDistributor(); } + if (dbKey.isEmpty()) { return {}; } const CDistributorList distributors(getDistributors()); return distributors.findByKeyOrAlias(dbKey); } @@ -87,7 +87,7 @@ namespace swift::core::db CAircraftModel CModelDataReader::getModelForModelString(const QString &modelString) const { - if (modelString.isEmpty()) { return CAircraftModel(); } + if (modelString.isEmpty()) { return {}; } const CAircraftModelList models(this->getModels()); return models.findFirstByModelStringOrDefault(modelString); } @@ -100,21 +100,21 @@ namespace swift::core::db CAircraftModel CModelDataReader::getModelForDbKey(int dbKey) const { - if (dbKey < 0) { return CAircraftModel(); } + if (dbKey < 0) { return {}; } const CAircraftModelList models(this->getModels()); return models.findByKey(dbKey); } QSet CModelDataReader::getAircraftDesignatorsForAirline(const CAirlineIcaoCode &code) const { - if (!code.hasValidDesignator()) { return QSet(); } + if (!code.hasValidDesignator()) { return {}; } const CAircraftModelList models(this->getModels()); return models.getAircraftDesignatorsForAirline(code); } CAircraftIcaoCodeList CModelDataReader::getAicraftIcaoCodesForAirline(const CAirlineIcaoCode &code) const { - if (!code.hasValidDesignator()) { return CAircraftIcaoCodeList(); } + if (!code.hasValidDesignator()) { return {}; } const CAircraftModelList models(this->getModels()); return models.getAicraftIcaoCodesForAirline(code); } @@ -123,7 +123,7 @@ namespace swift::core::db CModelDataReader::getModelsForAircraftDesignatorAndLiveryCombinedCode(const QString &aircraftDesignator, const QString &combinedCode) { - if (aircraftDesignator.isEmpty()) { return CAircraftModelList(); } + if (aircraftDesignator.isEmpty()) { return {}; } const CAircraftModelList models(this->getModels()); return models.findByAircraftDesignatorAndLiveryCombinedCode(aircraftDesignator, combinedCode); } @@ -230,13 +230,13 @@ namespace swift::core::db CAircraftIcaoCodeList CModelDataReader::getAircraftAircraftIcaos() const { - if (!sApp || sApp->isShuttingDown() || !sApp->getWebDataServices()) { return CAircraftIcaoCodeList(); } + if (!sApp || sApp->isShuttingDown() || !sApp->getWebDataServices()) { return {}; } return sApp->getWebDataServices()->getAircraftIcaoCodes(); } CAircraftCategoryList CModelDataReader::getAircraftCategories() const { - if (!sApp || sApp->isShuttingDown() || !sApp->getWebDataServices()) { return CAircraftCategoryList(); } + if (!sApp || sApp->isShuttingDown() || !sApp->getWebDataServices()) { return {}; } return sApp->getWebDataServices()->getAircraftCategories(); } @@ -628,7 +628,7 @@ namespace swift::core::db case CEntityFlags::LiveryEntity: return m_liveryCache.getAvailableTimestamp(); case CEntityFlags::ModelEntity: return m_modelCache.getAvailableTimestamp(); case CEntityFlags::DistributorEntity: return m_distributorCache.getAvailableTimestamp(); - default: return QDateTime(); + default: return {}; } } diff --git a/src/core/fsd/addatc.cpp b/src/core/fsd/addatc.cpp index 0f102b3310..b4bf6552af 100644 --- a/src/core/fsd/addatc.cpp +++ b/src/core/fsd/addatc.cpp @@ -39,6 +39,6 @@ namespace swift::core::fsd const AtcRating rating = fromQString(tokens[5]); const int protocolRevision = tokens[6].toInt(); - return AddAtc(tokens[0], tokens[2], tokens[3], tokens[4], rating, protocolRevision); + return { tokens[0], tokens[2], tokens[3], tokens[4], rating, protocolRevision }; } } // namespace swift::core::fsd diff --git a/src/core/fsd/authchallenge.cpp b/src/core/fsd/authchallenge.cpp index 32d743002e..a4d05d9667 100644 --- a/src/core/fsd/authchallenge.cpp +++ b/src/core/fsd/authchallenge.cpp @@ -29,6 +29,6 @@ namespace swift::core::fsd swift::misc::CLogMessage(static_cast(nullptr)).warning(u"Wrong number of arguments."); return {}; } - return AuthChallenge(tokens[0], tokens[1], tokens[2]); + return { tokens[0], tokens[1], tokens[2] }; } } // namespace swift::core::fsd diff --git a/src/core/fsd/authresponse.cpp b/src/core/fsd/authresponse.cpp index 7e7ab3f81f..e1859c961e 100644 --- a/src/core/fsd/authresponse.cpp +++ b/src/core/fsd/authresponse.cpp @@ -29,6 +29,6 @@ namespace swift::core::fsd swift::misc::CLogMessage(static_cast(nullptr)).warning(u"Wrong number of arguments."); return {}; } - return AuthResponse(tokens[0], tokens[1], tokens[2]); + return { tokens[0], tokens[1], tokens[2] }; } } // namespace swift::core::fsd diff --git a/src/core/fsd/clientquery.cpp b/src/core/fsd/clientquery.cpp index 6522cfef41..c8b412d5ea 100644 --- a/src/core/fsd/clientquery.cpp +++ b/src/core/fsd/clientquery.cpp @@ -35,6 +35,6 @@ namespace swift::core::fsd QStringList payload; if (tokens.size() > 3) { payload = tokens.mid(3); } - return ClientQuery(tokens[0], tokens[1], fromQString(tokens[2]), payload); + return { tokens[0], tokens[1], fromQString(tokens[2]), payload }; } } // namespace swift::core::fsd diff --git a/src/core/fsd/clientresponse.cpp b/src/core/fsd/clientresponse.cpp index fc6efecb18..6eed66ff10 100644 --- a/src/core/fsd/clientresponse.cpp +++ b/src/core/fsd/clientresponse.cpp @@ -33,6 +33,6 @@ namespace swift::core::fsd QStringList responseData; if (tokens.size() > 3) { responseData = tokens.mid(3); } - return ClientResponse(tokens[0], tokens[1], fromQString(tokens[2]), responseData); + return { tokens[0], tokens[1], fromQString(tokens[2]), responseData }; } } // namespace swift::core::fsd diff --git a/src/core/fsd/deleteatc.cpp b/src/core/fsd/deleteatc.cpp index 385ab2d52e..2577b03dae 100644 --- a/src/core/fsd/deleteatc.cpp +++ b/src/core/fsd/deleteatc.cpp @@ -26,6 +26,6 @@ namespace swift::core::fsd swift::misc::CLogMessage(static_cast(nullptr)).debug(u"Wrong number of arguments."); return {}; }; - return DeleteAtc(tokens[0], (tokens.size() >= 2) ? tokens[1] : QString()); + return { tokens[0], (tokens.size() >= 2) ? tokens[1] : QString() }; } } // namespace swift::core::fsd diff --git a/src/core/fsd/euroscopesimdata.cpp b/src/core/fsd/euroscopesimdata.cpp index 18a5fde1d8..8e3801c0fd 100644 --- a/src/core/fsd/euroscopesimdata.cpp +++ b/src/core/fsd/euroscopesimdata.cpp @@ -73,9 +73,20 @@ namespace swift::core::fsd }; // token[0,15,16] are not used - return EuroscopeSimData(tokens[1], tokens[2], tokens[3], tokens[4].toULongLong(), tokens[5].toDouble(), - tokens[6].toDouble(), tokens[7].toDouble(), tokens[8].toDouble(), tokens[9].toInt(), - tokens[10].toInt(), tokens[11].toInt(), tokens[12].toInt(), tokens[13].toDouble(), - tokens[14].toDouble(), fromFlags(tokens[17].toInt())); + return { tokens[1], + tokens[2], + tokens[3], + tokens[4].toULongLong(), + tokens[5].toDouble(), + tokens[6].toDouble(), + tokens[7].toDouble(), + tokens[8].toDouble(), + tokens[9].toInt(), + tokens[10].toInt(), + tokens[11].toInt(), + static_cast(tokens[12].toInt()), + tokens[13].toDouble(), + tokens[14].toDouble(), + fromFlags(tokens[17].toInt()) }; } } // namespace swift::core::fsd diff --git a/src/core/fsd/flightplan.cpp b/src/core/fsd/flightplan.cpp index 9dd1b4d82f..4815948c96 100644 --- a/src/core/fsd/flightplan.cpp +++ b/src/core/fsd/flightplan.cpp @@ -53,9 +53,11 @@ namespace swift::core::fsd swift::misc::CLogMessage(static_cast(nullptr)).debug(u"Wrong number of arguments."); return {}; }; - return FlightPlan(tokens[0], tokens[1], fromQString(tokens[2]), tokens[3], tokens[4].toInt(), - tokens[5], tokens[6].toInt(), tokens[7].toInt(), tokens[8], tokens[9], tokens[10].toInt(), - tokens[11].toInt(), tokens[12].toInt(), tokens[13].toInt(), tokens[14], tokens[15], - tokens[16]); + return { tokens[0], tokens[1], fromQString(tokens[2]), + tokens[3], tokens[4].toInt(), tokens[5], + tokens[6].toInt(), tokens[7].toInt(), tokens[8], + tokens[9], tokens[10].toInt(), tokens[11].toInt(), + tokens[12].toInt(), tokens[13].toInt(), tokens[14], + tokens[15], tokens[16] }; } } // namespace swift::core::fsd diff --git a/src/core/fsd/fsdidentification.cpp b/src/core/fsd/fsdidentification.cpp index 0a684c9625..2b58b38a47 100644 --- a/src/core/fsd/fsdidentification.cpp +++ b/src/core/fsd/fsdidentification.cpp @@ -31,6 +31,6 @@ namespace swift::core::fsd swift::misc::CLogMessage(static_cast(nullptr)).debug(u"Wrong number of arguments."); return {}; }; - return FSDIdentification(tokens[0], tokens[1], tokens[2], tokens[3]); + return { tokens[0], tokens[1], tokens[2], tokens[3] }; } } // namespace swift::core::fsd diff --git a/src/core/fsd/interimpilotdataupdate.cpp b/src/core/fsd/interimpilotdataupdate.cpp index fd1e7467c9..a9ace13cc6 100644 --- a/src/core/fsd/interimpilotdataupdate.cpp +++ b/src/core/fsd/interimpilotdataupdate.cpp @@ -53,7 +53,15 @@ namespace swift::core::fsd bool onGround = false; unpackPBH(tokens[7].toUInt(), pitch, bank, heading, onGround); - return InterimPilotDataUpdate(tokens[0], tokens[1], tokens[3].toDouble(), tokens[4].toDouble(), - tokens[5].toInt(), tokens[6].toInt(), pitch, bank, heading, onGround); + return { tokens[0], + tokens[1], + tokens[3].toDouble(), + tokens[4].toDouble(), + tokens[5].toInt(), + tokens[6].toInt(), + pitch, + bank, + heading, + onGround }; } } // namespace swift::core::fsd diff --git a/src/core/fsd/killrequest.cpp b/src/core/fsd/killrequest.cpp index be15aa9b28..ad05a9ff1f 100644 --- a/src/core/fsd/killrequest.cpp +++ b/src/core/fsd/killrequest.cpp @@ -29,6 +29,6 @@ namespace swift::core::fsd swift::misc::CLogMessage(static_cast(nullptr)).debug(u"Wrong number of arguments."); return {}; }; - return KillRequest(tokens[0], tokens[1], tokens.size() > 2 ? tokens[2] : QString()); + return { tokens[0], tokens[1], tokens.size() > 2 ? tokens[2] : QString() }; } } // namespace swift::core::fsd diff --git a/src/core/fsd/mute.cpp b/src/core/fsd/mute.cpp index bd9f921281..c977f23ea4 100644 --- a/src/core/fsd/mute.cpp +++ b/src/core/fsd/mute.cpp @@ -26,6 +26,6 @@ namespace swift::core::fsd swift::misc::CLogMessage(static_cast(nullptr)).debug(u"Wrong number of arguments."); return {}; }; - return Mute(tokens[0], tokens[1], tokens[2] == QStringLiteral("1")); + return { tokens[0], tokens[1], tokens[2] == QStringLiteral("1") }; } } // namespace swift::core::fsd diff --git a/src/core/fsd/pilotdataupdate.cpp b/src/core/fsd/pilotdataupdate.cpp index b055ec6ddd..51dd63c619 100644 --- a/src/core/fsd/pilotdataupdate.cpp +++ b/src/core/fsd/pilotdataupdate.cpp @@ -57,9 +57,18 @@ namespace swift::core::fsd bool onGround = false; unpackPBH(tokens[8].toUInt(), pitch, bank, heading, onGround); - return PilotDataUpdate(fromQString(tokens[0]), tokens[1], tokens[2].toInt(), - fromQString(tokens[3]), tokens[4].toDouble(), tokens[5].toDouble(), - tokens[6].toInt(), tokens[6].toInt() + tokens[9].toInt(), tokens[7].toInt(), pitch, bank, - heading, onGround); + return { fromQString(tokens[0]), + tokens[1], + tokens[2].toInt(), + fromQString(tokens[3]), + tokens[4].toDouble(), + tokens[5].toDouble(), + tokens[6].toInt(), + tokens[6].toInt() + tokens[9].toInt(), + tokens[7].toInt(), + pitch, + bank, + heading, + onGround }; } } // namespace swift::core::fsd diff --git a/src/core/fsd/ping.cpp b/src/core/fsd/ping.cpp index 3ed45f3dc6..c3c2f776f4 100644 --- a/src/core/fsd/ping.cpp +++ b/src/core/fsd/ping.cpp @@ -29,6 +29,6 @@ namespace swift::core::fsd swift::misc::CLogMessage(static_cast(nullptr)).debug(u"Wrong number of arguments."); return {}; }; - return Ping(tokens[0], tokens[1], tokens[2]); + return { tokens[0], tokens[1], tokens[2] }; } } // namespace swift::core::fsd diff --git a/src/core/fsd/planeinforequest.cpp b/src/core/fsd/planeinforequest.cpp index f3fc197115..ea2adbb1c4 100644 --- a/src/core/fsd/planeinforequest.cpp +++ b/src/core/fsd/planeinforequest.cpp @@ -28,6 +28,6 @@ namespace swift::core::fsd swift::misc::CLogMessage(static_cast(nullptr)).debug(u"Wrong number of arguments."); return {}; }; - return PlaneInfoRequest(tokens[0], tokens[1]); + return { tokens[0], tokens[1] }; } } // namespace swift::core::fsd diff --git a/src/core/fsd/planeinforequestfsinn.cpp b/src/core/fsd/planeinforequestfsinn.cpp index e29a1a8896..8d07f982e9 100644 --- a/src/core/fsd/planeinforequestfsinn.cpp +++ b/src/core/fsd/planeinforequestfsinn.cpp @@ -43,6 +43,6 @@ namespace swift::core::fsd .debug(u"Wrong number of arguments."); return {}; }; - return PlaneInfoRequestFsinn(tokens[0], tokens[1], tokens[4], tokens[5], tokens[10], tokens[11]); + return { tokens[0], tokens[1], tokens[4], tokens[5], tokens[10], tokens[11] }; } } // namespace swift::core::fsd diff --git a/src/core/fsd/planeinformation.cpp b/src/core/fsd/planeinformation.cpp index 57eddbd988..0856324ec3 100644 --- a/src/core/fsd/planeinformation.cpp +++ b/src/core/fsd/planeinformation.cpp @@ -52,6 +52,6 @@ namespace swift::core::fsd else if (pair[0] == QLatin1String("LIVERY")) { livery = pair[1]; } } } - return PlaneInformation(tokens[0], tokens[1], aircraft, airline, livery); + return { tokens[0], tokens[1], aircraft, airline, livery }; } } // namespace swift::core::fsd diff --git a/src/core/fsd/planeinformationfsinn.cpp b/src/core/fsd/planeinformationfsinn.cpp index d16130e901..a618cc0077 100644 --- a/src/core/fsd/planeinformationfsinn.cpp +++ b/src/core/fsd/planeinformationfsinn.cpp @@ -44,6 +44,6 @@ namespace swift::core::fsd return {}; }; - return PlaneInformationFsinn(tokens[0], tokens[1], tokens[4], tokens[5], tokens[10], tokens[11]); + return { tokens[0], tokens[1], tokens[4], tokens[5], tokens[10], tokens[11] }; } } // namespace swift::core::fsd diff --git a/src/core/fsd/pong.cpp b/src/core/fsd/pong.cpp index e510fa9e71..1e1ef6a9c7 100644 --- a/src/core/fsd/pong.cpp +++ b/src/core/fsd/pong.cpp @@ -29,6 +29,6 @@ namespace swift::core::fsd swift::misc::CLogMessage(static_cast(nullptr)).debug(u"Wrong number of arguments."); return {}; }; - return Pong(tokens[0], tokens[1], tokens[2]); + return { tokens[0], tokens[1], tokens[2] }; } } // namespace swift::core::fsd diff --git a/src/core/fsd/rehost.cpp b/src/core/fsd/rehost.cpp index a0150a8e0b..e5bd207fb8 100644 --- a/src/core/fsd/rehost.cpp +++ b/src/core/fsd/rehost.cpp @@ -26,6 +26,6 @@ namespace swift::core::fsd return {}; } - return Rehost(tokens[0], tokens[1]); + return { tokens[0], tokens[1] }; } } // namespace swift::core::fsd diff --git a/src/core/fsd/revbclientparts.cpp b/src/core/fsd/revbclientparts.cpp index 06163cdff5..36bd8b3bf8 100644 --- a/src/core/fsd/revbclientparts.cpp +++ b/src/core/fsd/revbclientparts.cpp @@ -31,7 +31,7 @@ namespace swift::core::fsd swift::misc::CLogMessage(static_cast(nullptr)).debug(u"Wrong number of arguments."); return {}; } - return RevBClientParts(tokens[0], tokens[1], tokens[2], tokens[3]); + return { tokens[0], tokens[1], tokens[2], tokens[3] }; } } // namespace swift::core::fsd diff --git a/src/core/fsd/servererror.cpp b/src/core/fsd/servererror.cpp index 9ad94dd7f0..20ea3d9da0 100644 --- a/src/core/fsd/servererror.cpp +++ b/src/core/fsd/servererror.cpp @@ -48,6 +48,6 @@ namespace swift::core::fsd swift::misc::CLogMessage(static_cast(nullptr)).debug(u"Wrong number of arguments."); return {}; } - return ServerError(tokens[0], tokens[1], static_cast(tokens[2].toInt()), tokens[3], tokens[4]); + return { tokens[0], tokens[1], static_cast(tokens[2].toInt()), tokens[3], tokens[4] }; } } // namespace swift::core::fsd diff --git a/src/core/fsd/textmessage.cpp b/src/core/fsd/textmessage.cpp index ec9cab92ae..c5da36a5af 100644 --- a/src/core/fsd/textmessage.cpp +++ b/src/core/fsd/textmessage.cpp @@ -46,6 +46,6 @@ namespace swift::core::fsd }; QStringList messageTokens = tokens.mid(2); - return TextMessage(tokens[0], tokens[1], messageTokens.join(":")); + return { tokens[0], tokens[1], messageTokens.join(":") }; } } // namespace swift::core::fsd diff --git a/src/core/fsd/visualpilotdataperiodic.cpp b/src/core/fsd/visualpilotdataperiodic.cpp index b593d94047..cb1c8b4f3d 100644 --- a/src/core/fsd/visualpilotdataperiodic.cpp +++ b/src/core/fsd/visualpilotdataperiodic.cpp @@ -63,16 +63,27 @@ namespace swift::core::fsd bool unused = false; //! \todo check if needed? unpackPBH(tokens[5].toUInt(), pitch, bank, heading, unused); - return VisualPilotDataPeriodic( - tokens[0], tokens[1].toDouble(), tokens[2].toDouble(), tokens[3].toDouble(), tokens[4].toDouble(), pitch, - bank, heading, tokens[6].toDouble(), tokens[7].toDouble(), tokens[8].toDouble(), tokens[9].toDouble(), - tokens[11].toDouble(), tokens[10].toDouble(), tokens.value(12, QStringLiteral("0")).toDouble()); + return { tokens[0], + tokens[1].toDouble(), + tokens[2].toDouble(), + tokens[3].toDouble(), + tokens[4].toDouble(), + pitch, + bank, + heading, + tokens[6].toDouble(), + tokens[7].toDouble(), + tokens[8].toDouble(), + tokens[9].toDouble(), + tokens[11].toDouble(), + tokens[10].toDouble(), + tokens.value(12, QStringLiteral("0")).toDouble() }; } VisualPilotDataUpdate VisualPilotDataPeriodic::toUpdate() const { - return VisualPilotDataUpdate(m_sender, m_latitude, m_longitude, m_altitudeTrue, m_heightAgl, m_pitch, m_bank, - m_heading, m_xVelocity, m_yVelocity, m_zVelocity, m_pitchRadPerSec, - m_bankRadPerSec, m_headingRadPerSec, m_noseGearAngle); + return { m_sender, m_latitude, m_longitude, m_altitudeTrue, m_heightAgl, + m_pitch, m_bank, m_heading, m_xVelocity, m_yVelocity, + m_zVelocity, m_pitchRadPerSec, m_bankRadPerSec, m_headingRadPerSec, m_noseGearAngle }; } } // namespace swift::core::fsd diff --git a/src/core/fsd/visualpilotdatastopped.cpp b/src/core/fsd/visualpilotdatastopped.cpp index dad0b32003..9fb0a7d94f 100644 --- a/src/core/fsd/visualpilotdatastopped.cpp +++ b/src/core/fsd/visualpilotdatastopped.cpp @@ -53,14 +53,20 @@ namespace swift::core::fsd bool unused = false; //! \todo check if needed? unpackPBH(tokens[5].toUInt(), pitch, bank, heading, unused); - return VisualPilotDataStopped(tokens[0], tokens[1].toDouble(), tokens[2].toDouble(), tokens[3].toDouble(), - tokens[4].toDouble(), pitch, bank, heading, - tokens.value(12, QStringLiteral("0")).toDouble()); + return { tokens[0], + tokens[1].toDouble(), + tokens[2].toDouble(), + tokens[3].toDouble(), + tokens[4].toDouble(), + pitch, + bank, + heading, + tokens.value(12, QStringLiteral("0")).toDouble() }; } VisualPilotDataUpdate VisualPilotDataStopped::toUpdate() const { - return VisualPilotDataUpdate(m_sender, m_latitude, m_longitude, m_altitudeTrue, m_heightAgl, m_pitch, m_bank, - m_heading, 0, 0, 0, 0, 0, 0, m_noseGearAngle); + return { m_sender, m_latitude, m_longitude, m_altitudeTrue, m_heightAgl, m_pitch, m_bank, m_heading, 0, 0, 0, + 0, 0, 0, m_noseGearAngle }; } } // namespace swift::core::fsd diff --git a/src/core/fsd/visualpilotdatatoggle.cpp b/src/core/fsd/visualpilotdatatoggle.cpp index a13accf8c8..88ee70ba4f 100644 --- a/src/core/fsd/visualpilotdatatoggle.cpp +++ b/src/core/fsd/visualpilotdatatoggle.cpp @@ -36,6 +36,6 @@ namespace swift::core::fsd return {}; } - return VisualPilotDataToggle(tokens[0], tokens[1], tokens[2] == QStringLiteral("1")); + return { tokens[0], tokens[1], tokens[2] == QStringLiteral("1") }; } } // namespace swift::core::fsd diff --git a/src/core/fsd/visualpilotdataupdate.cpp b/src/core/fsd/visualpilotdataupdate.cpp index 85f57d72f5..1755f42101 100644 --- a/src/core/fsd/visualpilotdataupdate.cpp +++ b/src/core/fsd/visualpilotdataupdate.cpp @@ -64,22 +64,33 @@ namespace swift::core::fsd bool unused = false; //! \todo check if needed? unpackPBH(tokens[5].toUInt(), pitch, bank, heading, unused); - return VisualPilotDataUpdate( - tokens[0], tokens[1].toDouble(), tokens[2].toDouble(), tokens[3].toDouble(), tokens[4].toDouble(), pitch, - bank, heading, tokens[6].toDouble(), tokens[7].toDouble(), tokens[8].toDouble(), tokens[9].toDouble(), - tokens[11].toDouble(), tokens[10].toDouble(), tokens.value(12, QStringLiteral("0")).toDouble()); + return { tokens[0], + tokens[1].toDouble(), + tokens[2].toDouble(), + tokens[3].toDouble(), + tokens[4].toDouble(), + pitch, + bank, + heading, + tokens[6].toDouble(), + tokens[7].toDouble(), + tokens[8].toDouble(), + tokens[9].toDouble(), + tokens[11].toDouble(), + tokens[10].toDouble(), + tokens.value(12, QStringLiteral("0")).toDouble() }; } VisualPilotDataPeriodic VisualPilotDataUpdate::toPeriodic() const { - return VisualPilotDataPeriodic(m_sender, m_latitude, m_longitude, m_altitudeTrue, m_heightAgl, m_pitch, m_bank, - m_heading, m_xVelocity, m_yVelocity, m_zVelocity, m_pitchRadPerSec, - m_bankRadPerSec, m_headingRadPerSec, m_noseGearAngle); + return { m_sender, m_latitude, m_longitude, m_altitudeTrue, m_heightAgl, + m_pitch, m_bank, m_heading, m_xVelocity, m_yVelocity, + m_zVelocity, m_pitchRadPerSec, m_bankRadPerSec, m_headingRadPerSec, m_noseGearAngle }; } VisualPilotDataStopped VisualPilotDataUpdate::toStopped() const { - return VisualPilotDataStopped(m_sender, m_latitude, m_longitude, m_altitudeTrue, m_heightAgl, m_pitch, m_bank, - m_heading, m_noseGearAngle); + return { m_sender, m_latitude, m_longitude, m_altitudeTrue, m_heightAgl, + m_pitch, m_bank, m_heading, m_noseGearAngle }; } } // namespace swift::core::fsd diff --git a/src/core/modelsetbuilder.cpp b/src/core/modelsetbuilder.cpp index 56c457b0c9..2cbe843258 100644 --- a/src/core/modelsetbuilder.cpp +++ b/src/core/modelsetbuilder.cpp @@ -28,7 +28,7 @@ namespace swift::core const CAircraftModelList ¤tSet, Builder options, const CDistributorList &distributors) const { - if (models.isEmpty()) { return CAircraftModelList(); } + if (models.isEmpty()) { return {}; } CAircraftModelList modelSet; // Select by distributor: diff --git a/src/core/threadedreader.cpp b/src/core/threadedreader.cpp index 0ee29c5a38..ef02bb6a20 100644 --- a/src/core/threadedreader.cpp +++ b/src/core/threadedreader.cpp @@ -119,7 +119,7 @@ namespace swift::core QPair CThreadedReader::getNetworkReplyBytes() const { - return QPair(m_networkReplyCurrent, m_networkReplyMax); + return { m_networkReplyCurrent, m_networkReplyMax }; } void CThreadedReader::networkReplyProgress(int logId, qint64 current, qint64 max, const QUrl &url) diff --git a/src/core/vatsim/vatsimdatafilereader.cpp b/src/core/vatsim/vatsimdatafilereader.cpp index a65ee33810..62e68463af 100644 --- a/src/core/vatsim/vatsimdatafilereader.cpp +++ b/src/core/vatsim/vatsimdatafilereader.cpp @@ -105,7 +105,7 @@ namespace swift::core::vatsim CVoiceCapabilities CVatsimDataFileReader::getVoiceCapabilityForCallsign(const CCallsign &callsign) const { - if (callsign.isEmpty()) { return CVoiceCapabilities(); } + if (callsign.isEmpty()) { return {}; } QReadLocker rl(&m_lock); return m_flightPlanRemarks.value(callsign).getVoiceCapabilities(); } @@ -299,7 +299,7 @@ namespace swift::core::vatsim CFlightPlanRemarks CVatsimDataFileReader::parseFlightPlanRemarks(const QJsonObject &pilot) const { - return CFlightPlanRemarks(pilot["flight_plan"]["remarks"].toString().trimmed()); + return { pilot["flight_plan"]["remarks"].toString().trimmed() }; } CAtcStation CVatsimDataFileReader::parseController(const QJsonObject &controller) const @@ -311,7 +311,7 @@ namespace swift::core::vatsim const QJsonArray atisLines = controller["text_atis"].toArray(); const auto atisText = makeRange(atisLines).transform([](auto line) { return line.toString(); }); const CInformationMessage atis(CInformationMessage::ATIS, atisText.to().join('\n')); - return CAtcStation(callsign, user, freq, {}, range, true, {}, {}, atis); + return { callsign, user, freq, {}, range, true, {}, {}, atis }; } void CVatsimDataFileReader::reloadSettings() diff --git a/src/core/vatsim/vatsimserverfilereader.cpp b/src/core/vatsim/vatsimserverfilereader.cpp index a187d9bf55..119ea93c6a 100644 --- a/src/core/vatsim/vatsimserverfilereader.cpp +++ b/src/core/vatsim/vatsimserverfilereader.cpp @@ -131,9 +131,15 @@ namespace swift::core::vatsim CServer CVatsimServerFileReader::parseServer(const QJsonObject &server) const { - return CServer(server["name"].toString(), server["location"].toString(), server["hostname_or_ip"].toString(), - 6809, CUser("id", "real name", "email", "password"), CFsdSetup::vatsimStandard(), - CEcosystem::VATSIM, CServer::FSDServerVatsim, server["clients_connection_allowed"].toInt()); + return { server["name"].toString(), + server["location"].toString(), + server["hostname_or_ip"].toString(), + 6809, + CUser("id", "real name", "email", "password"), + CFsdSetup::vatsimStandard(), + CEcosystem::VATSIM, + CServer::FSDServerVatsim, + static_cast(server["clients_connection_allowed"].toInt()) }; } } // namespace swift::core::vatsim diff --git a/src/gui/components/airportsmallcompleter.cpp b/src/gui/components/airportsmallcompleter.cpp index 2fdd8c7535..024bdf0705 100644 --- a/src/gui/components/airportsmallcompleter.cpp +++ b/src/gui/components/airportsmallcompleter.cpp @@ -60,7 +60,7 @@ namespace swift::gui::components CAirportIcaoCode CAirportSmallCompleter::getAirportIcaoCode() const { if (m_current.hasValidIcaoCode()) { return m_current.getIcao(); } - return CAirportIcaoCode(this->getIcaoText()); + return { this->getIcaoText() }; } QString CAirportSmallCompleter::getIcaoText() const { return ui->le_Icao->text().trimmed().toUpper(); } diff --git a/src/gui/components/audiodevicevolumesetupcomponent.cpp b/src/gui/components/audiodevicevolumesetupcomponent.cpp index 9cc59f5721..5f17c36588 100644 --- a/src/gui/components/audiodevicevolumesetupcomponent.cpp +++ b/src/gui/components/audiodevicevolumesetupcomponent.cpp @@ -524,14 +524,14 @@ namespace swift::gui::components CAudioDeviceInfo CAudioDeviceVolumeSetupComponent::getSelectedInputDevice() const { - if (!hasAudio()) { return CAudioDeviceInfo(); } + if (!hasAudio()) { return {}; } const CAudioDeviceInfoList devices = sGui->getCContextAudioBase()->getAudioInputDevices(); return devices.findByName(ui->cb_SetupAudioInputDevice->currentText()); } CAudioDeviceInfo CAudioDeviceVolumeSetupComponent::getSelectedOutputDevice() const { - if (!hasAudio()) { return CAudioDeviceInfo(); } + if (!hasAudio()) { return {}; } const CAudioDeviceInfoList devices = sGui->getCContextAudioBase()->getAudioOutputDevices(); return devices.findByName(ui->cb_SetupAudioOutputDevice->currentText()); } diff --git a/src/gui/components/callsigncompleter.cpp b/src/gui/components/callsigncompleter.cpp index cd531e3587..6e974d9e85 100644 --- a/src/gui/components/callsigncompleter.cpp +++ b/src/gui/components/callsigncompleter.cpp @@ -50,8 +50,8 @@ namespace swift::gui::components const QString csString = ui->le_Callsign->text().trimmed().toUpper(); const bool valid = onlyKnownCallsign ? this->isValidKnownCallsign(csString) : CCallsign::isValidAircraftCallsign(csString); - if (!valid) { return CCallsign(); } - return CCallsign(csString, CCallsign::Aircraft); + if (!valid) { return {}; } + return { csString, CCallsign::Aircraft }; } void CCallsignCompleter::setCallsign(const CCallsign &cs) { ui->le_Callsign->setText(cs.asString()); } diff --git a/src/gui/components/cockpitcomcomponent.cpp b/src/gui/components/cockpitcomcomponent.cpp index e75b0c507f..64d359308e 100644 --- a/src/gui/components/cockpitcomcomponent.cpp +++ b/src/gui/components/cockpitcomcomponent.cpp @@ -140,7 +140,7 @@ namespace swift::gui::components { // unavailable context during shutdown possible // mostly when client runs with DBus, but DBus is down - if (!sGui || sGui->isShuttingDown() || !sGui->getIContextOwnAircraft()) { return CSimulatedAircraft(); } + if (!sGui || sGui->isShuttingDown() || !sGui->getIContextOwnAircraft()) { return {}; } return sGui->getIContextOwnAircraft()->getOwnAircraft(); } diff --git a/src/gui/components/cockpitinfoareacomponent.cpp b/src/gui/components/cockpitinfoareacomponent.cpp index 4c9c137a9c..1916d495fe 100644 --- a/src/gui/components/cockpitinfoareacomponent.cpp +++ b/src/gui/components/cockpitinfoareacomponent.cpp @@ -30,7 +30,7 @@ namespace swift::gui::components { // see also CMainInfoAreaComponent::getPreferredSizeWhenFloating Q_UNUSED(areaIndex) - return QSize(600, 400); + return { 600, 400 }; } const QPixmap &CCockpitInfoAreaComponent::indexToPixmap(int areaIndex) const diff --git a/src/gui/components/cockpittranspondermodeledscomponent.cpp b/src/gui/components/cockpittranspondermodeledscomponent.cpp index e0f5917836..45a4d9e7ad 100644 --- a/src/gui/components/cockpittranspondermodeledscomponent.cpp +++ b/src/gui/components/cockpittranspondermodeledscomponent.cpp @@ -114,13 +114,13 @@ namespace swift::gui::components CTransponder CCockpitTransponderModeLedsComponent::getOwnTransponder() const { - if (!sGui || sGui->isShuttingDown() || !sGui->getIContextOwnAircraft()) { return CTransponder(); } + if (!sGui || sGui->isShuttingDown() || !sGui->getIContextOwnAircraft()) { return {}; } return sGui->getIContextOwnAircraft()->getOwnAircraft().getTransponder(); } CSimulatedAircraft CCockpitTransponderModeLedsComponent::getOwnAircraft() const { - if (!sGui || sGui->isShuttingDown() || !sGui->getIContextOwnAircraft()) { return CSimulatedAircraft(); } + if (!sGui || sGui->isShuttingDown() || !sGui->getIContextOwnAircraft()) { return {}; } return sGui->getIContextOwnAircraft()->getOwnAircraft(); } } // namespace swift::gui::components diff --git a/src/gui/components/coreinfoareacomponent.cpp b/src/gui/components/coreinfoareacomponent.cpp index d401599e2d..d50789833d 100644 --- a/src/gui/components/coreinfoareacomponent.cpp +++ b/src/gui/components/coreinfoareacomponent.cpp @@ -32,8 +32,8 @@ namespace swift::gui::components auto area = static_cast(areaIndex); switch (area) { - case InfoAreaLog: return QSize(400, 300); - default: return QSize(400, 300); + case InfoAreaLog: return { 400, 300 }; + default: return { 400, 300 }; } } diff --git a/src/gui/components/datainfoareacomponent.cpp b/src/gui/components/datainfoareacomponent.cpp index 55c4919df7..62c14fb0b1 100644 --- a/src/gui/components/datainfoareacomponent.cpp +++ b/src/gui/components/datainfoareacomponent.cpp @@ -110,7 +110,7 @@ namespace swift::gui::components case InfoAreaModels: case InfoAreaCountries: case InfoAreaAircraftCategories: - default: return QSize(800, 600); + default: return { 800, 600 }; } } diff --git a/src/gui/components/datamaininfoareacomponent.cpp b/src/gui/components/datamaininfoareacomponent.cpp index 9d3867272c..9638366c69 100644 --- a/src/gui/components/datamaininfoareacomponent.cpp +++ b/src/gui/components/datamaininfoareacomponent.cpp @@ -75,7 +75,7 @@ namespace swift::gui::components case InfoAreaMapping: case InfoAreaSettings: case InfoAreaLog: - default: return QSize(800, 600); + default: return { 800, 600 }; } } diff --git a/src/gui/components/dbaircrafticaoselectorcomponent.cpp b/src/gui/components/dbaircrafticaoselectorcomponent.cpp index bb47986ac8..07519c5238 100644 --- a/src/gui/components/dbaircrafticaoselectorcomponent.cpp +++ b/src/gui/components/dbaircrafticaoselectorcomponent.cpp @@ -91,7 +91,7 @@ namespace swift::gui::components { const QString icaoOnly = CDatastoreUtility::stripKeyInParentheses(text); if (m_currentIcao.getDesignator() == icaoOnly) { return m_currentIcao; } - return CAircraftIcaoCode(icaoOnly); + return { icaoOnly }; } CAircraftIcaoCode icao(sGui->getWebDataServices()->getAircraftIcaoCodeForDbKey(key)); if (icao.isNull()) @@ -99,7 +99,7 @@ namespace swift::gui::components // did not find by key const QString icaoOnly = CDatastoreUtility::stripKeyInParentheses(text); if (m_currentIcao.getDesignator() == icaoOnly) { return m_currentIcao; } - return CAircraftIcaoCode(icaoOnly); + return { icaoOnly }; } return icao; } diff --git a/src/gui/components/dbautostashingcomponent.cpp b/src/gui/components/dbautostashingcomponent.cpp index fe449f5ca5..1330e838b7 100644 --- a/src/gui/components/dbautostashingcomponent.cpp +++ b/src/gui/components/dbautostashingcomponent.cpp @@ -350,7 +350,7 @@ namespace swift::gui::components swift::misc::aviation::CLivery CDbAutoStashingComponent::getTempLivery() { - if (!sGui || !sGui->hasWebDataServices()) { return CLivery(); } + if (!sGui || !sGui->hasWebDataServices()) { return {}; } return sGui->getWebDataServices()->getTempLiveryOrDefault(); } } // namespace swift::gui::components diff --git a/src/gui/components/dbcountryselectorcomponent.cpp b/src/gui/components/dbcountryselectorcomponent.cpp index 71bd9dbd66..f2a908b908 100644 --- a/src/gui/components/dbcountryselectorcomponent.cpp +++ b/src/gui/components/dbcountryselectorcomponent.cpp @@ -73,13 +73,13 @@ namespace swift::gui::components swift::misc::CCountry CDbCountrySelectorComponent::getCountry() const { - if (!sGui) { return CCountry(); } + if (!sGui) { return {}; } const QString iso(ui->le_CountryIso->text().trimmed().toUpper()); const QString name(ui->le_CountryName->text().trimmed()); if (CCountry::isValidIsoCode(iso)) { return sGui->getWebDataServices()->getCountryForIsoCode(iso); } else { - if (name.isEmpty()) { return CCountry(); } + if (name.isEmpty()) { return {}; } return sGui->getWebDataServices()->getCountryForName(name); } } diff --git a/src/gui/components/dbdistributorselectorcomponent.cpp b/src/gui/components/dbdistributorselectorcomponent.cpp index f91c62c1b5..f495c46bb7 100644 --- a/src/gui/components/dbdistributorselectorcomponent.cpp +++ b/src/gui/components/dbdistributorselectorcomponent.cpp @@ -88,9 +88,9 @@ namespace swift::gui::components CDistributor CDbDistributorSelectorComponent::getDistributor() const { - if (!sGui) { return CDistributor(); } + if (!sGui) { return {}; } const QString distributorKeyOrAlias(ui->le_Distributor->text().trimmed().toUpper()); - if (distributorKeyOrAlias.isEmpty()) { return CDistributor(); } + if (distributorKeyOrAlias.isEmpty()) { return {}; } if (m_currentDistributor.matchesKeyOrAlias(distributorKeyOrAlias)) { return m_currentDistributor; } const CDistributor d(sGui->getWebDataServices()->getDistributors().findByKey(distributorKeyOrAlias)); diff --git a/src/gui/components/dbliveryselectorcomponent.cpp b/src/gui/components/dbliveryselectorcomponent.cpp index c988d2b5a7..b1b065619f 100644 --- a/src/gui/components/dbliveryselectorcomponent.cpp +++ b/src/gui/components/dbliveryselectorcomponent.cpp @@ -98,7 +98,7 @@ namespace swift::gui::components CLivery CDbLiverySelectorComponent::getLivery() const { - if (!sGui || sGui->isShuttingDown()) { return CLivery(); } + if (!sGui || sGui->isShuttingDown()) { return {}; } const QString raw = ui->le_Livery->text(); const int dbKey = CDatastoreUtility::extractIntegerKey(raw); diff --git a/src/gui/components/dbmappingcomponent.cpp b/src/gui/components/dbmappingcomponent.cpp index beaa8de50d..8f8732bda6 100644 --- a/src/gui/components/dbmappingcomponent.cpp +++ b/src/gui/components/dbmappingcomponent.cpp @@ -233,7 +233,7 @@ namespace swift::gui::components CAircraftModel CDbMappingComponent::getModelFromView(const QModelIndex &index) const { - if (!index.isValid()) { return CAircraftModel(); } + if (!index.isValid()) { return {}; } const QObject *sender = QObject::sender(); // check if we have an explicit sender @@ -247,7 +247,7 @@ namespace swift::gui::components // no sender, use current tab const CAircraftModelView *mv = this->currentModelView(); - if (!mv) { return CAircraftModel(); } + if (!mv) { return {}; } return mv->at(index); } @@ -325,7 +325,7 @@ namespace swift::gui::components CAircraftModelList CDbMappingComponent::getSelectedModelsToStash() const { const CAircraftModelView *mv = this->currentModelView(); - if (!mv || !mv->hasSelectedModelsToStash()) { return CAircraftModelList(); } + if (!mv || !mv->hasSelectedModelsToStash()) { return {}; } return mv->selectedObjects(); } diff --git a/src/gui/components/dbownmodelsetcomponent.cpp b/src/gui/components/dbownmodelsetcomponent.cpp index d158ecf95c..1ed96968db 100644 --- a/src/gui/components/dbownmodelsetcomponent.cpp +++ b/src/gui/components/dbownmodelsetcomponent.cpp @@ -177,7 +177,7 @@ namespace swift::gui::components const CSimulatorInfo &simulator) { Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "Need single simulator"); - if (models.isEmpty()) { return CStatusMessage(this, CStatusMessage::SeverityInfo, u"No data", true); } + if (models.isEmpty()) { return { this, CStatusMessage::SeverityInfo, u"No data", true }; } if (!this->getModelSetSimulator().isSingleSimulator()) { // no sim yet, we set it @@ -186,10 +186,10 @@ namespace swift::gui::components if (simulator != this->getModelSetSimulator()) { // only currently selected sim allowed - return CStatusMessage(this, CStatusMessage::SeverityError, - u"Cannot add data for " % simulator.toQString(true) % u" to " % - this->getModelSetSimulator().toQString(true), - true); + return { this, CStatusMessage::SeverityError, + u"Cannot add data for " % simulator.toQString(true) % u" to " % + this->getModelSetSimulator().toQString(true), + true }; } const bool allowExcludedModels = m_modelSettings.get().getAllowExcludedModels(); @@ -200,12 +200,12 @@ namespace swift::gui::components if (!allowExcludedModels) { updateModels.removeIfExcluded(); } updateModels.resetOrder(); ui->tvp_OwnModelSet->updateContainerMaybeAsync(updateModels); - return CStatusMessage(this, CStatusMessage::SeverityInfo, - u"Modified " % QString::number(d) % u" entries in model set " % - this->getModelSetSimulator().toQString(true), - true); + return { this, CStatusMessage::SeverityInfo, + u"Modified " % QString::number(d) % u" entries in model set " % + this->getModelSetSimulator().toQString(true), + true }; } - else { return CStatusMessage(this, CStatusMessage::SeverityInfo, u"No data modified in model set", true); } + else { return { this, CStatusMessage::SeverityInfo, u"No data modified in model set", true }; } } void CDbOwnModelSetComponent::setMappingComponent(CDbMappingComponent *component) diff --git a/src/gui/components/dbstashcomponent.cpp b/src/gui/components/dbstashcomponent.cpp index 4876f48de4..b7fe576772 100644 --- a/src/gui/components/dbstashcomponent.cpp +++ b/src/gui/components/dbstashcomponent.cpp @@ -87,10 +87,9 @@ namespace swift::gui::components if (!allowReplace && ui->tvp_StashAircraftModels->container().containsModelStringOrDbKey(model)) { const QString msg("Model '%1' already stashed"); - return CStatusMessage(validationCategories(), CStatusMessage::SeverityError, - msg.arg(model.getModelString())); + return { validationCategories(), CStatusMessage::SeverityError, msg.arg(model.getModelString()) }; } - return CStatusMessage(); + return {}; } CStatusMessage CDbStashComponent::stashModel(const CAircraftModel &model, bool replace, bool consolidateWithDbData, @@ -114,7 +113,7 @@ namespace swift::gui::components CStatusMessageList CDbStashComponent::stashModels(const CAircraftModelList &models, bool replace, bool consolidateWithDbData, bool clearHighlighting) { - if (models.isEmpty()) { return CStatusMessageList(); } + if (models.isEmpty()) { return {}; } CStatusMessageList msgs; int successfullyAdded = 0; for (const CAircraftModel &model : models) @@ -168,7 +167,7 @@ namespace swift::gui::components CAircraftModel CDbStashComponent::getStashedModel(const QString &modelString) const { - if (modelString.isEmpty() || ui->tvp_StashAircraftModels->isEmpty()) { return CAircraftModel(); } + if (modelString.isEmpty() || ui->tvp_StashAircraftModels->isEmpty()) { return {}; } return ui->tvp_StashAircraftModels->container().findFirstByModelStringOrDefault(modelString); } @@ -304,10 +303,10 @@ namespace swift::gui::components CStatusMessageList CDbStashComponent::validate(CAircraftModelList &validModels, CAircraftModelList &invalidModels) const { - if (ui->tvp_StashAircraftModels->isEmpty()) { return CStatusMessageList(); } + if (ui->tvp_StashAircraftModels->isEmpty()) { return {}; } Q_ASSERT_X(sGui->getWebDataServices(), Q_FUNC_INFO, "No web services"); const CAircraftModelList models(getSelectedOrAllModels()); - if (models.isEmpty()) { return CStatusMessageList(); } + if (models.isEmpty()) { return {}; } const bool ignoreEqual = ui->cb_ChangedOnly->isChecked(); const CStatusMessageList msgs( sGui->getWebDataServices()->validateForPublishing(models, ignoreEqual, validModels, invalidModels)); diff --git a/src/gui/components/flightplancomponent.cpp b/src/gui/components/flightplancomponent.cpp index bd5e7ca976..ada5fb9ec4 100644 --- a/src/gui/components/flightplancomponent.cpp +++ b/src/gui/components/flightplancomponent.cpp @@ -775,7 +775,7 @@ namespace swift::gui::components CAircraftIcaoCode CFlightPlanComponent::getAircraftIcaoCode() const { const QString designator(ui->le_AircraftType->text()); - if (!CAircraftIcaoCode::isValidDesignator(designator)) { return CAircraftIcaoCode(); } + if (!CAircraftIcaoCode::isValidDesignator(designator)) { return {}; } if (sApp && sApp->hasWebDataServices()) { const CAircraftIcaoCode designatorFromDb = diff --git a/src/gui/components/maininfoareacomponent.cpp b/src/gui/components/maininfoareacomponent.cpp index 84ac64b92e..ccbe2f0e3f 100644 --- a/src/gui/components/maininfoareacomponent.cpp +++ b/src/gui/components/maininfoareacomponent.cpp @@ -91,9 +91,9 @@ namespace swift::gui::components case InfoAreaInterpolation: case InfoAreaSettings: case InfoAreaTextMessages: - case InfoAreaRadar: return QSize(600, 400); - case InfoAreaFlightPlan: return QSize(800, 600); - default: return QSize(600, 400); + case InfoAreaRadar: return { 600, 400 }; + case InfoAreaFlightPlan: return { 800, 600 }; + default: return { 600, 400 }; } } diff --git a/src/gui/components/mappingcomponent.cpp b/src/gui/components/mappingcomponent.cpp index ab20b2108a..fcc5114f37 100644 --- a/src/gui/components/mappingcomponent.cpp +++ b/src/gui/components/mappingcomponent.cpp @@ -265,7 +265,7 @@ namespace swift::gui::components { this->showOverlayMessage(CStatusMessage(this).validationError(u"Invalid callsign for mapping"), OverlayMessageMs); - return CCallsign(); + return {}; } const CCallsign callsign(cs); @@ -275,7 +275,7 @@ namespace swift::gui::components const CStatusMessage msg = CStatusMessage(this).validationError(u"Unmapped callsign '%1' for mapping") << callsign.asString(); this->showOverlayMessage(msg); - return CCallsign(); + return {}; } return callsign; } diff --git a/src/gui/components/networkdetailscomponent.cpp b/src/gui/components/networkdetailscomponent.cpp index c94d687ef0..084813255e 100644 --- a/src/gui/components/networkdetailscomponent.cpp +++ b/src/gui/components/networkdetailscomponent.cpp @@ -150,7 +150,7 @@ namespace swift::gui::components CCallsign CNetworkDetailsComponent::getPartnerCallsign() const { if (ui->le_PartnerCallsign->text().isEmpty()) { return {}; } - return CCallsign(ui->le_PartnerCallsign->text(), CCallsign::Aircraft); + return { ui->le_PartnerCallsign->text(), CCallsign::Aircraft }; } void CNetworkDetailsComponent::reloadOtherServersSetup() diff --git a/src/gui/components/serverlistselector.cpp b/src/gui/components/serverlistselector.cpp index 6653156b20..be2e06c8ee 100644 --- a/src/gui/components/serverlistselector.cpp +++ b/src/gui/components/serverlistselector.cpp @@ -39,7 +39,7 @@ namespace swift::gui::components CServer CServerListSelector::currentServer() const { const int i = currentIndex(); - if (i < 0 || i >= m_servers.size()) { return CServer(); } + if (i < 0 || i >= m_servers.size()) { return {}; } return m_servers[i]; } diff --git a/src/gui/components/settingssimulatorbasicscomponent.cpp b/src/gui/components/settingssimulatorbasicscomponent.cpp index d3f012a310..da0967f0a6 100644 --- a/src/gui/components/settingssimulatorbasicscomponent.cpp +++ b/src/gui/components/settingssimulatorbasicscomponent.cpp @@ -249,7 +249,7 @@ namespace swift::gui::components QStringList CSettingsSimulatorBasicsComponent::parseDirectories(const QString &rawString) const { const QString raw = rawString.trimmed(); - if (raw.isEmpty()) { return QStringList(); } + if (raw.isEmpty()) { return {}; } QStringList dirs; thread_local const QRegularExpression regExp("\n|\r\n|\r"); const QStringList rawLines = raw.split(regExp); diff --git a/src/gui/components/simbriefdownloaddialog.cpp b/src/gui/components/simbriefdownloaddialog.cpp index e4f0de6996..1b017560fe 100644 --- a/src/gui/components/simbriefdownloaddialog.cpp +++ b/src/gui/components/simbriefdownloaddialog.cpp @@ -20,7 +20,7 @@ namespace swift::gui::components CSimBriefData CSimBriefDownloadDialog::getSimBriefData() const { - return CSimBriefData(ui->le_SimBriefURL->text().trimmed(), ui->le_SimBriefUsername->text().trimmed()); + return { ui->le_SimBriefURL->text().trimmed(), ui->le_SimBriefUsername->text().trimmed() }; } void CSimBriefDownloadDialog::setSimBriefData(const CSimBriefData &data) diff --git a/src/gui/components/simulatorselector.cpp b/src/gui/components/simulatorselector.cpp index a96a5ecfaf..5c22e0bda8 100644 --- a/src/gui/components/simulatorselector.cpp +++ b/src/gui/components/simulatorselector.cpp @@ -80,14 +80,14 @@ namespace swift::gui::components { default: case CheckBoxes: - return CSimulatorInfo(ui->cb_FSX->isChecked(), ui->cb_FS9->isChecked(), ui->cb_XPlane->isChecked(), - ui->cb_P3D->isChecked(), ui->cb_FG->isChecked(), ui->cb_MSFS->isChecked(), - ui->cb_MSFS2024->isChecked()); + return { ui->cb_FSX->isChecked(), ui->cb_FS9->isChecked(), ui->cb_XPlane->isChecked(), + ui->cb_P3D->isChecked(), ui->cb_FG->isChecked(), ui->cb_MSFS->isChecked(), + ui->cb_MSFS2024->isChecked() }; case RadioButtons: - return CSimulatorInfo(ui->rb_FSX->isChecked(), ui->rb_FS9->isChecked(), ui->rb_XPlane->isChecked(), - ui->rb_P3D->isChecked(), ui->rb_FG->isChecked(), ui->rb_MSFS->isChecked(), - ui->rb_MSFS2024->isChecked()); - case ComboBox: return CSimulatorInfo(ui->cb_Simulators->currentText()); + return { ui->rb_FSX->isChecked(), ui->rb_FS9->isChecked(), ui->rb_XPlane->isChecked(), + ui->rb_P3D->isChecked(), ui->rb_FG->isChecked(), ui->rb_MSFS->isChecked(), + ui->rb_MSFS2024->isChecked() }; + case ComboBox: return { ui->cb_Simulators->currentText() }; } } diff --git a/src/gui/components/textmessagecomponent.cpp b/src/gui/components/textmessagecomponent.cpp index 5e2cc00c30..a30f5f7af4 100644 --- a/src/gui/components/textmessagecomponent.cpp +++ b/src/gui/components/textmessagecomponent.cpp @@ -599,7 +599,7 @@ namespace swift::gui::components CSimulatedAircraft CTextMessageComponent::getOwnAircraft() const { - if (!sGui || !sGui->getIContextOwnAircraft()) { return CSimulatedAircraft(); } + if (!sGui || !sGui->getIContextOwnAircraft()) { return {}; } return sGui->getIContextOwnAircraft()->getOwnAircraft(); } diff --git a/src/gui/dockwidget.cpp b/src/gui/dockwidget.cpp index 1bd3568e21..c7202c09f4 100644 --- a/src/gui/dockwidget.cpp +++ b/src/gui/dockwidget.cpp @@ -635,7 +635,7 @@ namespace swift::gui CDockWidgetSettings CDockWidget::getSettings() const { - if (this->objectName().isEmpty()) { return CDockWidgetSettings(); } + if (this->objectName().isEmpty()) { return {}; } // we need object name for settings %OwnerName%" const CDockWidgetSettings s = m_settings.get(); diff --git a/src/gui/ecosystemcombobox.cpp b/src/gui/ecosystemcombobox.cpp index 7ca6fac1e1..f3013a0452 100644 --- a/src/gui/ecosystemcombobox.cpp +++ b/src/gui/ecosystemcombobox.cpp @@ -19,7 +19,7 @@ namespace swift::gui CEcosystem CEcosystemComboBox::getSelectedEcosystem() const { - if (this->currentIndex() < 0 || this->currentIndex() >= m_systems.size()) { return CEcosystem(); } + if (this->currentIndex() < 0 || this->currentIndex() >= m_systems.size()) { return {}; } return m_systems[this->currentIndex()]; } diff --git a/src/gui/editors/form.cpp b/src/gui/editors/form.cpp index a7f6617422..6b30437ef0 100644 --- a/src/gui/editors/form.cpp +++ b/src/gui/editors/form.cpp @@ -23,7 +23,7 @@ namespace swift::gui::editors CStatusMessageList CForm::validate(bool withNestedObjects) const { Q_UNUSED(withNestedObjects); - return CStatusMessageList(); + return {}; } CStatusMessageList CForm::validateAsOverlayMessage(bool withNestedObjects, bool appendOldMessages, diff --git a/src/gui/editors/interpolationsetupform.cpp b/src/gui/editors/interpolationsetupform.cpp index 8bd7fb8fd6..57687f30ee 100644 --- a/src/gui/editors/interpolationsetupform.cpp +++ b/src/gui/editors/interpolationsetupform.cpp @@ -76,7 +76,7 @@ namespace swift::gui::editors CStatusMessageList CInterpolationSetupForm::validate(bool nested) const { Q_UNUSED(nested) - return CStatusMessageList(); + return {}; } void CInterpolationSetupForm::onCheckboxChanged(Qt::CheckState state) diff --git a/src/gui/editors/matchingform.cpp b/src/gui/editors/matchingform.cpp index 7468e7a060..f04b5cb502 100644 --- a/src/gui/editors/matchingform.cpp +++ b/src/gui/editors/matchingform.cpp @@ -86,7 +86,7 @@ namespace swift::gui::editors CStatusMessageList CMatchingForm::validate(bool withNestedForms) const { Q_UNUSED(withNestedForms) - return CStatusMessageList(); + return {}; } void CMatchingForm::setValue(const CAircraftMatcherSetup &setup) diff --git a/src/gui/editors/modelmappingform.cpp b/src/gui/editors/modelmappingform.cpp index ae78c0763c..e519c25c32 100644 --- a/src/gui/editors/modelmappingform.cpp +++ b/src/gui/editors/modelmappingform.cpp @@ -115,7 +115,7 @@ namespace swift::gui::editors bool ok; const double cgv = v.toDouble(&ok); if (!ok) { return CLength::null(); } - return CLength(cgv, CLengthUnit::ft()); + return { cgv, CLengthUnit::ft() }; } CLength cg; diff --git a/src/gui/editors/ownmodelsetform.cpp b/src/gui/editors/ownmodelsetform.cpp index 052b5a7a31..9a93fe6b68 100644 --- a/src/gui/editors/ownmodelsetform.cpp +++ b/src/gui/editors/ownmodelsetform.cpp @@ -143,7 +143,7 @@ namespace swift::gui::editors if (ui->rb_DistributorsSelected->isChecked()) { return this->getSelectedDistributors(); } if (ui->rb_DistributorsFromBelow->isChecked()) { return this->getShownDistributors(); } Q_ASSERT_X(false, Q_FUNC_INFO, "Wrong option"); - return CDistributorList(); + return {}; } bool COwnModelSetForm::optionDbIcaoCodesOnly() const { return ui->rb_DbIcaoCodesOnly->isChecked(); } diff --git a/src/gui/editors/pbhsform.cpp b/src/gui/editors/pbhsform.cpp index 54ffccc932..1631ae7a88 100644 --- a/src/gui/editors/pbhsform.cpp +++ b/src/gui/editors/pbhsform.cpp @@ -37,7 +37,7 @@ namespace swift::gui::editors CPbhsForm::~CPbhsForm() = default; - CAngle CPbhsForm::getBankAngle() const { return CAngle(getBankAngleDegrees(), CAngleUnit::deg()); } + CAngle CPbhsForm::getBankAngle() const { return { getBankAngleDegrees(), CAngleUnit::deg() }; } void CPbhsForm::setBankAngle(const CAngle &angle) { @@ -55,7 +55,7 @@ namespace swift::gui::editors return CAngle::normalizeDegrees180(vd, RoundDigits); } - CAngle CPbhsForm::getPitchAngle() const { return CAngle(getPitchAngleDegrees(), CAngleUnit::deg()); } + CAngle CPbhsForm::getPitchAngle() const { return { getPitchAngleDegrees(), CAngleUnit::deg() }; } void CPbhsForm::setPitchAngle(const CAngle &angle) { @@ -73,9 +73,9 @@ namespace swift::gui::editors return CAngle::normalizeDegrees180(vd, RoundDigits); } - CAngle CPbhsForm::getHeadingAngle() const { return CAngle(getHeadingAngleDegrees(), CAngleUnit::deg()); } + CAngle CPbhsForm::getHeadingAngle() const { return { getHeadingAngleDegrees(), CAngleUnit::deg() }; } - CHeading CPbhsForm::getHeading() const { return CHeading(this->getHeadingAngle(), CHeading::True); } + CHeading CPbhsForm::getHeading() const { return { this->getHeadingAngle(), CHeading::True }; } void CPbhsForm::setHeadingAngle(const CAngle &angle) { @@ -96,7 +96,7 @@ namespace swift::gui::editors CSpeed CPbhsForm::getGroundSpeed() const { const int gsKts = ui->sb_GsKts->value(); - return CSpeed(gsKts, CSpeedUnit::kts()); + return { static_cast(gsKts), CSpeedUnit::kts() }; } void CPbhsForm::setSituation(const CAircraftSituation &situation) diff --git a/src/gui/editors/situationform.cpp b/src/gui/editors/situationform.cpp index 0d2d19dca6..faf27c8ac4 100644 --- a/src/gui/editors/situationform.cpp +++ b/src/gui/editors/situationform.cpp @@ -78,7 +78,7 @@ namespace swift::gui::editors return s; } - CAngle CSituationForm::getBankAngle() const { return CAngle(getBankAngleDegrees(), CAngleUnit::deg()); } + CAngle CSituationForm::getBankAngle() const { return { getBankAngleDegrees(), CAngleUnit::deg() }; } double CSituationForm::getBankAngleDegrees() const { @@ -89,7 +89,7 @@ namespace swift::gui::editors return CAngle::normalizeDegrees180(vd, RoundDigits); } - CAngle CSituationForm::getPitchAngle() const { return CAngle(getPitchAngleDegrees(), CAngleUnit::deg()); } + CAngle CSituationForm::getPitchAngle() const { return { getPitchAngleDegrees(), CAngleUnit::deg() }; } double CSituationForm::getPitchAngleDegrees() const { @@ -100,7 +100,7 @@ namespace swift::gui::editors return CAngle::normalizeDegrees180(vd, RoundDigits); } - CAngle CSituationForm::getHeadingAngle() const { return CAngle(getHeadingAngleDegrees(), CAngleUnit::deg()); } + CAngle CSituationForm::getHeadingAngle() const { return { getHeadingAngleDegrees(), CAngleUnit::deg() }; } double CSituationForm::getHeadingAngleDegrees() const { @@ -122,13 +122,13 @@ namespace swift::gui::editors CPressure CSituationForm::getBarometricPressureMsl() const { - return CPressure(this->getBarometricPressureMslMillibar(), CPressureUnit::mbar()); + return { this->getBarometricPressureMslMillibar(), CPressureUnit::mbar() }; } CSpeed CSituationForm::getGroundSpeed() const { const int gsKts = ui->sb_GsKts->value(); - return CSpeed(gsKts, CSpeedUnit::kts()); + return { static_cast(gsKts), CSpeedUnit::kts() }; } void CSituationForm::setReadOnly(bool readonly) diff --git a/src/gui/guiutility.cpp b/src/gui/guiutility.cpp index 2072c2bfe6..2a7dfdc7bb 100644 --- a/src/gui/guiutility.cpp +++ b/src/gui/guiutility.cpp @@ -167,11 +167,11 @@ namespace swift::gui #ifdef Q_OS_WINDOWS return Private::windowsGetDesktopResolution(); #elif defined(Q_OS_MAC) - return QSize(); + return {}; #elif defined(Q_OS_LINUX) - return QSize(); + return {}; #else - return QSize(); + return {}; #endif } @@ -367,24 +367,24 @@ namespace swift::gui CVariant CGuiUtility::fromSwiftDragAndDropData(const QMimeData *mime) { - if (!hasSwiftVariantMimeType(mime)) { return CVariant(); } + if (!hasSwiftVariantMimeType(mime)) { return {}; } return CGuiUtility::fromSwiftDragAndDropData(mime->data(swiftJsonDragAndDropMimeType())); } CVariant CGuiUtility::fromSwiftDragAndDropData(const QByteArray &utf8Data) { - if (utf8Data.isEmpty()) { return CVariant(); } + if (utf8Data.isEmpty()) { return {}; } const QJsonDocument jsonDoc(QJsonDocument::fromJson(utf8Data)); const QJsonObject jsonObj(jsonDoc.object()); const QString typeName(jsonObj.value("type").toString()); const int typeId = QMetaType::fromName(qPrintable(typeName)).id(); // check if a potential valid value object - if (typeName.isEmpty() || typeId == QMetaType::UnknownType) { return CVariant(); } + if (typeName.isEmpty() || typeId == QMetaType::UnknownType) { return {}; } CVariant valueVariant; const CStatusMessage status = valueVariant.convertFromJsonNoThrow(jsonObj, {}, {}); - if (status.isFailure()) { return CVariant(); } + if (status.isFailure()) { return {}; } return valueVariant; } @@ -409,9 +409,9 @@ namespace swift::gui QFileInfo CGuiUtility::representedMimeFile(const QMimeData *mime) { - if (!mime->hasText()) { return QFileInfo(); } + if (!mime->hasText()) { return {}; } const QString candidate = mime->text(); - if (candidate.isEmpty()) { return QFileInfo(); } + if (candidate.isEmpty()) { return {}; } if (!candidate.contains("://")) { return QFileInfo(candidate); } QUrl url(candidate); const QString localFile = url.toLocalFile(); @@ -515,7 +515,7 @@ namespace swift::gui // fallback, can be mfw it is not found CEnableForFramelessWindow *mfw = CGuiUtility::mainFramelessEnabledWindow(); - if (!mfw || !mfw->getWidget()) { return QPoint(); } + if (!mfw || !mfw->getWidget()) { return {}; } return mfw->getWidget()->pos(); // is main window, so not mapToGlobal } @@ -631,7 +631,7 @@ namespace swift::gui const int b = parts.at(3).toInt(&ok); Q_ASSERT_X(ok, Q_FUNC_INFO, "malformed number"); Q_UNUSED(ok) - return QMargins(l, t, r, b); + return { l, t, r, b }; } QList CGuiUtility::indexToUniqueRows(const QModelIndexList &indexes) @@ -763,7 +763,7 @@ namespace swift::gui const QSizeF s = s1 + s2; const qreal w = s.width() * xCharacters / 123; // 123 chars const qreal h = s.height() * yCharacters / 2; // 2 lines - return QSizeF(w, h); + return { w, h }; } void CGuiUtility::centerWidget(QWidget *widget) diff --git a/src/gui/loadindicator.cpp b/src/gui/loadindicator.cpp index 88c544bc01..4b34b5f50c 100644 --- a/src/gui/loadindicator.cpp +++ b/src/gui/loadindicator.cpp @@ -109,7 +109,7 @@ namespace swift::gui update(); } - QSize CLoadIndicator::sizeHint() const { return QSize(64, 64); } + QSize CLoadIndicator::sizeHint() const { return { 64, 64 }; } int CLoadIndicator::heightForWidth(int w) const { return w; } diff --git a/src/gui/menus/menuaction.cpp b/src/gui/menus/menuaction.cpp index f650a6befa..a9ec4a73de 100644 --- a/src/gui/menus/menuaction.cpp +++ b/src/gui/menus/menuaction.cpp @@ -59,7 +59,7 @@ namespace swift::gui::menus QPixmap CMenuAction::getPixmap() const { - if (m_icon.isNull()) { return QPixmap(); } + if (m_icon.isNull()) { return {}; } return m_icon.pixmap(m_icon.actualSize(QSize(16, 16))); } @@ -233,7 +233,7 @@ namespace swift::gui::menus CMenuActions CMenuActions::addActions(const QList &actions, const QString &path) { - if (actions.isEmpty()) { return CMenuActions(); } + if (actions.isEmpty()) { return {}; } CMenuAction menuAction; CMenuActions menuActions; for (QAction *a : actions) @@ -421,19 +421,19 @@ namespace swift::gui::menus CMenuAction CMenuActions::addMenuViewOrder() { - if (this->containsMenu(CMenuAction::pathViewOrder())) { return CMenuAction(); } + if (this->containsMenu(CMenuAction::pathViewOrder())) { return {}; } return this->addMenu(CIcons::arrowMediumEast16(), "Order", CMenuAction::pathViewOrder()); } CMenuAction CMenuActions::addMenuSimulator() { - if (this->containsMenu(CMenuAction::pathSimulator())) { return CMenuAction(); } + if (this->containsMenu(CMenuAction::pathSimulator())) { return {}; } return this->addMenu(CIcons::appSimulator16(), "Simulator", CMenuAction::pathSimulator()); } CMenuAction CMenuActions::addMenuStash() { - if (this->containsMenu(CMenuAction::pathModelStash())) { return CMenuAction(); } + if (this->containsMenu(CMenuAction::pathModelStash())) { return {}; } const bool canConnectDb = sGui && sGui->getWebDataServices() && sGui->getWebDataServices()->hasSuccesfullyConnectedSwiftDb(); const QString text(canConnectDb ? "Stash tools" : "Stash tools (Warning: no DB!)"); @@ -442,49 +442,49 @@ namespace swift::gui::menus CMenuAction CMenuActions::addMenuStashEditor() { - if (this->containsMenu(CMenuAction::pathModelStashEditor())) { return CMenuAction(); } + if (this->containsMenu(CMenuAction::pathModelStashEditor())) { return {}; } return this->addMenu(CIcons::appDbStash16(), "Edit models", CMenuAction::pathModelStashEditor()); } CMenuAction CMenuActions::addMenuDatabase() { - if (this->containsMenu(CMenuAction::pathViewDatabase())) { return CMenuAction(); } + if (this->containsMenu(CMenuAction::pathViewDatabase())) { return {}; } return this->addMenu(CMenuAction::subMenuDatabase()); } CMenuAction CMenuActions::addMenuConsolidateModels() { - if (this->containsMenu(CMenuAction::pathModelConsolidate())) { return CMenuAction(); } + if (this->containsMenu(CMenuAction::pathModelConsolidate())) { return {}; } return this->addMenu(CMenuAction::subMenuConsolidateModels()); } CMenuAction CMenuActions::addMenuModelSet() { - if (this->containsMenu(CMenuAction::pathModelSet())) { return CMenuAction(); } + if (this->containsMenu(CMenuAction::pathModelSet())) { return {}; } return this->addMenu(CIcons::appModels16(), "Model set", CMenuAction::pathModelSet()); } CMenuAction CMenuActions::addMenuCom() { - if (this->containsMenu(CMenuAction::subMenuCom().getPath())) { return CMenuAction(); } + if (this->containsMenu(CMenuAction::subMenuCom().getPath())) { return {}; } return this->addAction(CMenuAction::subMenuCom()); } CMenuAction CMenuActions::addMenuDisplayModels() { - if (this->containsMenu(CMenuAction::subMenuDisplayModels().getPath())) { return CMenuAction(); } + if (this->containsMenu(CMenuAction::subMenuDisplayModels().getPath())) { return {}; } return this->addAction(CMenuAction::subMenuDisplayModels()); } CMenuAction CMenuActions::addMenuRenderModels() { - if (this->containsMenu(CMenuAction::subMenuRenderModels().getPath())) { return CMenuAction(); } + if (this->containsMenu(CMenuAction::subMenuRenderModels().getPath())) { return {}; } return this->addAction(CMenuAction::subMenuRenderModels()); } CMenuAction CMenuActions::addMenuDataTransfer() { - if (this->containsMenu(CMenuAction::subMenuDataTransfer().getPath())) { return CMenuAction(); } + if (this->containsMenu(CMenuAction::subMenuDataTransfer().getPath())) { return {}; } return this->addAction(CMenuAction::subMenuDataTransfer()); } diff --git a/src/gui/models/actionhotkeylistmodel.cpp b/src/gui/models/actionhotkeylistmodel.cpp index 739be42f1c..446a04c80b 100644 --- a/src/gui/models/actionhotkeylistmodel.cpp +++ b/src/gui/models/actionhotkeylistmodel.cpp @@ -24,8 +24,8 @@ namespace swift::gui::models QVariant CActionHotkeyListModel::data(const QModelIndex &index, int role) const { - if (!index.isValid()) { return QVariant(); } - if (index.row() >= m_actionHotkeys.size() || index.row() < 0) { return QVariant(); } + if (!index.isValid()) { return {}; } + if (index.row() >= m_actionHotkeys.size() || index.row() < 0) { return {}; } if (role == Qt::DisplayRole) { diff --git a/src/gui/models/actionmodel.cpp b/src/gui/models/actionmodel.cpp index b2d434d9d4..69c3a380cd 100644 --- a/src/gui/models/actionmodel.cpp +++ b/src/gui/models/actionmodel.cpp @@ -33,7 +33,7 @@ namespace swift::gui::models QVariant CActionModel::data(const QModelIndex &index, int role) const { - if (!index.isValid()) { return QVariant(); } + if (!index.isValid()) { return {}; } const CActionItem *item = static_cast(index.internalPointer()); Q_ASSERT_X(item, Q_FUNC_INFO, "Missing item"); @@ -56,7 +56,7 @@ namespace swift::gui::models QModelIndex CActionModel::index(int row, int column, const QModelIndex &parent) const { - if (!hasIndex(row, column, parent)) { return QModelIndex(); } + if (!hasIndex(row, column, parent)) { return {}; } const CActionItem *parentItem = parent.isValid() ? static_cast(parent.internalPointer()) : m_rootItem.data(); diff --git a/src/gui/models/aircraftmodellistmodel.cpp b/src/gui/models/aircraftmodellistmodel.cpp index 92cd78989f..1031b9ff51 100644 --- a/src/gui/models/aircraftmodellistmodel.cpp +++ b/src/gui/models/aircraftmodellistmodel.cpp @@ -237,7 +237,7 @@ namespace swift::gui::models QStringList CAircraftModelListModel::getModelStrings(bool sort) const { - if (this->isEmpty()) { return QStringList(); } + if (this->isEmpty()) { return {}; } return this->container().getModelStringList(sort); } @@ -263,7 +263,7 @@ namespace swift::gui::models // highlight stashed first if (m_highlightStrings.contains(model.getModelString(), Qt::CaseInsensitive)) { return m_highlightColor; } - return QVariant(); + return {}; } else if (role == Qt::ToolTipRole) { diff --git a/src/gui/models/clientlistmodel.cpp b/src/gui/models/clientlistmodel.cpp index 925672a7f1..a83951fbad 100644 --- a/src/gui/models/clientlistmodel.cpp +++ b/src/gui/models/clientlistmodel.cpp @@ -53,14 +53,14 @@ namespace swift::gui::models // no model string for ATC const CClient client = this->at(index); const bool atc = client.isAtc(); - if (atc) { return QVariant("ATC"); } + if (atc) { return { "ATC" }; } } else if (pi == qf && role == Qt::DecorationRole) { // no symbol for ATC const CClient client = this->at(index); const bool atc = client.isAtc(); - if (atc) { return QVariant(); } + if (atc) { return {}; } } return CListModelBase::data(index, role); } diff --git a/src/gui/models/columnformatters.cpp b/src/gui/models/columnformatters.cpp index 77f5f367ea..c0b282a453 100644 --- a/src/gui/models/columnformatters.cpp +++ b/src/gui/models/columnformatters.cpp @@ -95,7 +95,7 @@ namespace swift::gui::models CVariant CDefaultFormatter::data(int role, const CVariant &inputData) const { - if (!this->supportsRole(role)) { return CVariant(); } + if (!this->supportsRole(role)) { return {}; } const auto roleEnum = static_cast(role); // always supported @@ -112,7 +112,7 @@ namespace swift::gui::models case Qt::CheckStateRole: return checkStateRole(inputData); // as Qt check state default: break; } - return CVariant(); + return {}; } int CDefaultFormatter::alignDefault() { return alignLeftVCenter(); } @@ -180,12 +180,12 @@ namespace swift::gui::models CVariant CValueObjectFormatter::displayRole(const CVariant &valueObject) const { - return CVariant(valueObject.toQString(m_useI18n)); + return { valueObject.toQString(m_useI18n) }; } CVariant CValueObjectFormatter::decorationRole(const CVariant &valueObject) const { - return CVariant(valueObject.toPixmap()); + return { valueObject.toPixmap() }; } CDateTimeFormatter::CDateTimeFormatter(const QString &formatString, int alignment, bool i18n) @@ -292,7 +292,7 @@ namespace swift::gui::models return v ? CVariant(m_trueNameVariant) : CVariant(m_falseNameVariant); } Q_ASSERT_X(false, "CBoolTextFormatter", "no boolean value"); - return CVariant(); + return {}; } Qt::ItemFlags CBoolTextFormatter::flags(Qt::ItemFlags flags, bool editable) const @@ -317,7 +317,7 @@ namespace swift::gui::models { Q_UNUSED(dataCVariant); Q_ASSERT_X(false, Q_FUNC_INFO, "this role should be disabled with led boolean"); - return CVariant(); + return {}; } CVariant CBoolLedFormatter::decorationRole(const CVariant &dataCVariant) const @@ -328,7 +328,7 @@ namespace swift::gui::models return v ? m_pixmapOnLedVariant : m_pixmapOffLedVariant; } Q_ASSERT_X(false, "CBoolLedFormatter", "no boolean value"); - return CVariant(); + return {}; } CBoolIconFormatter::CBoolIconFormatter(int alignment) @@ -355,7 +355,7 @@ namespace swift::gui::models { Q_UNUSED(dataCVariant) Q_ASSERT_X(false, "CBoolIconFormatter", "this role should be disabled with icon boolean"); - return CVariant(); + return {}; } CVariant CBoolIconFormatter::decorationRole(const CVariant &dataCVariant) const @@ -366,7 +366,7 @@ namespace swift::gui::models return v ? m_iconOnVariant : m_iconOffVariant; } Q_ASSERT_X(false, "CBoolIconFormatter", "no boolean value"); - return CVariant(); + return {}; } CVariant CBoolIconFormatter::tooltipRole(const CVariant &dataCVariant) const @@ -390,7 +390,7 @@ namespace swift::gui::models { Q_UNUSED(dataCVariant) Q_ASSERT_X(false, Q_FUNC_INFO, "this role should be disabled with RGB color"); - return CVariant(); + return {}; } CVariant CColorFormatter::decorationRole(const CVariant &dataCVariant) const @@ -430,7 +430,7 @@ namespace swift::gui::models const int i = expectedInteger.toInt(&ok); if (ok) { return QString::number(i); } - return CVariant(); + return {}; } CVariant CEmptyFormatter::displayRole(const CVariant &dataCVariant) const diff --git a/src/gui/models/columns.cpp b/src/gui/models/columns.cpp index 8f1f35888c..3fa92466d9 100644 --- a/src/gui/models/columns.cpp +++ b/src/gui/models/columns.cpp @@ -45,35 +45,35 @@ namespace swift::gui::models CColumn CColumn::standardValueObject(const QString &headerName, const CPropertyIndex &propertyIndex, int alignment) { - return CColumn(headerName, propertyIndex, new CValueObjectFormatter(alignment)); + return { headerName, propertyIndex, new CValueObjectFormatter(alignment) }; } CColumn CColumn::standardValueObject(const QString &headerName, const QString &toolTip, const CPropertyIndex &propertyIndex, int alignment) { - return CColumn(headerName, toolTip, propertyIndex, new CValueObjectFormatter(alignment)); + return { headerName, toolTip, propertyIndex, new CValueObjectFormatter(alignment) }; } CColumn CColumn::standardString(const QString &headerName, const CPropertyIndex &propertyIndex, int alignment) { - return CColumn(headerName, propertyIndex, new CStringFormatter(alignment)); + return { headerName, propertyIndex, new CStringFormatter(alignment) }; } CColumn CColumn::standardString(const QString &headerName, const QString &toolTip, const CPropertyIndex &propertyIndex, int alignment) { - return CColumn(headerName, toolTip, propertyIndex, new CStringFormatter(alignment)); + return { headerName, toolTip, propertyIndex, new CStringFormatter(alignment) }; } CColumn CColumn::orderColumn(const CPropertyIndex &propertyIndex, int alignment) { - return CColumn("#", "order", propertyIndex, new CStringFormatter(alignment)); + return { "#", "order", propertyIndex, new CStringFormatter(alignment) }; } CColumn CColumn::standardInteger(const QString &headerName, const QString &toolTip, const CPropertyIndex &propertyIndex, int alignment) { - return CColumn(headerName, toolTip, propertyIndex, new CIntegerFormatter(alignment)); + return { headerName, toolTip, propertyIndex, new CIntegerFormatter(alignment) }; } CColumn CColumn::emptyColumn() @@ -137,7 +137,7 @@ namespace swift::gui::models Q_ASSERT(isValidColumn(column)); const CColumn col = m_columns[column]; Q_ASSERT(col.isSortable()); - if (!col.isSortable()) { return CPropertyIndex(); } + if (!col.isSortable()) { return {}; } if (col.hasSortPropertyIndex()) { return col.getSortPropertyIndex(); } return col.getPropertyIndex(); } diff --git a/src/gui/models/listmodelbase.cpp b/src/gui/models/listmodelbase.cpp index 13fe194116..84e047d6be 100644 --- a/src/gui/models/listmodelbase.cpp +++ b/src/gui/models/listmodelbase.cpp @@ -79,7 +79,7 @@ namespace swift::gui::models QVariant CListModelBase::data(const QModelIndex &index, int role) const { // check / init - if (!this->isValidIndex(index)) { return QVariant(); } + if (!this->isValidIndex(index)) { return {}; } if (role == Qt::BackgroundRole) { return CListModelBaseNonTemplate::data(index, role); } diff --git a/src/gui/models/listmodelbasenontemplate.cpp b/src/gui/models/listmodelbasenontemplate.cpp index d572771ed4..6298bb2522 100644 --- a/src/gui/models/listmodelbasenontemplate.cpp +++ b/src/gui/models/listmodelbasenontemplate.cpp @@ -21,14 +21,14 @@ namespace swift::gui::models QVariant CListModelBaseNonTemplate::headerData(int section, Qt::Orientation orientation, int role) const { - if (orientation != Qt::Horizontal) { return QVariant(); } + if (orientation != Qt::Horizontal) { return {}; } const bool handled = (role == Qt::DisplayRole || role == Qt::ToolTipRole || role == Qt::InitialSortOrderRole); - if (!handled) { return QVariant(); } - if (section < 0 || section >= m_columns.size()) { return QVariant(); } + if (!handled) { return {}; } + if (section < 0 || section >= m_columns.size()) { return {}; } - if (role == Qt::DisplayRole) { return QVariant(m_columns.at(section).getColumnName()); } - if (role == Qt::ToolTipRole) { return QVariant(m_columns.at(section).getColumnToolTip()); } - return QVariant(); + if (role == Qt::DisplayRole) { return { m_columns.at(section).getColumnName() }; } + if (role == Qt::ToolTipRole) { return { m_columns.at(section).getColumnToolTip() }; } + return {}; } QModelIndex CListModelBaseNonTemplate::index(int row, int column, const QModelIndex &parent) const @@ -40,7 +40,7 @@ namespace swift::gui::models QModelIndex CListModelBaseNonTemplate::parent(const QModelIndex &child) const { Q_UNUSED(child) - return QModelIndex(); + return {}; } CPropertyIndex CListModelBaseNonTemplate::columnToPropertyIndex(int column) const diff --git a/src/gui/models/listmodelcallsignobjects.cpp b/src/gui/models/listmodelcallsignobjects.cpp index 3fb6b9e5df..198c411268 100644 --- a/src/gui/models/listmodelcallsignobjects.cpp +++ b/src/gui/models/listmodelcallsignobjects.cpp @@ -34,7 +34,7 @@ namespace swift::gui::models swift::misc::aviation::CCallsign CListModelCallsignObjects::callsignForIndex(const QModelIndex &index) const { - if (!index.isValid()) { return CCallsign(); } + if (!index.isValid()) { return {}; } return this->at(index).getCallsign(); } diff --git a/src/gui/overlaymessagesframe.h b/src/gui/overlaymessagesframe.h index bef61bbb7a..971384efe4 100644 --- a/src/gui/overlaymessagesframe.h +++ b/src/gui/overlaymessagesframe.h @@ -364,7 +364,7 @@ namespace swift::gui int hInner = qRound(heightFactor * h); if (wInner > WIDGET::maximumWidth()) { wInner = WIDGET::maximumWidth(); } if (hInner > WIDGET::maximumHeight()) { hInner = WIDGET::maximumHeight(); } - return QSize(wInner, hInner); + return { wInner, hInner }; } bool m_forceSmallMsgs = false; //!< force small messages diff --git a/src/gui/sharedstringlistcompleter.cpp b/src/gui/sharedstringlistcompleter.cpp index 76b0841de7..6e11f48d62 100644 --- a/src/gui/sharedstringlistcompleter.cpp +++ b/src/gui/sharedstringlistcompleter.cpp @@ -39,7 +39,7 @@ namespace swift::gui QStringList CSharedStringListCompleter::stringList() const { const QStringListModel *model = this->getCompleterModel(); - if (!model) { return QStringList(); } + if (!model) { return {}; } return model->stringList(); } diff --git a/src/gui/stylesheetutility.cpp b/src/gui/stylesheetutility.cpp index 5da6b0b6e7..ef0bcce4b9 100644 --- a/src/gui/stylesheetutility.cpp +++ b/src/gui/stylesheetutility.cpp @@ -186,7 +186,7 @@ namespace swift::gui QString CStyleSheetUtility::style(const QString &fileName) const { - if (!this->containsStyle(fileName)) { return QString(); } + if (!this->containsStyle(fileName)) { return {}; } return m_styleSheets[fileName.toLower()].trimmed(); } diff --git a/src/gui/views/aircraftcategorytreeview.cpp b/src/gui/views/aircraftcategorytreeview.cpp index 94dcff112b..797fd454b9 100644 --- a/src/gui/views/aircraftcategorytreeview.cpp +++ b/src/gui/views/aircraftcategorytreeview.cpp @@ -74,7 +74,7 @@ namespace swift::gui::views CAircraftCategory CAircraftCategoryTreeView::selectedObject() const { const CAircraftCategoryTreeModel *model = this->categoryModel(); - if (!model) { return CAircraftCategory(); } + if (!model) { return {}; } return model->container().frontOrDefault(); } diff --git a/src/gui/views/aircraftmodelview.cpp b/src/gui/views/aircraftmodelview.cpp index 69a3506aee..d6d77c859e 100644 --- a/src/gui/views/aircraftmodelview.cpp +++ b/src/gui/views/aircraftmodelview.cpp @@ -390,7 +390,7 @@ namespace swift::gui::views CStatusMessage CAircraftModelView::modifyLoadedJsonData(CAircraftModelList &models) const { if (m_correspondingSimulator.isNoSimulator()) { return {}; } - if (models.isEmpty()) { return CStatusMessage(this, CStatusMessage::SeverityDebug, u"Empty models", true); } + if (models.isEmpty()) { return { this, CStatusMessage::SeverityDebug, u"Empty models", true }; } // multiple sims with same count const int removed = models.removeIfNotMatchingSimulator(m_correspondingSimulator); diff --git a/src/gui/views/atcstationtreeview.cpp b/src/gui/views/atcstationtreeview.cpp index 680051fc09..0954491d23 100644 --- a/src/gui/views/atcstationtreeview.cpp +++ b/src/gui/views/atcstationtreeview.cpp @@ -86,7 +86,7 @@ namespace swift::gui::views const QVariant data = this->model()->data(index.siblingAtColumn(0)); // supposed to be the callsign const QString callsign = data.toString(); const CAtcStationTreeModel *model = this->stationModel(); - if (!model) { return CAtcStation(); } + if (!model) { return {}; } return model->container().findFirstByCallsign(CCallsign(callsign, CCallsign::Atc)); } diff --git a/src/gui/views/viewcallsignobjects.cpp b/src/gui/views/viewcallsignobjects.cpp index 0d5abc5bab..e5c0c41e8f 100644 --- a/src/gui/views/viewcallsignobjects.cpp +++ b/src/gui/views/viewcallsignobjects.cpp @@ -53,7 +53,7 @@ namespace swift::gui::views template CCallsignSet CViewWithCallsignObjects::selectedCallsigns() const { - if (!this->hasSelection()) { return CCallsignSet(); } + if (!this->hasSelection()) { return {}; } const ContainerType selected(this->selectedObjects()); return selected.getCallsigns(); } diff --git a/src/misc/audio/audiodeviceinfolist.cpp b/src/misc/audio/audiodeviceinfolist.cpp index 7c332f0a4d..ddd33ad2d6 100644 --- a/src/misc/audio/audiodeviceinfolist.cpp +++ b/src/misc/audio/audiodeviceinfolist.cpp @@ -175,12 +175,12 @@ namespace swift::misc::audio CAudioDeviceInfo CAudioDeviceInfoList::defaultInputDevice() { - return CAudioDeviceInfo(CAudioDeviceInfo::InputDevice, defaultQtInputDevice().description()); + return { CAudioDeviceInfo::InputDevice, defaultQtInputDevice().description() }; } CAudioDeviceInfo CAudioDeviceInfoList::defaultOutputDevice() { - return CAudioDeviceInfo(CAudioDeviceInfo::OutputDevice, defaultQtOutputDevice().description()); + return { CAudioDeviceInfo::OutputDevice, defaultQtOutputDevice().description() }; } } // namespace swift::misc::audio diff --git a/src/misc/aviation/aircraftcategorylist.cpp b/src/misc/aviation/aircraftcategorylist.cpp index 59e75f89b8..22df56bf4f 100644 --- a/src/misc/aviation/aircraftcategorylist.cpp +++ b/src/misc/aviation/aircraftcategorylist.cpp @@ -66,7 +66,7 @@ namespace swift::misc::aviation CAircraftCategoryList CAircraftCategoryList::findHighestLevels(const CAircraftCategoryList &categories) { - if (categories.isEmpty()) { return CAircraftCategoryList(); } + if (categories.isEmpty()) { return {}; } QMap highestLevels; for (const CAircraftCategory &category : *this) { diff --git a/src/misc/aviation/aircrafticaocode.cpp b/src/misc/aviation/aircrafticaocode.cpp index 0ba3621b46..9a7abbaa63 100644 --- a/src/misc/aviation/aircrafticaocode.cpp +++ b/src/misc/aviation/aircrafticaocode.cpp @@ -368,7 +368,7 @@ namespace swift::misc::aviation { const QString et = this->getEngineType(); if (et.length() == 1) { return et[0]; } - return QChar(); + return {}; } int CAircraftIcaoCode::getEnginesCount() const @@ -819,7 +819,7 @@ namespace swift::misc::aviation { "L1P", "L2P" }, { "L1P", "S1P" }, { "L2J", "L3J" }, { "L2J", "L4J" }, { "L3J", "L4J" } }; - if (isValidCombinedType(combinedCode)) { return QStringList(); } + if (isValidCombinedType(combinedCode)) { return {}; } if (knownCodes.contains(combinedCode)) { return knownCodes.values(combinedCode); } // turn E to P engine @@ -873,7 +873,7 @@ namespace swift::misc::aviation if (!existsKey(json, prefix)) { // when using relationship, this can be null - return CAircraftIcaoCode(); + return {}; } const int engineCount(json.value(prefix % u"enginecount").toInt(-1)); diff --git a/src/misc/aviation/aircrafticaocodelist.cpp b/src/misc/aviation/aircrafticaocodelist.cpp index 6a999931e5..8e8dd7cb1f 100644 --- a/src/misc/aviation/aircrafticaocodelist.cpp +++ b/src/misc/aviation/aircrafticaocodelist.cpp @@ -23,18 +23,15 @@ namespace swift::misc::aviation CAircraftIcaoCodeList CAircraftIcaoCodeList::findByDesignator(const QString &designator, int fuzzySearch) const { - if (!fuzzySearch && !CAircraftIcaoCode::isValidDesignator(designator)) { return CAircraftIcaoCodeList(); } - if (fuzzySearch && designator.length() < CAircraftIcaoCode::DesignatorMinLength) - { - return CAircraftIcaoCodeList(); - } + if (!fuzzySearch && !CAircraftIcaoCode::isValidDesignator(designator)) { return {}; } + if (fuzzySearch && designator.length() < CAircraftIcaoCode::DesignatorMinLength) { return {}; } return this->findBy( [&](const CAircraftIcaoCode &code) { return code.matchesDesignator(designator, fuzzySearch); }); } CAircraftIcaoCode CAircraftIcaoCodeList::findBestFuzzyMatchOrDefault(const QString &designator, int cutoff) const { - if (designator.length() < CAircraftIcaoCode::DesignatorMinLength) { return CAircraftIcaoCode(); } + if (designator.length() < CAircraftIcaoCode::DesignatorMinLength) { return {}; } int best = 0; int current = 0; CAircraftIcaoCode found; @@ -60,13 +57,13 @@ namespace swift::misc::aviation CAircraftIcaoCodeList CAircraftIcaoCodeList::findByDesignatorOrIataCode(const QString &icaoOrIata) const { - if (icaoOrIata.isEmpty()) { return CAircraftIcaoCodeList(); } + if (icaoOrIata.isEmpty()) { return {}; } return this->findBy([&](const CAircraftIcaoCode &code) { return code.matchesDesignatorOrIata(icaoOrIata); }); } CAircraftIcaoCodeList CAircraftIcaoCodeList::findByDesignatorIataOrFamily(const QString &icaoIataOrFamily) const { - if (icaoIataOrFamily.isEmpty()) { return CAircraftIcaoCodeList(); } + if (icaoIataOrFamily.isEmpty()) { return {}; } return this->findBy( [&](const CAircraftIcaoCode &code) { return code.matchesDesignatorIataOrFamily(icaoIataOrFamily); }); } @@ -74,7 +71,7 @@ namespace swift::misc::aviation CAircraftIcaoCodeList CAircraftIcaoCodeList::findEndingWith(const QString &icaoEnding) const { const QString ends = icaoEnding.trimmed().toUpper(); - if (ends.isEmpty()) { return CAircraftIcaoCodeList(); } + if (ends.isEmpty()) { return {}; } CAircraftIcaoCodeList icaosDesignator; CAircraftIcaoCodeList icaosFamily; for (const CAircraftIcaoCode &icao : *this) @@ -87,19 +84,19 @@ namespace swift::misc::aviation CAircraftIcaoCodeList CAircraftIcaoCodeList::findByIataCode(const QString &iata, int fuzzySearch) const { - if (iata.isEmpty()) { return CAircraftIcaoCodeList(); } + if (iata.isEmpty()) { return {}; } return this->findBy([&](const CAircraftIcaoCode &code) { return code.matchesIataCode(iata, fuzzySearch); }); } CAircraftIcaoCodeList CAircraftIcaoCodeList::findByFamily(const QString &family, int fuzzySearch) const { - if (family.isEmpty()) { return CAircraftIcaoCodeList(); } + if (family.isEmpty()) { return {}; } return this->findBy([&](const CAircraftIcaoCode &code) { return code.matchesFamily(family, fuzzySearch); }); } CAircraftIcaoCodeList CAircraftIcaoCodeList::findByManufacturer(const QString &manufacturer) const { - if (manufacturer.isEmpty()) { return CAircraftIcaoCodeList(); } + if (manufacturer.isEmpty()) { return {}; } return this->findBy([&](const CAircraftIcaoCode &code) { return code.getManufacturer().startsWith(manufacturer, Qt::CaseInsensitive); }); @@ -107,7 +104,7 @@ namespace swift::misc::aviation CAircraftIcaoCodeList CAircraftIcaoCodeList::findByDescription(const QString &description) const { - if (description.isEmpty()) { return CAircraftIcaoCodeList(); } + if (description.isEmpty()) { return {}; } return this->findBy([&](const CAircraftIcaoCode &code) { return code.getModelDescription().startsWith(description, Qt::CaseInsensitive); }); @@ -141,9 +138,9 @@ namespace swift::misc::aviation CAircraftIcaoCode CAircraftIcaoCodeList::findFirstByDesignatorAndRank(const QString &designator) const { - if (!CAircraftIcaoCode::isValidDesignator(designator)) { return CAircraftIcaoCode(); } + if (!CAircraftIcaoCode::isValidDesignator(designator)) { return {}; } CAircraftIcaoCodeList codes(this->findByDesignator(designator)); - if (codes.isEmpty()) { return CAircraftIcaoCode(); } + if (codes.isEmpty()) { return {}; } if (codes.size() < 2) { return codes.front(); } codes.sortBy(&CAircraftIcaoCode::getRank, &CAircraftIcaoCode::getDbKey); return codes.front(); @@ -326,7 +323,7 @@ namespace swift::misc::aviation // get an initial set of data we can choose from const QString designator(icaoPattern.getDesignator()); - if (designator.isEmpty()) { return CAircraftIcaoCode(); } + if (designator.isEmpty()) { return {}; } CAircraftIcaoCodeList codes; do { codes = this->findByDesignator(designator); diff --git a/src/misc/aviation/aircraftsituation.cpp b/src/misc/aviation/aircraftsituation.cpp index 012a8659a3..39d895450f 100644 --- a/src/misc/aviation/aircraftsituation.cpp +++ b/src/misc/aviation/aircraftsituation.cpp @@ -252,13 +252,13 @@ namespace swift::misc::aviation if (distRatio > 0.95) { return oldSituation.getGroundElevationPlane(); } const double situationElvFt = newElvFt - distRatio * deltaElvFt; - return CElevationPlane(situation, situationElvFt, CElevationPlane::singlePointRadius()); + return { situation, situationElvFt, CElevationPlane::singlePointRadius() }; } else { const double elvSumFt = oldElvFt + newElvFt; const double elvFt = 0.5 * elvSumFt; - return CElevationPlane(newSituation, elvFt, CElevationPlane::singlePointRadius()); + return { newSituation, elvFt, CElevationPlane::singlePointRadius() }; } } @@ -834,7 +834,7 @@ namespace swift::misc::aviation if (this->getGroundSpeed().isNull()) { if (!min.isNull()) { return min; } - return CLength(0, CLengthUnit::nullUnit()); + return { 0, CLengthUnit::nullUnit() }; } const double seconds = ms.count() / 1000.0; const double gsMeterSecond = this->getGroundSpeed().value(CSpeedUnit::m_s()); diff --git a/src/misc/aviation/aircraftsituationchange.h b/src/misc/aviation/aircraftsituationchange.h index 0676e5d6ce..24773adf5f 100644 --- a/src/misc/aviation/aircraftsituationchange.h +++ b/src/misc/aviation/aircraftsituationchange.h @@ -119,7 +119,7 @@ namespace swift::misc bool containsPushBack() const { return m_containsPushBack; } //! Elevation standard deviation and mean - CAltitudePair getElevationStdDevAndMean() const { return CAltitudePair(m_elvStdDev, m_elvMean); } + CAltitudePair getElevationStdDevAndMean() const { return { m_elvStdDev, m_elvMean }; } //! Guess on ground flag bool guessOnGround(CAircraftSituation &situation, const simulation::CAircraftModel &model) const; diff --git a/src/misc/aviation/aircraftsituationlist.cpp b/src/misc/aviation/aircraftsituationlist.cpp index 3602395de7..05e5b0dafa 100644 --- a/src/misc/aviation/aircraftsituationlist.cpp +++ b/src/misc/aviation/aircraftsituationlist.cpp @@ -183,10 +183,7 @@ namespace swift::misc::aviation QPair CAircraftSituationList::isGndFlagStableChanging(bool alreadySortedLatestFirst) const { - if (this->size() < 2) - { - return QPair(false, COnGroundInfo::OnGroundSituationUnknown); - } + if (this->size() < 2) { return { false, COnGroundInfo::OnGroundSituationUnknown }; } const CAircraftSituationList sorted(alreadySortedLatestFirst ? (*this) : this->getSortedAdjustedLatestFirst()); const COnGroundInfo::IsOnGround f = sorted.front().getOnGroundInfo().getOnGround(); @@ -316,7 +313,7 @@ namespace swift::misc::aviation CAircraftSituationList CAircraftSituationList::withoutFrontSituation() const { - if (this->empty()) { return CAircraftSituationList(); } + if (this->empty()) { return {}; } CAircraftSituationList copy(*this); copy.pop_front(); return copy; @@ -366,17 +363,17 @@ namespace swift::misc::aviation CSpeedPair CAircraftSituationList::groundSpeedStandardDeviationAndMean() const { const QList gsValues = this->groundSpeedValues(CSpeedUnit::kts()); - if (gsValues.size() != this->size()) { return QPair(CSpeed::null(), CSpeed::null()); } + if (gsValues.size() != this->size()) { return { CSpeed::null(), CSpeed::null() }; } const QPair gsKts = CMathUtils::standardDeviationAndMean(gsValues); - return CSpeedPair(CSpeed(gsKts.first, CSpeedUnit::kts()), CSpeed(gsKts.second, CSpeedUnit::kts())); + return { CSpeed(gsKts.first, CSpeedUnit::kts()), CSpeed(gsKts.second, CSpeedUnit::kts()) }; } CAnglePair CAircraftSituationList::pitchStandardDeviationAndMean() const { const QList pitchValues = this->pitchValues(CAngleUnit::deg()); - if (pitchValues.size() != this->size()) { return QPair(CAngle::null(), CAngle::null()); } + if (pitchValues.size() != this->size()) { return { CAngle::null(), CAngle::null() }; } const QPair pitchDeg = CMathUtils::standardDeviationAndMean(pitchValues); - return CAnglePair(CAngle(pitchDeg.first, CAngleUnit::deg()), CAngle(pitchDeg.second, CAngleUnit::deg())); + return { CAngle(pitchDeg.first, CAngleUnit::deg()), CAngle(pitchDeg.second, CAngleUnit::deg()) }; } int CAircraftSituationList::transferElevationForward(const CLength &radius) @@ -421,6 +418,6 @@ namespace swift::misc::aviation static const double MaxDevFt = CAircraftSituation::allowedAltitudeDeviation().value(CLengthUnit::ft()); const QPair elvStdDevMean = CMathUtils::standardDeviationAndMean(valuesInFt); if (elvStdDevMean.first > MaxDevFt) { return CElevationPlane::null(); } - return CElevationPlane(reference, elvStdDevMean.second, CElevationPlane::singlePointRadius()); + return { reference, elvStdDevMean.second, CElevationPlane::singlePointRadius() }; } } // namespace swift::misc::aviation diff --git a/src/misc/aviation/airlineicaocode.cpp b/src/misc/aviation/airlineicaocode.cpp index 6baa9dc50b..4262df24df 100644 --- a/src/misc/aviation/airlineicaocode.cpp +++ b/src/misc/aviation/airlineicaocode.cpp @@ -444,7 +444,7 @@ namespace swift::misc::aviation if (!existsKey(json, prefix)) { // when using relationship, this can be null (e.g. for color liveries) - return CAirlineIcaoCode(); + return {}; } QString designator(json.value(prefix % u"designator").toString()); diff --git a/src/misc/aviation/airlineicaocodelist.cpp b/src/misc/aviation/airlineicaocodelist.cpp index fdc0f59cb3..add96e8d59 100644 --- a/src/misc/aviation/airlineicaocodelist.cpp +++ b/src/misc/aviation/airlineicaocodelist.cpp @@ -30,13 +30,13 @@ namespace swift::misc::aviation CAirlineIcaoCodeList CAirlineIcaoCodeList::findByDesignator(const QString &designator) const { - if (!CAirlineIcaoCode::isValidAirlineDesignator(designator)) { return CAirlineIcaoCodeList(); } + if (!CAirlineIcaoCode::isValidAirlineDesignator(designator)) { return {}; } return this->findBy([&](const CAirlineIcaoCode &code) { return code.matchesDesignator(designator); }); } CAirlineIcaoCodeList CAirlineIcaoCodeList::findByIataCode(const QString &iata) const { - if (!CAirlineIcaoCode::isValidIataCode(iata)) { return CAirlineIcaoCodeList(); } + if (!CAirlineIcaoCode::isValidIataCode(iata)) { return {}; } return this->findBy([&](const CAirlineIcaoCode &code) { return code.matchesIataCode(iata); }); } @@ -48,14 +48,14 @@ namespace swift::misc::aviation CAirlineIcaoCodeList CAirlineIcaoCodeList::findByDesignatorOrIataCode(const QString &designatorOrIata) const { - if (designatorOrIata.isEmpty()) { return CAirlineIcaoCodeList(); } + if (designatorOrIata.isEmpty()) { return {}; } return this->findBy( [&](const CAirlineIcaoCode &code) { return code.matchesDesignatorOrIataCode(designatorOrIata); }); } CAirlineIcaoCodeList CAirlineIcaoCodeList::findByVDesignator(const QString &designator) const { - if (!CAirlineIcaoCode::isValidAirlineDesignator(designator)) { return CAirlineIcaoCodeList(); } + if (!CAirlineIcaoCode::isValidAirlineDesignator(designator)) { return {}; } return this->findBy([&](const CAirlineIcaoCode &code) { return code.matchesVDesignator(designator); }); } @@ -69,34 +69,34 @@ namespace swift::misc::aviation CAirlineIcaoCodeList CAirlineIcaoCodeList::findByVDesignatorOrIataCode(const QString &designatorOrIata) const { - if (designatorOrIata.isEmpty()) { return CAirlineIcaoCodeList(); } + if (designatorOrIata.isEmpty()) { return {}; } return this->findBy( [&](const CAirlineIcaoCode &code) { return code.matchesVDesignatorOrIataCode(designatorOrIata); }); } CAirlineIcaoCodeList CAirlineIcaoCodeList::findByCountryIsoCode(const QString &isoCode) const { - if (isoCode.length() != 2) { return CAirlineIcaoCodeList(); } + if (isoCode.length() != 2) { return {}; } const QString iso(isoCode.toUpper()); return this->findBy([&](const CAirlineIcaoCode &code) { return code.getCountry().getIsoCode() == iso; }); } CAirlineIcaoCodeList CAirlineIcaoCodeList::findBySimplifiedNameContaining(const QString &containedString) const { - if (containedString.isEmpty()) { return CAirlineIcaoCodeList(); } + if (containedString.isEmpty()) { return {}; } return this->findBy( [&](const CAirlineIcaoCode &code) { return code.isContainedInSimplifiedName(containedString); }); } CAirlineIcaoCodeList CAirlineIcaoCodeList::findByTelephonyDesignator(const QString &candidate) const { - if (candidate.isEmpty()) { return CAirlineIcaoCodeList(); } + if (candidate.isEmpty()) { return {}; } return this->findBy([&](const CAirlineIcaoCode &code) { return code.matchesTelephonyDesignator(candidate); }); } CAirlineIcaoCodeList CAirlineIcaoCodeList::findByNamesOrTelephonyDesignator(const QString &candidate) const { - if (candidate.isEmpty()) { return CAirlineIcaoCodeList(); } + if (candidate.isEmpty()) { return {}; } return this->findBy( [&](const CAirlineIcaoCode &code) { return code.matchesNamesOrTelephonyDesignator(candidate); }); } @@ -275,9 +275,9 @@ namespace swift::misc::aviation CAirlineIcaoCode CAirlineIcaoCodeList::findBestMatchByCallsign(const CCallsign &callsign) const { - if (this->isEmpty() || callsign.isEmpty()) { return CAirlineIcaoCode(); } + if (this->isEmpty() || callsign.isEmpty()) { return {}; } const QString airline = callsign.getAirlinePrefix().toUpper(); - if (airline.isEmpty()) { return CAirlineIcaoCode(); } + if (airline.isEmpty()) { return {}; } const CAirlineIcaoCode airlineCode = (airline.length() == 3) ? this->findFirstByOrDefault(&CAirlineIcaoCode::getDesignator, airline) : this->findFirstByOrDefault(&CAirlineIcaoCode::getVDesignator, airline); diff --git a/src/misc/aviation/airport.cpp b/src/misc/aviation/airport.cpp index 64354960d7..0386acf800 100644 --- a/src/misc/aviation/airport.cpp +++ b/src/misc/aviation/airport.cpp @@ -97,8 +97,8 @@ namespace swift::misc::aviation switch (i) { case IndexIcao: return m_icao.propertyByIndex(index.copyFrontRemoved()); - case IndexLocation: return QVariant(m_location); - case IndexDescriptiveName: return QVariant(m_descriptiveName); + case IndexLocation: return { m_location }; + case IndexDescriptiveName: return { m_descriptiveName }; case IndexPosition: return m_position.propertyByIndex(index.copyFrontRemoved()); case IndexElevation: return this->getElevation().propertyByIndex(index.copyFrontRemoved()); case IndexOperating: return QVariant::fromValue(this->isOperating()); diff --git a/src/misc/aviation/airportlist.cpp b/src/misc/aviation/airportlist.cpp index 61b92f3c1d..7a0efc9581 100644 --- a/src/misc/aviation/airportlist.cpp +++ b/src/misc/aviation/airportlist.cpp @@ -50,14 +50,14 @@ namespace swift::misc::aviation CAirport CAirportList::findFirstByNameOrLocation(const QString &nameOrLocation) const { - if (this->isEmpty() || nameOrLocation.isEmpty()) { return CAirport(); } + if (this->isEmpty() || nameOrLocation.isEmpty()) { return {}; } CAirportList airports = this->findBy([&](const CAirport &airport) { return airport.matchesDescriptiveName(nameOrLocation); }); if (!airports.isEmpty()) { return airports.frontOrDefault(); } airports = this->findBy([&](const CAirport &airport) { return airport.matchesLocation(nameOrLocation); }); if (!airports.isEmpty()) { return airports.frontOrDefault(); } - return CAirport(); + return {}; } QStringList CAirportList::allIcaoCodes(bool sorted) const diff --git a/src/misc/aviation/atcstationlist.cpp b/src/misc/aviation/atcstationlist.cpp index 85eb9b05b8..5e580410b3 100644 --- a/src/misc/aviation/atcstationlist.cpp +++ b/src/misc/aviation/atcstationlist.cpp @@ -35,7 +35,7 @@ namespace swift::misc::aviation CAtcStationList CAtcStationList::findIfFrequencyIsWithinSpacing(const CFrequency &frequency) { - if (frequency.isNull()) { return CAtcStationList(); } + if (frequency.isNull()) { return {}; } return this->findBy([&](const CAtcStation &atcStation) { return atcStation.isAtcStationFrequency(frequency); }); } @@ -111,7 +111,7 @@ namespace swift::misc::aviation QHash CAtcStationList::splitPerSuffix(bool sort) const { - if (this->isEmpty()) { return QHash(); } + if (this->isEmpty()) { return {}; } const CAtcStationList stations = sort ? this->sortedByAtcSuffixSortOrderAndDistance() : *this; QString suffix; diff --git a/src/misc/aviation/callsign.cpp b/src/misc/aviation/callsign.cpp index d882a66086..3240eef939 100644 --- a/src/misc/aviation/callsign.cpp +++ b/src/misc/aviation/callsign.cpp @@ -313,10 +313,10 @@ namespace swift::misc::aviation const auto i = index.frontCasted(); switch (i) { - case IndexCallsignString: return QVariant(this->asString()); - case IndexCallsignStringAsSet: return QVariant(this->getStringAsSet()); - case IndexTelephonyDesignator: return QVariant(this->getTelephonyDesignator()); - case IndexSuffix: return QVariant(this->getSuffix()); + case IndexCallsignString: return { this->asString() }; + case IndexCallsignStringAsSet: return { this->getStringAsSet() }; + case IndexTelephonyDesignator: return { this->getTelephonyDesignator() }; + case IndexSuffix: return { this->getSuffix() }; default: return CValueObject::propertyByIndex(index); } } diff --git a/src/misc/aviation/callsignobjectlist.h b/src/misc/aviation/callsignobjectlist.h index d7568cba67..4504e80f1a 100644 --- a/src/misc/aviation/callsignobjectlist.h +++ b/src/misc/aviation/callsignobjectlist.h @@ -51,7 +51,7 @@ namespace swift::misc::aviation //! Get callsigns as strings QString getCallsignsAsString(const QString &separator, bool sorted = false) const { - if (this->container().isEmpty()) { return QString(); } + if (this->container().isEmpty()) { return {}; } const QStringList callsigns = this->getCallsignStrings(sorted); return callsigns.join(separator); } diff --git a/src/misc/aviation/comsystem.cpp b/src/misc/aviation/comsystem.cpp index 977a912b9d..70a92ec68d 100644 --- a/src/misc/aviation/comsystem.cpp +++ b/src/misc/aviation/comsystem.cpp @@ -63,32 +63,30 @@ namespace swift::misc::aviation CComSystem CComSystem::getCom1System(double activeFrequencyMHz, double standbyFrequencyMHz) { - return CComSystem( - CModulator::NameCom1(), - physical_quantities::CFrequency(activeFrequencyMHz, physical_quantities::CFrequencyUnit::MHz()), - physical_quantities::CFrequency(standbyFrequencyMHz < 0 ? activeFrequencyMHz : standbyFrequencyMHz, - physical_quantities::CFrequencyUnit::MHz())); + return { CModulator::NameCom1(), + physical_quantities::CFrequency(activeFrequencyMHz, physical_quantities::CFrequencyUnit::MHz()), + physical_quantities::CFrequency(standbyFrequencyMHz < 0 ? activeFrequencyMHz : standbyFrequencyMHz, + physical_quantities::CFrequencyUnit::MHz()) }; } CComSystem CComSystem::getCom1System(const CFrequency &activeFrequency, const CFrequency &standbyFrequency) { - return CComSystem(CModulator::NameCom1(), activeFrequency, - standbyFrequency.isNull() ? activeFrequency : standbyFrequency); + return { CModulator::NameCom1(), activeFrequency, + standbyFrequency.isNull() ? activeFrequency : standbyFrequency }; } CComSystem CComSystem::getCom2System(double activeFrequencyMHz, double standbyFrequencyMHz) { - return CComSystem( - CModulator::NameCom2(), - physical_quantities::CFrequency(activeFrequencyMHz, physical_quantities::CFrequencyUnit::MHz()), - physical_quantities::CFrequency(standbyFrequencyMHz < 0 ? activeFrequencyMHz : standbyFrequencyMHz, - physical_quantities::CFrequencyUnit::MHz())); + return { CModulator::NameCom2(), + physical_quantities::CFrequency(activeFrequencyMHz, physical_quantities::CFrequencyUnit::MHz()), + physical_quantities::CFrequency(standbyFrequencyMHz < 0 ? activeFrequencyMHz : standbyFrequencyMHz, + physical_quantities::CFrequencyUnit::MHz()) }; } CComSystem CComSystem::getCom2System(const CFrequency &activeFrequency, const CFrequency &standbyFrequency) { - return CComSystem(CModulator::NameCom2(), activeFrequency, - standbyFrequency.isNull() ? activeFrequency : standbyFrequency); + return { CModulator::NameCom2(), activeFrequency, + standbyFrequency.isNull() ? activeFrequency : standbyFrequency }; } bool CComSystem::isValidCivilAviationFrequency(const CFrequency &f) diff --git a/src/misc/aviation/flightplan.cpp b/src/misc/aviation/flightplan.cpp index 796ee40dce..95673dd376 100644 --- a/src/misc/aviation/flightplan.cpp +++ b/src/misc/aviation/flightplan.cpp @@ -322,7 +322,7 @@ namespace swift::misc::aviation CFlightPlan CFlightPlan::fromVPilotFormat(const QString &vPilotData) { - if (vPilotData.isEmpty()) { return CFlightPlan(); } + if (vPilotData.isEmpty()) { return {}; } QDomDocument doc; doc.setContent(vPilotData); const QDomElement fpDom = doc.firstChildElement(); @@ -378,7 +378,7 @@ namespace swift::misc::aviation CFlightPlan CFlightPlan::fromSB4Format(const QString &sbData) { - if (sbData.isEmpty()) { return CFlightPlan(); } + if (sbData.isEmpty()) { return {}; } CFlightPlan fp; const QMap values = parseIniValues(sbData); const QString altStr = values.value("Altitude"); @@ -416,7 +416,7 @@ namespace swift::misc::aviation CFlightPlan CFlightPlan::fromSimBriefFormat(const QString &simBrief) { - if (simBrief.isEmpty()) { return CFlightPlan(); } + if (simBrief.isEmpty()) { return {}; } CFlightPlan fp; QDomDocument doc; doc.setContent(simBrief); @@ -532,7 +532,7 @@ namespace swift::misc::aviation CFlightPlan CFlightPlan::fromMultipleFormats(const QString &data, const QString &fileSuffix) { - if (data.isEmpty()) { return CFlightPlan(); } + if (data.isEmpty()) { return {}; } if (fileSuffix.contains("xml", Qt::CaseInsensitive)) { if (data.contains("", Qt::CaseInsensitive) && data.contains("", Qt::CaseInsensitive)) @@ -561,7 +561,7 @@ namespace swift::misc::aviation msgs->push_back( CStatusMessage(static_cast(nullptr)).validationError(u"No file name")); } - return CFlightPlan(); + return {}; } else { @@ -573,7 +573,7 @@ namespace swift::misc::aviation .validationError(u"File '%1' does not exist") << fileName); } - return CFlightPlan(); + return {}; } } @@ -586,7 +586,7 @@ namespace swift::misc::aviation .validationError(u"File '%1' does not contain data") << fileName); } - return CFlightPlan(); + return {}; } if (fileName.endsWith(".sfp", Qt::CaseInsensitive)) { return CFlightPlan::fromSB4Format(data); } @@ -653,7 +653,7 @@ namespace swift::misc::aviation QStringLiteral("Parsing flight plan from '%1' failed.").arg(fileName))); } } - return CFlightPlan(); + return {}; } const QString &CFlightPlan::flightRulesToString(CFlightPlan::FlightRules rules) diff --git a/src/misc/aviation/livery.cpp b/src/misc/aviation/livery.cpp index 4d50f3fe4d..33c2f49f6a 100644 --- a/src/misc/aviation/livery.cpp +++ b/src/misc/aviation/livery.cpp @@ -201,7 +201,7 @@ namespace swift::misc::aviation if (!existsKey(json, prefix)) { // when using relationship, this can be null - return CLivery(); + return {}; } const QString combinedCode(json.value(prefix % u"combinedcode").toString()); @@ -236,7 +236,7 @@ namespace swift::misc::aviation if (!existsKey(json, prefix)) { // when using relationship, this can be null - return CLivery(); + return {}; } const QString combinedCode(json.value(prefix % u"combinedcode").toString()); diff --git a/src/misc/aviation/liverylist.cpp b/src/misc/aviation/liverylist.cpp index 20ac2ddfab..4ca0068a2a 100644 --- a/src/misc/aviation/liverylist.cpp +++ b/src/misc/aviation/liverylist.cpp @@ -17,13 +17,13 @@ namespace swift::misc::aviation CLiveryList CLiveryList::findByAirlineIcaoDesignator(const QString &icao) const { QString icaoCode(icao.trimmed().toUpper()); - if (icaoCode.isEmpty()) { return CLiveryList(); } + if (icaoCode.isEmpty()) { return {}; } return this->findBy(&CLivery::getAirlineIcaoCodeDesignator, icaoCode); } CLivery CLiveryList::findStdLiveryByAirlineIcaoVDesignator(const CAirlineIcaoCode &icao) const { - if (this->isEmpty() || !icao.hasValidDesignator()) { return CLivery(); } + if (this->isEmpty() || !icao.hasValidDesignator()) { return {}; } CLiveryList candidates; for (const CLivery &livery : *this) { @@ -47,7 +47,7 @@ namespace swift::misc::aviation CLivery CLiveryList::findStdLiveryByAirlineIcaoVDesignator(const QString &icao) const { const QString icaoDesignator(icao.trimmed().toUpper()); - if (icaoDesignator.isEmpty()) { return CLivery(); } + if (icaoDesignator.isEmpty()) { return {}; } return this->findFirstByOrDefault([&](const CLivery &livery) { if (!livery.isAirlineStandardLivery()) { return false; } return livery.getAirlineIcaoCode().matchesVDesignator(icaoDesignator); @@ -56,7 +56,7 @@ namespace swift::misc::aviation CLiveryList CLiveryList::findStdLiveriesBySimplifiedAirlineName(const QString &containedString) const { - if (containedString.isEmpty()) { return CLiveryList(); } + if (containedString.isEmpty()) { return {}; } return this->findBy([&](const CLivery &livery) { // keep isAirlineStandardLivery first (faster) return livery.isAirlineStandardLivery() && livery.isContainedInSimplifiedAirlineName(containedString); @@ -65,7 +65,7 @@ namespace swift::misc::aviation CLiveryList CLiveryList::findStdLiveriesByNamesOrTelephonyDesignator(const QString &candidate) const { - if (candidate.isEmpty()) { return CLiveryList(); } + if (candidate.isEmpty()) { return {}; } return this->findBy([&](const CLivery &livery) { // keep isAirlineStandardLivery first (faster) return livery.isAirlineStandardLivery() && @@ -75,7 +75,7 @@ namespace swift::misc::aviation CLivery CLiveryList::findColorLiveryOrDefault(const CRgbColor &fuselage, const CRgbColor &tail) const { - if (!fuselage.isValid() || !tail.isValid()) { return CLivery(); } + if (!fuselage.isValid() || !tail.isValid()) { return {}; } return this->findFirstByOrDefault([&](const CLivery &livery) { if (!livery.isColorLivery()) { return false; } return livery.matchesColors(fuselage, tail); @@ -84,7 +84,7 @@ namespace swift::misc::aviation CLivery CLiveryList::findClosestColorLiveryOrDefault(const CRgbColor &fuselage, const CRgbColor &tail) const { - if (!fuselage.isValid() || !tail.isValid()) { return CLivery(); } + if (!fuselage.isValid() || !tail.isValid()) { return {}; } CLivery bestMatch; double bestDistance = 1.0; for (const CLivery &livery : *this) @@ -103,14 +103,14 @@ namespace swift::misc::aviation CLivery CLiveryList::findByCombinedCode(const QString &combinedCode) const { - if (!CLivery::isValidCombinedCode(combinedCode)) { return CLivery(); } + if (!CLivery::isValidCombinedCode(combinedCode)) { return {}; } return this->findFirstByOrDefault( [&](const CLivery &livery) { return livery.matchesCombinedCode(combinedCode); }); } QStringList CLiveryList::getCombinedCodes(bool sort) const { - if (this->isEmpty()) { return QStringList(); } + if (this->isEmpty()) { return {}; } QStringList codes = this->transform(predicates::MemberTransform(&CLivery::getCombinedCode)); if (sort) { codes.sort(); } return codes; @@ -118,7 +118,7 @@ namespace swift::misc::aviation QStringList CLiveryList::getCombinedCodesPlusInfo(bool sort) const { - if (this->isEmpty()) { return QStringList(); } + if (this->isEmpty()) { return {}; } QStringList codes = this->transform(predicates::MemberTransform(&CLivery::getCombinedCodePlusInfo)); if (sort) { codes.sort(); } return codes; @@ -126,7 +126,7 @@ namespace swift::misc::aviation QStringList CLiveryList::getCombinedCodesPlusInfoAndId(bool sort) const { - if (this->isEmpty()) { return QStringList(); } + if (this->isEmpty()) { return {}; } QStringList codes = this->transform(predicates::MemberTransform(&CLivery::getCombinedCodePlusInfoAndId)); if (sort) { codes.sort(); } return codes; @@ -186,7 +186,7 @@ namespace swift::misc::aviation const CLiveryList liveries(this->findStdLiveriesByNamesOrTelephonyDesignator(search)); if (!liveries.isEmpty()) { return liveries.front(); } } - return CLivery(); + return {}; } CLiveryList CLiveryList::fromDatabaseJsonCaching(const QJsonArray &array, diff --git a/src/misc/aviation/navsystem.h b/src/misc/aviation/navsystem.h index 3d3f875cd4..f6f2ef25c3 100644 --- a/src/misc/aviation/navsystem.h +++ b/src/misc/aviation/navsystem.h @@ -73,12 +73,12 @@ namespace swift::misc::aviation //! NAV1 unit static CNavSystem getNav1System(double activeFrequencyMHz, double standbyFrequencyMHz = -1) { - return CNavSystem(CModulator::NameNav1(), - swift::misc::physical_quantities::CFrequency( - activeFrequencyMHz, swift::misc::physical_quantities::CFrequencyUnit::MHz()), - swift::misc::physical_quantities::CFrequency( - standbyFrequencyMHz < 0 ? activeFrequencyMHz : standbyFrequencyMHz, - swift::misc::physical_quantities::CFrequencyUnit::MHz())); + return { CModulator::NameNav1(), + swift::misc::physical_quantities::CFrequency( + activeFrequencyMHz, swift::misc::physical_quantities::CFrequencyUnit::MHz()), + swift::misc::physical_quantities::CFrequency( + standbyFrequencyMHz < 0 ? activeFrequencyMHz : standbyFrequencyMHz, + swift::misc::physical_quantities::CFrequencyUnit::MHz()) }; } //! NAV1 unit @@ -86,19 +86,19 @@ namespace swift::misc::aviation const swift::misc::physical_quantities::CFrequency &standbyFrequency = { 0, swift::misc::physical_quantities::CFrequencyUnit::nullUnit() }) { - return CNavSystem(CModulator::NameNav1(), activeFrequency, - standbyFrequency.isNull() ? activeFrequency : standbyFrequency); + return { CModulator::NameNav1(), activeFrequency, + standbyFrequency.isNull() ? activeFrequency : standbyFrequency }; } //! NAV2 unit static CNavSystem getNav2System(double activeFrequencyMHz, double standbyFrequencyMHz = -1) { - return CNavSystem(CModulator::NameNav2(), - swift::misc::physical_quantities::CFrequency( - activeFrequencyMHz, swift::misc::physical_quantities::CFrequencyUnit::MHz()), - swift::misc::physical_quantities::CFrequency( - standbyFrequencyMHz < 0 ? activeFrequencyMHz : standbyFrequencyMHz, - swift::misc::physical_quantities::CFrequencyUnit::MHz())); + return { CModulator::NameNav2(), + swift::misc::physical_quantities::CFrequency( + activeFrequencyMHz, swift::misc::physical_quantities::CFrequencyUnit::MHz()), + swift::misc::physical_quantities::CFrequency( + standbyFrequencyMHz < 0 ? activeFrequencyMHz : standbyFrequencyMHz, + swift::misc::physical_quantities::CFrequencyUnit::MHz()) }; } //! NAV2 unit @@ -106,8 +106,8 @@ namespace swift::misc::aviation const swift::misc::physical_quantities::CFrequency &standbyFrequency = { 0, swift::misc::physical_quantities::CFrequencyUnit::nullUnit() }) { - return CNavSystem(CModulator::NameNav2(), activeFrequency, - standbyFrequency.isNull() ? activeFrequency : standbyFrequency); + return { CModulator::NameNav2(), activeFrequency, + standbyFrequency.isNull() ? activeFrequency : standbyFrequency }; } private: diff --git a/src/misc/aviation/transponder.cpp b/src/misc/aviation/transponder.cpp index 972c2e74e9..326b97bfc6 100644 --- a/src/misc/aviation/transponder.cpp +++ b/src/misc/aviation/transponder.cpp @@ -145,7 +145,7 @@ namespace swift::misc::aviation CTransponder CTransponder::getStandardTransponder(qint32 transponderCode, CTransponder::TransponderMode mode) { - return CTransponder(transponderCode, mode); + return { transponderCode, mode }; } const QString &CTransponder::modeAsString(CTransponder::TransponderMode mode) diff --git a/src/misc/cachesettingsutils.cpp b/src/misc/cachesettingsutils.cpp index 95333cb91f..cd561435bf 100644 --- a/src/misc/cachesettingsutils.cpp +++ b/src/misc/cachesettingsutils.cpp @@ -36,17 +36,17 @@ namespace swift::misc QString CCacheSettingsUtils::relativeSettingsPath(const QString &fileName) { - if (!isSetting(fileName)) { return QString(); } + if (!isSetting(fileName)) { return {}; } const int index = fileName.lastIndexOf(binSettings()); - if (index < 0) { return QString(); } + if (index < 0) { return {}; } return fileName.mid(index); } QString CCacheSettingsUtils::relativeCachePath(const QString &fileName) { - if (!isCache(fileName)) { return QString(); } + if (!isCache(fileName)) { return {}; } const int index = fileName.lastIndexOf(binData()); - if (index < 0) { return QString(); } + if (index < 0) { return {}; } return fileName.mid(index); } diff --git a/src/misc/country.cpp b/src/misc/country.cpp index 26ee959838..3ea00fe3fa 100644 --- a/src/misc/country.cpp +++ b/src/misc/country.cpp @@ -56,7 +56,7 @@ namespace swift::misc QString CCountry::getCombinedStringIsoName() const { - if (!this->hasIsoCode()) { return QString(); } + if (!this->hasIsoCode()) { return {}; } QString s(m_dbKey); if (m_name.isEmpty()) { return s; } return u" (" % m_name % u')'; @@ -64,7 +64,7 @@ namespace swift::misc QString CCountry::getCombinedStringNameIso() const { - if (!this->isValid()) { return QString(); } + if (!this->isValid()) { return {}; } return m_name % u" - " % m_dbKey; } @@ -172,7 +172,7 @@ namespace swift::misc if (!existsKey(json, prefix)) { // when using relationship, this can be null - return CCountry(); + return {}; } const QString iso(json.value(prefix % u"id").toString()); const QString name(json.value(prefix % u"country").toString()); diff --git a/src/misc/countrylist.cpp b/src/misc/countrylist.cpp index 3da08a7726..2e4109b91a 100644 --- a/src/misc/countrylist.cpp +++ b/src/misc/countrylist.cpp @@ -16,13 +16,13 @@ namespace swift::misc CCountry CCountryList::findByIsoCode(const QString &isoCode) const { const QString iso(isoCode.trimmed().toUpper()); - if (!CCountry::isValidIsoCode(iso)) { return CCountry(); } + if (!CCountry::isValidIsoCode(iso)) { return {}; } return IDatastoreObjectList::findByKey(isoCode); } CCountry CCountryList::findBestMatchByCountryName(const QString &candidate) const { - if (candidate.isEmpty()) { return CCountry(); } + if (candidate.isEmpty()) { return {}; } thread_local const QRegularExpression reg("^[a-z]+", QRegularExpression::CaseInsensitiveOption); const QRegularExpressionMatch match = reg.match(candidate); @@ -45,13 +45,13 @@ namespace swift::misc CCountry CCountryList::findFirstByAlias(const QString &alias) const { - if (alias.isEmpty()) { return CCountry(); } + if (alias.isEmpty()) { return {}; } const QString a(alias.toUpper().trimmed()); for (const CCountry &country : (*this)) { if (country.matchesAlias(a)) { return country; } } - return CCountry(); + return {}; } QStringList CCountryList::toIsoNameList(bool sorted) const diff --git a/src/misc/datacache.cpp b/src/misc/datacache.cpp index 5e3915c948..0a934f1c16 100644 --- a/src/misc/datacache.cpp +++ b/src/misc/datacache.cpp @@ -555,7 +555,7 @@ namespace swift::misc QMutexLocker lock(&m_mutex); Q_ASSERT(m_updateInProgress); - return QSet(m_timestamps.keyBegin(), m_timestamps.keyEnd()); + return { m_timestamps.keyBegin(), m_timestamps.keyEnd() }; } const QMap &CDataCacheRevision::newerTimestamps() const diff --git a/src/misc/db/artifact.cpp b/src/misc/db/artifact.cpp index d2db3c4451..2149a21147 100644 --- a/src/misc/db/artifact.cpp +++ b/src/misc/db/artifact.cpp @@ -56,11 +56,11 @@ namespace swift::misc::db CRemoteFile CArtifact::asRemoteFile() const { - if (!this->hasDistributions()) { return CRemoteFile(); } + if (!this->hasDistributions()) { return {}; } CRemoteFile rf(this->getName(), this->getFileSize()); const CDistribution d = this->getMostStableDistribution(); const CUrl url = d.getDownloadUrl(); - if (url.isEmpty()) { return CRemoteFile(); } + if (url.isEmpty()) { return {}; } rf.setUtcTimestamp(this->getUtcTimestamp()); rf.setUrl(url); rf.setDescription(this->getPlatform().toQString() + " " + d.getChannel()); diff --git a/src/misc/db/artifactlist.cpp b/src/misc/db/artifactlist.cpp index d75802e6ef..059f7929ac 100644 --- a/src/misc/db/artifactlist.cpp +++ b/src/misc/db/artifactlist.cpp @@ -31,7 +31,7 @@ namespace swift::misc::db { if (artifact.matchesName(name, cs)) { return artifact; } } - return CArtifact(); + return {}; } CArtifactList CArtifactList::findByMatchingPlatform(const CPlatform &platform) const @@ -191,7 +191,7 @@ namespace swift::misc::db CArtifactList CArtifactList::fromDatabaseJson(const QString &json) { - if (json.isEmpty()) { return CArtifactList(); } + if (json.isEmpty()) { return {}; } return CArtifactList::fromDatabaseJson(json::jsonArrayFromString(json)); } } // namespace swift::misc::db diff --git a/src/misc/db/datastore.cpp b/src/misc/db/datastore.cpp index 045b2a5f8c..c43359e776 100644 --- a/src/misc/db/datastore.cpp +++ b/src/misc/db/datastore.cpp @@ -72,8 +72,8 @@ namespace swift::misc::db QJsonValue IDatastoreObjectWithIntegerKey::getDbKeyAsJsonValue() const { - if (this->hasValidDbKey()) { return QJsonValue(m_dbKey); } - return QJsonValue(); + if (this->hasValidDbKey()) { return { m_dbKey }; } + return {}; } void IDatastoreObjectWithIntegerKey::setKeyVersionTimestampFromDatabaseJson(const QJsonObject &json, @@ -104,7 +104,7 @@ namespace swift::misc::db case IndexVersion: return QVariant::fromValue(this->getVersion()); default: break; } - return QVariant(); + return {}; } void IDatastoreObjectWithIntegerKey::setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant) @@ -153,7 +153,7 @@ namespace swift::misc::db QJsonValue IDatastoreObjectWithStringKey::getDbKeyAsJsonValue() const { - if (this->hasValidDbKey()) { return QJsonValue(m_dbKey); } + if (this->hasValidDbKey()) { return { m_dbKey }; } static const QJsonValue null; return null; } @@ -204,7 +204,7 @@ namespace swift::misc::db case IndexVersion: return QVariant::fromValue(this->getVersion()); default: break; } - return QVariant(); + return {}; } void IDatastoreObjectWithStringKey::setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant) diff --git a/src/misc/db/datastoreobjectlist.h b/src/misc/db/datastoreobjectlist.h index a711349dc6..3091be82f9 100644 --- a/src/misc/db/datastoreobjectlist.h +++ b/src/misc/db/datastoreobjectlist.h @@ -211,7 +211,7 @@ namespace swift::misc::db { CONTAINER objs(this->container()); objs.removeObjectsWithoutDbKey(); - if (objs.isEmpty()) { return QDateTime(); } + if (objs.isEmpty()) { return {}; } return objs.latestTimestamp(); } @@ -220,7 +220,7 @@ namespace swift::misc::db { CONTAINER objs(this->container()); objs.removeObjectsWithoutDbKey(); - if (objs.isEmpty()) { return QDateTime(); } + if (objs.isEmpty()) { return {}; } return objs.oldestDbTimestamp(); } diff --git a/src/misc/db/datastoreutility.cpp b/src/misc/db/datastoreutility.cpp index 9595a0f9c8..4badd2943e 100644 --- a/src/misc/db/datastoreutility.cpp +++ b/src/misc/db/datastoreutility.cpp @@ -64,7 +64,7 @@ namespace swift::misc::db QDateTime CDatastoreUtility::parseTimestamp(const QString ×tamp) { - if (timestamp.isEmpty()) { return QDateTime(); } + if (timestamp.isEmpty()) { return {}; } return parseDateTimeStringOptimized(removeDateTimeSeparators(timestamp)); } diff --git a/src/misc/db/dbinfo.cpp b/src/misc/db/dbinfo.cpp index 56d8c489b0..5a7a8a105a 100644 --- a/src/misc/db/dbinfo.cpp +++ b/src/misc/db/dbinfo.cpp @@ -122,7 +122,7 @@ namespace swift::misc::db if (!existsKey(json, prefix)) { // when using relationship, this can be null - return CDbInfo(); + return {}; } const int id(json.value(prefix % u"id").toInt()); const int entries(json.value(prefix % u"entries").toInt()); diff --git a/src/misc/db/dbinfolist.cpp b/src/misc/db/dbinfolist.cpp index e9ff6c6d4e..2d3ca92fb2 100644 --- a/src/misc/db/dbinfolist.cpp +++ b/src/misc/db/dbinfolist.cpp @@ -17,7 +17,7 @@ namespace swift::misc::db { if (info.matchesEntity(entity)) { return info; } } - return CDbInfo(); + return {}; } CDbInfoList CDbInfoList::fromDatabaseJson(const QJsonArray &array) diff --git a/src/misc/db/distributionlist.cpp b/src/misc/db/distributionlist.cpp index cad706464d..17f6889df9 100644 --- a/src/misc/db/distributionlist.cpp +++ b/src/misc/db/distributionlist.cpp @@ -83,7 +83,7 @@ namespace swift::misc::db CDistributionList CDistributionList::fromDatabaseJson(const QString &json) { - if (json.isEmpty()) { return CDistributionList(); } + if (json.isEmpty()) { return {}; } return CDistributionList::fromDatabaseJson(json::jsonArrayFromString(json)); } } // namespace swift::misc::db diff --git a/src/misc/db/updateinfo.cpp b/src/misc/db/updateinfo.cpp index ef31cbece6..0735a63319 100644 --- a/src/misc/db/updateinfo.cpp +++ b/src/misc/db/updateinfo.cpp @@ -62,9 +62,9 @@ namespace swift::misc::db CDistribution CUpdateInfo::anticipateOwnDistribution() const { - if (this->isEmpty()) { return CDistribution(); } + if (this->isEmpty()) { return {}; } const CArtifactList ownArtifacts = this->getArtifactsPilotClientForCurrentPlatform(); - if (ownArtifacts.isEmpty()) { return CDistribution(); } + if (ownArtifacts.isEmpty()) { return {}; } const QVersionNumber myVersion = CBuildConfig::getVersion(); const QVersionNumber latestVersion = ownArtifacts.getLatestQVersion(); @@ -136,12 +136,12 @@ namespace swift::misc::db const CArtifactList artifacts = CArtifactList::fromDatabaseJson(jsonArtifacts); Q_ASSERT_X(jsonDistributions.size() == distributions.size(), Q_FUNC_INFO, "size mismatch"); Q_ASSERT_X(artifacts.size() == artifacts.size(), Q_FUNC_INFO, "size mismatch"); - return CUpdateInfo(artifacts, distributions); + return { artifacts, distributions }; } CUpdateInfo CUpdateInfo::fromDatabaseJson(const QString &jsonString) { - if (jsonString.isEmpty()) { return CUpdateInfo(); } + if (jsonString.isEmpty()) { return {}; } return CUpdateInfo::fromDatabaseJson(json::jsonObjectFromString(jsonString)); } diff --git a/src/misc/dbusserver.cpp b/src/misc/dbusserver.cpp index ea2cd3b37c..232d0df96e 100644 --- a/src/misc/dbusserver.cpp +++ b/src/misc/dbusserver.cpp @@ -188,7 +188,7 @@ namespace swift::misc { const QMetaClassInfo ci = mo->classInfo(i); const QString name = QString(ci.name()).toLower(); - if (name == "d-bus interface") { return QString(ci.value()); } + if (name == "d-bus interface") { return { ci.value() }; } } return {}; } diff --git a/src/misc/directoryutils.cpp b/src/misc/directoryutils.cpp index 21363d4627..f6fe8388f8 100644 --- a/src/misc/directoryutils.cpp +++ b/src/misc/directoryutils.cpp @@ -44,7 +44,7 @@ namespace swift::misc QStringList CDirectoryUtils::getRelativeSubDirectories(const QString &rootDir) { const QDir dir(rootDir); - if (!dir.exists()) { return QStringList(); } + if (!dir.exists()) { return {}; } return dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks); } diff --git a/src/misc/fileutils.cpp b/src/misc/fileutils.cpp index 32274c2ae7..3de0074bf3 100644 --- a/src/misc/fileutils.cpp +++ b/src/misc/fileutils.cpp @@ -301,7 +301,7 @@ namespace swift::misc const QStringList &excludeDirectories, std::function predicate) { - if (isExcludedDirectory(dir, excludeDirectories)) { return QString(); } + if (isExcludedDirectory(dir, excludeDirectories)) { return {}; } const QFileInfoList result = dir.entryInfoList(nameFilters, QDir::Files); if (predicate) { @@ -349,7 +349,7 @@ namespace swift::misc const QStringList &excludeDirectories, std::function predicate) { - if (isExcludedDirectory(dir, excludeDirectories)) { return QFileInfoList(); } + if (isExcludedDirectory(dir, excludeDirectories)) { return {}; } QFileInfoList result = dir.entryInfoList(nameFilters, QDir::Files); if (predicate) { diff --git a/src/misc/geo/coordinategeodetic.cpp b/src/misc/geo/coordinategeodetic.cpp index e9d5ce2633..1b904dfdfd 100644 --- a/src/misc/geo/coordinategeodetic.cpp +++ b/src/misc/geo/coordinategeodetic.cpp @@ -29,7 +29,7 @@ namespace swift::misc::geo { const CLatitude lat = CLatitude::fromWgs84(latitudeWgs84); const CLongitude lon = CLongitude::fromWgs84(longitudeWgs84); - return CCoordinateGeodetic(lat, lon, geodeticHeight); + return { lat, lon, geodeticHeight }; } const CCoordinateGeodetic &CCoordinateGeodetic::null() @@ -141,10 +141,10 @@ namespace swift::misc::geo { case IndexLatitude: return this->latitude().propertyByIndex(index.copyFrontRemoved()); case IndexLongitude: return this->longitude().propertyByIndex(index.copyFrontRemoved()); - case IndexLatitudeAsString: return QVariant(this->latitudeAsString()); - case IndexLongitudeAsString: return QVariant(this->longitudeAsString()); + case IndexLatitudeAsString: return { this->latitudeAsString() }; + case IndexLongitudeAsString: return { this->longitudeAsString() }; case IndexGeodeticHeight: return this->geodeticHeight().propertyByIndex(index.copyFrontRemoved()); - case IndexGeodeticHeightAsString: return QVariant(this->geodeticHeightAsString()); + case IndexGeodeticHeightAsString: return { this->geodeticHeightAsString() }; case IndexNormalVector: return QVariant::fromValue(this->normalVector()); default: break; } diff --git a/src/misc/geo/coordinategeodeticlist.cpp b/src/misc/geo/coordinategeodeticlist.cpp index 81e3bbdd06..16cd2cfcfc 100644 --- a/src/misc/geo/coordinategeodeticlist.cpp +++ b/src/misc/geo/coordinategeodeticlist.cpp @@ -41,7 +41,7 @@ namespace swift::misc::geo const double MaxDevFt = maxDeviation.value(CLengthUnit::ft()); const QPair elvStdDevMean = CMathUtils::standardDeviationAndMean(valuesInFt); if (elvStdDevMean.first > MaxDevFt) { return CElevationPlane::null(); } - return CElevationPlane(reference, elvStdDevMean.second, CElevationPlane::singlePointRadius()); + return { reference, elvStdDevMean.second, CElevationPlane::singlePointRadius() }; } } // namespace swift::misc::geo diff --git a/src/misc/icon.cpp b/src/misc/icon.cpp index df8ffb810f..f3e7e3a4cd 100644 --- a/src/misc/icon.cpp +++ b/src/misc/icon.cpp @@ -42,7 +42,7 @@ namespace swift::misc else { return CIcons::pixmapByIndex(this->getIndex()); } } - QIcon CIcon::toQIcon() const { return QIcon(toPixmap()); } + QIcon CIcon::toQIcon() const { return { toPixmap() }; } QString CIcon::convertToQString(bool i18n) const { diff --git a/src/misc/icons.cpp b/src/misc/icons.cpp index fb75f93962..a0a24dfb15 100644 --- a/src/misc/icons.cpp +++ b/src/misc/icons.cpp @@ -1134,7 +1134,7 @@ namespace swift::misc { QImage imgSource(icon.pixmap(targetsize).toImage()); QImage destBackgroundImg(changeImageBackgroundColor(imgSource, backgroundColor)); - return QIcon(QPixmap::fromImage(destBackgroundImg)); + return { QPixmap::fromImage(destBackgroundImg) }; } } // namespace swift::misc diff --git a/src/misc/imageutils.cpp b/src/misc/imageutils.cpp index 09a70cbac9..82979746a7 100644 --- a/src/misc/imageutils.cpp +++ b/src/misc/imageutils.cpp @@ -17,7 +17,7 @@ bool swift::misc::pixmapToPngByteArray(const QPixmap &pixmap, QByteArray &array) QPixmap swift::misc::pngByteArrayToPixmap(const QByteArray &array) { - if (array.isEmpty()) { return QPixmap(); } + if (array.isEmpty()) { return {}; } QPixmap p; bool s = p.loadFromData(array, "PNG"); return s ? p : QPixmap(); @@ -34,13 +34,13 @@ QString swift::misc::pixmapToPngHexString(const QPixmap &pixmap) { QByteArray ba; bool s = pixmapToPngByteArray(pixmap, ba); - if (!s) { return QString(); } + if (!s) { return {}; } return ba.toHex(); } QPixmap swift::misc::pngHexStringToPixmap(const QString &hexString) { - if (hexString.isEmpty()) { return QPixmap(); } + if (hexString.isEmpty()) { return {}; } QByteArray ba(QByteArray::fromHex(hexString.toLatin1())); return pngByteArrayToPixmap(ba); } @@ -54,7 +54,7 @@ bool swift::misc::pngHexStringToPixmapRef(const QString &hexString, QPixmap &pix QPixmap swift::misc::iconToPixmap(const QIcon &icon) { - if (icon.isNull()) { return QPixmap(); } + if (icon.isNull()) { return {}; } const QList sizes = icon.availableSizes(); if (!sizes.isEmpty()) { return icon.pixmap(sizes.first()); } return icon.pixmap(16, 16); diff --git a/src/misc/input/keyboardkey.cpp b/src/misc/input/keyboardkey.cpp index ea342da9bc..11ca279fc5 100644 --- a/src/misc/input/keyboardkey.cpp +++ b/src/misc/input/keyboardkey.cpp @@ -24,7 +24,7 @@ namespace swift::misc::input QString CKeyboardKey::getKeyAsString() const { - if (m_keyCode == Key_Unknown) return QString(); + if (m_keyCode == Key_Unknown) return {}; static const QHash keyStrings = { { Key_ShiftLeft, QStringLiteral("ShiftLeft") }, { Key_ShiftRight, QStringLiteral("ShiftRight") }, diff --git a/src/misc/json.cpp b/src/misc/json.cpp index 2377dffbc8..023c23217b 100644 --- a/src/misc/json.cpp +++ b/src/misc/json.cpp @@ -412,7 +412,7 @@ namespace swift::misc::json { QJsonObject jsonObjectFromString(const QString &json, bool acceptCacheFormat) { - if (json.isEmpty()) { return QJsonObject(); } + if (json.isEmpty()) { return {}; } QJsonParseError error {}; const QJsonDocument jsonDoc(QJsonDocument::fromJson(json.toUtf8(), &error)); @@ -430,7 +430,7 @@ namespace swift::misc::json QJsonArray jsonArrayFromString(const QString &json) { - if (json.isEmpty()) { return QJsonArray(); } + if (json.isEmpty()) { return {}; } const QJsonDocument jsonDoc(QJsonDocument::fromJson(json.toUtf8())); return jsonDoc.array(); } diff --git a/src/misc/math/mathutils.cpp b/src/misc/math/mathutils.cpp index b576dcb7a0..823ae395e3 100644 --- a/src/misc/math/mathutils.cpp +++ b/src/misc/math/mathutils.cpp @@ -155,6 +155,6 @@ namespace swift::misc::math const double meanValue = mean(values); const double varianceValue = mean(squaredDifferences(values, meanValue)); const double sd = sqrt(varianceValue); - return QPair(sd, meanValue); + return { sd, meanValue }; } } // namespace swift::misc::math diff --git a/src/misc/namevariantpair.cpp b/src/misc/namevariantpair.cpp index bc0bf6c46f..f8f209f719 100644 --- a/src/misc/namevariantpair.cpp +++ b/src/misc/namevariantpair.cpp @@ -30,8 +30,8 @@ namespace swift::misc const auto i = index.frontCasted(); switch (i) { - case IndexName: return QVariant(this->m_name); - case IndexVariant: return this->m_variant; + case IndexName: return { this->m_name }; + case IndexVariant: return this->m_variant; // NOLINT(modernize-return-braced-init-list) default: return CValueObject::propertyByIndex(index); } } diff --git a/src/misc/namevariantpairlist.cpp b/src/misc/namevariantpairlist.cpp index bda704f4cf..d964afe746 100644 --- a/src/misc/namevariantpairlist.cpp +++ b/src/misc/namevariantpairlist.cpp @@ -20,7 +20,7 @@ namespace swift::misc QStringList CNameVariantPairList::getNames(bool sorted) const { - if (this->isEmpty()) { return QStringList(); } + if (this->isEmpty()) { return {}; } QStringList codes = this->transform(predicates::MemberTransform(&CNameVariantPair::getName)); if (sorted) { codes.sort(); } return codes; @@ -28,21 +28,21 @@ namespace swift::misc CNameVariantPair CNameVariantPairList::getValue(const QString &name) const { - if (name.isEmpty()) { return CNameVariantPair(); } + if (name.isEmpty()) { return {}; } return this->findBy(&CNameVariantPair::getName, name).frontOrDefault(); } CVariant CNameVariantPairList::getVariantValue(const QString &name) const { - if (name.isEmpty()) { return CVariant(); } + if (name.isEmpty()) { return {}; } return getValue(name).getVariant(); } QString CNameVariantPairList::getValueAsString(const QString &name) const { - if (name.isEmpty()) { return QString(); } + if (name.isEmpty()) { return {}; } const CVariant cs(getValue(name).getVariant()); - if (cs.isNull() || !cs.canConvert()) { return QString(); } + if (cs.isNull() || !cs.canConvert()) { return {}; } return cs.value(); } diff --git a/src/misc/network/client.cpp b/src/misc/network/client.cpp index 2463cdda36..8ce7a41e9e 100644 --- a/src/misc/network/client.cpp +++ b/src/misc/network/client.cpp @@ -89,15 +89,15 @@ namespace swift::misc::network switch (i) { case IndexCapabilities: return QVariant::fromValue(m_capabilities); - case IndexCapabilitiesString: return QVariant(this->getCapabilitiesAsString()); + case IndexCapabilitiesString: return { this->getCapabilitiesAsString() }; case IndexCallsign: return this->getCallsign().propertyByIndex(index.copyFrontRemoved()); case IndexUser: return this->getUser().propertyByIndex(index.copyFrontRemoved()); - case IndexModelString: return QVariant(m_modelString); - case IndexServer: return QVariant(m_server); + case IndexModelString: return { m_modelString }; + case IndexServer: return { m_server }; case IndexVoiceCapabilities: return m_voiceCapabilities.propertyByIndex(index.copyFrontRemoved()); case IndexVoiceCapabilitiesPixmap: return QVariant::fromValue(CIcon(m_voiceCapabilities.toIcon()).toPixmap()); case IndexVoiceCapabilitiesIcon: return QVariant::fromValue(CIcon(m_voiceCapabilities.toIcon())); - case IndexVoiceCapabilitiesString: return QVariant(m_voiceCapabilities.toQString(true)); + case IndexVoiceCapabilitiesString: return { m_voiceCapabilities.toQString(true) }; default: break; } return CValueObject::propertyByIndex(index); diff --git a/src/misc/network/clientprovider.cpp b/src/misc/network/clientprovider.cpp index d937a481db..37d57a7837 100644 --- a/src/misc/network/clientprovider.cpp +++ b/src/misc/network/clientprovider.cpp @@ -17,7 +17,7 @@ namespace swift::misc::network QReadLocker l(&m_lockClient); clients = m_clients.values(); } - return CClientList(clients); + return { clients }; } void CClientProvider::setClients(const CClientList &clients) @@ -46,7 +46,7 @@ namespace swift::misc::network QReadLocker l(&m_lockClient); if (m_clients.contains(callsign)) { return m_clients.value(callsign); } } - return CClient(); + return {}; } bool CClientProvider::setOtherClient(const CClient &client) @@ -152,13 +152,13 @@ namespace swift::misc::network CClientList CClientAware::getClients() const { if (this->provider()) { return this->provider()->getClients(); } - return CClientList(); + return {}; } CClient CClientAware::getClientOrDefaultForCallsign(const aviation::CCallsign &callsign) const { if (this->provider()) { return this->provider()->getClientOrDefaultForCallsign(callsign); } - return CClient(); + return {}; } bool CClientAware::hasClientInfo(const CCallsign &callsign) const diff --git a/src/misc/network/networkutils.cpp b/src/misc/network/networkutils.cpp index e78b7ce80f..697652521c 100644 --- a/src/misc/network/networkutils.cpp +++ b/src/misc/network/networkutils.cpp @@ -205,7 +205,7 @@ namespace swift::misc::network { return lastModifiedQv.value(); } - return QDateTime(); + return {}; } qint64 CNetworkUtils::lastModifiedSinceNow(const QNetworkReply *nwReply) @@ -246,9 +246,9 @@ namespace swift::misc::network QUrl CNetworkUtils::getHttpRedirectUrl(QNetworkReply *nwReply) { - if (!nwReply) { return QUrl(); } + if (!nwReply) { return {}; } const QVariant possibleRedirectUrl = nwReply->attribute(QNetworkRequest::RedirectionTargetAttribute); - if (!possibleRedirectUrl.isValid()) { return QUrl(); } + if (!possibleRedirectUrl.isValid()) { return {}; } QUrl redirectUrl = possibleRedirectUrl.toUrl(); if (redirectUrl.isRelative()) { redirectUrl = nwReply->url().resolved(redirectUrl); } return redirectUrl; diff --git a/src/misc/network/remotefilelist.cpp b/src/misc/network/remotefilelist.cpp index f8b8753ffb..aa07de0968 100644 --- a/src/misc/network/remotefilelist.cpp +++ b/src/misc/network/remotefilelist.cpp @@ -32,28 +32,28 @@ namespace swift::misc::network CRemoteFile CRemoteFileList::findFirstByNameOrDefault(const QString &name) const { - if (name.isEmpty()) { return CRemoteFile(); } + if (name.isEmpty()) { return {}; } return this->findFirstByOrDefault(&CRemoteFile::getName, name); } CRemoteFile CRemoteFileList::findFirstContainingNameOrDefault(const QString &name, Qt::CaseSensitivity cs) const { - if (name.isEmpty()) { return CRemoteFile(); } + if (name.isEmpty()) { return {}; } for (const CRemoteFile &rf : *this) { if (rf.getName().contains(name, cs)) { return rf; } } - return CRemoteFile(); + return {}; } CRemoteFile CRemoteFileList::findFirstByMatchingBaseNameOrDefault(const QString &baseName) const { - if (baseName.isEmpty()) { return CRemoteFile(); } + if (baseName.isEmpty()) { return {}; } for (const CRemoteFile &rf : *this) { if (rf.matchesBaseName(baseName)) { return rf; } } - return CRemoteFile(); + return {}; } CRemoteFileList CRemoteFileList::findExecutableFiles() const @@ -87,7 +87,7 @@ namespace swift::misc::network CRemoteFileList CRemoteFileList::fromDatabaseJson(const QString &json) { - if (json.isEmpty()) { return CRemoteFileList(); } + if (json.isEmpty()) { return {}; } return CRemoteFileList::fromDatabaseJson(json::jsonArrayFromString(json)); } } // namespace swift::misc::network diff --git a/src/misc/network/url.cpp b/src/misc/network/url.cpp index 7e209e653c..bd15bc04fe 100644 --- a/src/misc/network/url.cpp +++ b/src/misc/network/url.cpp @@ -98,7 +98,7 @@ namespace swift::misc::network QString CUrl::getFileName() const { return toQUrl().fileName(); } - QUrl CUrl::toQUrl() const { return QUrl(getFullUrl()); } + QUrl CUrl::toQUrl() const { return { getFullUrl() }; } void CUrl::setQUrl(const QUrl &url) { diff --git a/src/misc/network/urlloglist.cpp b/src/misc/network/urlloglist.cpp index 17cb9bb2c3..d1251f0bb5 100644 --- a/src/misc/network/urlloglist.cpp +++ b/src/misc/network/urlloglist.cpp @@ -28,7 +28,7 @@ namespace swift::misc::network CUrlLogList CUrlLogList::findOutdatedPending(int outdatedOffsetMs) const { - if (this->isEmpty()) { return CUrlLogList(); } + if (this->isEmpty()) { return {}; } return this->findPending().findBeforeNowMinusOffset(outdatedOffsetMs); } diff --git a/src/misc/network/user.cpp b/src/misc/network/user.cpp index 041abb9c62..d8158d41c9 100644 --- a/src/misc/network/user.cpp +++ b/src/misc/network/user.cpp @@ -244,12 +244,12 @@ namespace swift::misc::network const auto i = index.frontCasted(); switch (i) { - case IndexEmail: return QVariant(m_email); - case IndexId: return QVariant(m_id); - case IndexId7Digit: return QVariant(this->get7DigitId()); + case IndexEmail: return { m_email }; + case IndexId: return { m_id }; + case IndexId7Digit: return { this->get7DigitId() }; case IndexIdInteger: return QVariant::fromValue(this->getIntegerId()); - case IndexPassword: return QVariant(m_password); - case IndexRealName: return QVariant(m_realname); + case IndexPassword: return { m_password }; + case IndexRealName: return { m_realname }; case IndexHomebase: return m_homebase.propertyByIndex(index.copyFrontRemoved()); case IndexCallsign: return m_callsign.propertyByIndex(index.copyFrontRemoved()); default: return CValueObject::propertyByIndex(index); diff --git a/src/misc/network/voicecapabilities.cpp b/src/misc/network/voicecapabilities.cpp index 7c26e7f5c5..8708d1c509 100644 --- a/src/misc/network/voicecapabilities.cpp +++ b/src/misc/network/voicecapabilities.cpp @@ -132,10 +132,7 @@ namespace swift::misc::network return u; // normally never reached } - CVoiceCapabilities CVoiceCapabilities::fromFlightPlanRemarks(const QString &remarks) - { - return CVoiceCapabilities(remarks); - } + CVoiceCapabilities CVoiceCapabilities::fromFlightPlanRemarks(const QString &remarks) { return { remarks }; } CVoiceCapabilities CVoiceCapabilities::fromText(const QString &text) { @@ -144,11 +141,11 @@ namespace swift::misc::network const CVoiceCapabilities vc(text); return vc; } - if (text.contains("TEXT", Qt::CaseInsensitive)) { return CVoiceCapabilities(TextOnly); } - if (text.contains("ONLY", Qt::CaseInsensitive)) { return CVoiceCapabilities(TextOnly); } - if (text.contains("RECEIVE", Qt::CaseInsensitive)) { return CVoiceCapabilities(VoiceReceivingOnly); } - if (text.contains("VOICE", Qt::CaseInsensitive)) { return CVoiceCapabilities(Voice); } - return CVoiceCapabilities(Unknown); + if (text.contains("TEXT", Qt::CaseInsensitive)) { return { TextOnly }; } + if (text.contains("ONLY", Qt::CaseInsensitive)) { return { TextOnly }; } + if (text.contains("RECEIVE", Qt::CaseInsensitive)) { return { VoiceReceivingOnly }; } + if (text.contains("VOICE", Qt::CaseInsensitive)) { return { Voice }; } + return { Unknown }; } const QList &CVoiceCapabilities::allCapabilities() diff --git a/src/misc/obfuscation.cpp b/src/misc/obfuscation.cpp index 0d025b9a26..2a2d36b216 100644 --- a/src/misc/obfuscation.cpp +++ b/src/misc/obfuscation.cpp @@ -12,7 +12,7 @@ namespace swift::misc QString CObfuscation::decode(const QString &inString, bool trimmed) { if (!inString.startsWith(prefix())) { return trimmed ? inString.trimmed() : inString; } - if (inString.length() == prefix().length()) { return QString(); } + if (inString.length() == prefix().length()) { return {}; } SimpleCrypt simpleCrypt(Key); const QString decoded = simpleCrypt.decryptToString(inString.mid(prefix().length())); return trimmed ? decoded.trimmed() : decoded; diff --git a/src/misc/propertyindex.cpp b/src/misc/propertyindex.cpp index 06b20c0600..27f969dc32 100644 --- a/src/misc/propertyindex.cpp +++ b/src/misc/propertyindex.cpp @@ -26,7 +26,7 @@ namespace swift::misc CPropertyIndex CPropertyIndex::copyFrontRemoved() const { SWIFT_VERIFY_X(!this->isEmpty(), Q_FUNC_INFO, "Empty index"); - if (this->isEmpty()) { return CPropertyIndex(); } + if (this->isEmpty()) { return {}; } CPropertyIndex copy = *this; copy.m_indexes.pop_front(); return copy; diff --git a/src/misc/propertyindexlist.cpp b/src/misc/propertyindexlist.cpp index e6d3850643..4ae3e13dd0 100644 --- a/src/misc/propertyindexlist.cpp +++ b/src/misc/propertyindexlist.cpp @@ -11,7 +11,7 @@ namespace swift::misc CPropertyIndexList CPropertyIndexList::copyFrontRemoved() const { - if (this->size() < 2) { return CPropertyIndexList(); } + if (this->size() < 2) { return {}; } CPropertyIndexList copy(*this); copy.pop_front(); return copy; diff --git a/src/misc/rgbcolor.cpp b/src/misc/rgbcolor.cpp index 603eb0b491..e2a269e026 100644 --- a/src/misc/rgbcolor.cpp +++ b/src/misc/rgbcolor.cpp @@ -49,7 +49,7 @@ namespace swift::misc } } - QColor CRgbColor::toQColor() const { return QColor(red(), green(), blue()); } + QColor CRgbColor::toQColor() const { return { red(), green(), blue() }; } bool CRgbColor::setQColor(const QColor &color) { diff --git a/src/misc/simulation/aircraftmodel.cpp b/src/misc/simulation/aircraftmodel.cpp index b0063ed9a7..eb23812d4d 100644 --- a/src/misc/simulation/aircraftmodel.cpp +++ b/src/misc/simulation/aircraftmodel.cpp @@ -251,23 +251,23 @@ namespace swift::misc::simulation const auto i = index.frontCasted(); switch (i) { - case IndexModelString: return QVariant(m_modelString); - case IndexModelStringAlias: return QVariant(m_modelStringAlias); + case IndexModelString: return { m_modelString }; + case IndexModelStringAlias: return { m_modelStringAlias }; case IndexAllModelStrings: return this->getAllModelStringsAndAliases(); case IndexHasQueriedModelString: return QVariant::fromValue(this->hasQueriedModelString()); case IndexModelType: return QVariant::fromValue(m_modelType); - case IndexModelTypeAsString: return QVariant(this->getModelTypeAsString()); + case IndexModelTypeAsString: return { this->getModelTypeAsString() }; case IndexModelMode: return QVariant::fromValue(m_modelMode); case IndexModelModeAsString: return QVariant::fromValue(this->getModelModeAsString()); case IndexModelModeAsIcon: return QVariant::fromValue(this->getModelModeAsIcon()); case IndexDistributor: return m_distributor.propertyByIndex(index.copyFrontRemoved()); case IndexSimulatorInfo: return m_simulator.propertyByIndex(index.copyFrontRemoved()); - case IndexSimulatorInfoAsString: return QVariant(m_simulator.toQString()); - case IndexDescription: return QVariant(m_description); - case IndexName: return QVariant(m_name); - case IndexFileName: return QVariant(m_fileName); + case IndexSimulatorInfoAsString: return { m_simulator.toQString() }; + case IndexDescription: return { m_description }; + case IndexName: return { m_name }; + case IndexFileName: return { m_fileName }; case IndexCG: return m_cg.propertyByIndex(index.copyFrontRemoved()); - case IndexSupportedParts: return QVariant(m_supportedParts); + case IndexSupportedParts: return { m_supportedParts }; case IndexFileTimestamp: return QVariant::fromValue(this->getFileTimestamp()); case IndexFileTimestampFormattedYmdhms: return QVariant::fromValue(this->getFormattedFileTimestampYmdhms()); case IndexAircraftIcaoCode: return m_aircraftIcao.propertyByIndex(index.copyFrontRemoved()); @@ -568,7 +568,7 @@ namespace swift::misc::simulation QString CAircraftModel::getSwiftLiveryString(bool aircraftIcao, bool livery, bool model) const { - if (!aircraftIcao && !livery && !model) { return QString(); } + if (!aircraftIcao && !livery && !model) { return {}; } const QString l = (livery && this->getLivery().hasValidDbKey() ? u'l' % this->getLivery().getDbKeyAsString() : QString()) % (aircraftIcao && this->getAircraftIcaoCode().hasValidDbKey() ? @@ -587,7 +587,7 @@ namespace swift::misc::simulation DBTripleIds CAircraftModel::parseNetworkLiveryString(const QString &liveryString) { // "swift_m22l33a11" - if (!CAircraftModel::isSwiftLiveryString(liveryString)) { return DBTripleIds(); } + if (!CAircraftModel::isSwiftLiveryString(liveryString)) { return {}; } DBTripleIds ids; const QString ls = liveryString.mid(liveryStringPrefix().length()).toLower(); @@ -742,7 +742,7 @@ namespace swift::misc::simulation QDir CAircraftModel::getFileDirectory() const { - if (!this->hasFileName()) { return QDir(); } + if (!this->hasFileName()) { return {}; } const QFileInfo fi(CFileUtils::fixWindowsUncPath(this->getFileName())); return fi.absoluteDir(); } @@ -1095,7 +1095,7 @@ namespace swift::misc::simulation QString CAircraftModel::cleanUpPartsString(const QString &p) { - if (p.isEmpty()) { return QString(); } + if (p.isEmpty()) { return {}; } QString pc = removeChars(p.toUpper(), [](QChar c) { return !supportedParts().contains(c); }); std::sort(pc.begin(), pc.end()); return pc; diff --git a/src/misc/simulation/aircraftmodellist.cpp b/src/misc/simulation/aircraftmodellist.cpp index f5bab0eafc..93d0cc4af2 100644 --- a/src/misc/simulation/aircraftmodellist.cpp +++ b/src/misc/simulation/aircraftmodellist.cpp @@ -104,7 +104,7 @@ namespace swift::misc::simulation CAircraftModel CAircraftModelList::findFirstByModelStringOrDefault(const QString &modelString, Qt::CaseSensitivity sensitivity) const { - if (modelString.isEmpty()) { return CAircraftModel(); } + if (modelString.isEmpty()) { return {}; } return this->findFirstByOrDefault( [&](const CAircraftModel &model) { return model.matchesModelString(modelString, sensitivity); }); } @@ -112,14 +112,14 @@ namespace swift::misc::simulation CAircraftModel CAircraftModelList::findFirstByModelStringAliasOrDefault(const QString &modelString, Qt::CaseSensitivity sensitivity) const { - if (modelString.isEmpty()) { return CAircraftModel(); } + if (modelString.isEmpty()) { return {}; } return this->findFirstByOrDefault( [&](const CAircraftModel &model) { return model.matchesModelStringOrAlias(modelString, sensitivity); }); } CAircraftModel CAircraftModelList::findFirstByCallsignOrDefault(const CCallsign &callsign) const { - if (callsign.isEmpty()) { return CAircraftModel(); } + if (callsign.isEmpty()) { return {}; } return this->findFirstByOrDefault([&](const CAircraftModel &model) { return model.getCallsign() == callsign; }); } @@ -156,7 +156,7 @@ namespace swift::misc::simulation CAircraftModelList::findByAircraftDesignatorAndLiveryCombinedCode(const QString &aircraftDesignator, const QString &combinedCode) const { - if (aircraftDesignator.isEmpty()) { return CAircraftModelList(); } + if (aircraftDesignator.isEmpty()) { return {}; } return this->findBy([&](const CAircraftModel &model) { if (!model.getAircraftIcaoCode().matchesDesignator(aircraftDesignator)) { return false; } return model.getLivery().matchesCombinedCode(combinedCode); @@ -207,7 +207,7 @@ namespace swift::misc::simulation CAircraftModelList CAircraftModelList::findByLiveryCode(const CLivery &livery) const { - if (!livery.hasCombinedCode()) { return CAircraftModelList(); } + if (!livery.hasCombinedCode()) { return {}; } const QString code(livery.getCombinedCode()); return this->findBy([&](const CAircraftModel &model) { if (!model.getLivery().hasCombinedCode()) return false; @@ -232,7 +232,7 @@ namespace swift::misc::simulation CAircraftModelList CAircraftModelList::findWithAircraftDesignator(const QSet &designators) const { - if (designators.isEmpty()) { return CAircraftModelList(); } + if (designators.isEmpty()) { return {}; } return this->findBy( [&](const CAircraftModel &model) { return designators.contains(model.getAircraftIcaoCodeDesignator()); }); } @@ -244,7 +244,7 @@ namespace swift::misc::simulation CAircraftModelList CAircraftModelList::findByManufacturer(const QString &manufacturer) const { - if (manufacturer.isEmpty()) { return CAircraftModelList(); } + if (manufacturer.isEmpty()) { return {}; } const QString m(manufacturer.toUpper().trimmed()); return this->findBy( [&](const CAircraftModel &model) { return model.getAircraftIcaoCode().getManufacturer() == m; }); @@ -252,7 +252,7 @@ namespace swift::misc::simulation CAircraftModelList CAircraftModelList::findByFamily(const QString &family) const { - if (family.isEmpty()) { return CAircraftModelList(); } + if (family.isEmpty()) { return {}; } const QString f(family.toUpper().trimmed()); return this->findBy([&](const CAircraftModel &model) { const CAircraftIcaoCode icao(model.getAircraftIcaoCode()); @@ -263,7 +263,7 @@ namespace swift::misc::simulation CAircraftModelList CAircraftModelList::findByFamilyWithColorLivery(const QString &family) const { - if (family.isEmpty()) { return CAircraftModelList(); } + if (family.isEmpty()) { return {}; } const QString f(family.toUpper().trimmed()); return this->findBy([&](const CAircraftModel &model) { if (!model.getLivery().isColorLivery()) { return false; } @@ -297,7 +297,7 @@ namespace swift::misc::simulation CAircraftModelList CAircraftModelList::findByCombinedType(const QString &combinedType) const { const QString cc(combinedType.trimmed().toUpper()); - if (combinedType.length() != 3) { return CAircraftModelList(); } + if (combinedType.length() != 3) { return {}; } return this->findBy([&](const CAircraftModel &model) { const CAircraftIcaoCode icao(model.getAircraftIcaoCode()); return icao.matchesCombinedType(cc); @@ -391,7 +391,7 @@ namespace swift::misc::simulation CAircraftModelList CAircraftModelList::findByCategoryFirstLevel(int firstLevel) const { - if (firstLevel < 0) { return CAircraftModelList(); } + if (firstLevel < 0) { return {}; } return this->findBy([=](const CAircraftModel &model) { return (model.hasCategory() && model.getAircraftIcaoCode().getCategory().getFirstLevel() == firstLevel); }); @@ -399,7 +399,7 @@ namespace swift::misc::simulation CAircraftModelList CAircraftModelList::findByCategory(const CAircraftCategory &category) const { - if (category.isNull()) { return CAircraftModelList(); } + if (category.isNull()) { return {}; } return this->findBy([=](const CAircraftModel &model) { return (model.hasCategory() && model.getAircraftIcaoCode().getCategory() == category); }); @@ -407,7 +407,7 @@ namespace swift::misc::simulation CAircraftModelList CAircraftModelList::findByCategories(const CAircraftCategoryList &categories) const { - if (categories.isEmpty()) { return CAircraftModelList(); } + if (categories.isEmpty()) { return {}; } return this->findBy([=](const CAircraftModel &model) { return (model.hasCategory() && categories.contains(model.getAircraftIcaoCode().getCategory())); }); @@ -576,7 +576,7 @@ namespace swift::misc::simulation if (!icao.hasFamily()) continue; if (icao.matchesDesignator(aircraftIcaoCode.getDesignator())) { return icao.getFamily(); } } - return QString(); + return {}; } CAircraftModelList CAircraftModelList::matchesSimulator(const CSimulatorInfo &simulator) const @@ -629,7 +629,7 @@ namespace swift::misc::simulation CAircraftModelList CAircraftModelList::findByDistributors(const CDistributorList &distributors) const { - if (distributors.isEmpty()) { return CAircraftModelList(); } + if (distributors.isEmpty()) { return {}; } return this->findBy([&](const CAircraftModel &model) { return model.matchesAnyDbDistributor(distributors); }); } @@ -654,7 +654,7 @@ namespace swift::misc::simulation s |= model.getSimulator().getSimulator(); if (s == CSimulatorInfo::All) { break; } } - return CSimulatorInfo(s); + return { s }; } namespace private_ns @@ -925,10 +925,10 @@ namespace swift::misc::simulation CSimulatorInfo CAircraftModelList::simulatorsWithMaxEntries() const { - if (this->isEmpty()) { return CSimulatorInfo(); } // not known + if (this->isEmpty()) { return {}; } // not known const CCountPerSimulator counts(this->countPerSimulator()); const int simulatorsRepresented = counts.simulatorsRepresented(); - if (simulatorsRepresented < 1) { return CSimulatorInfo(); } + if (simulatorsRepresented < 1) { return {}; } const QMultiMap cps(counts.countPerSimulator()); CSimulatorInfo maxSim = cps.last(); const int count = cps.lastKey(); // how many elements @@ -1024,7 +1024,7 @@ namespace swift::misc::simulation CDistributorList CAircraftModelList::getDistributors(bool onlyDbDistributors) const { - if (this->isEmpty()) { return CDistributorList(); } + if (this->isEmpty()) { return {}; } CDistributorList distributors; for (const CAircraftModel &model : *this) { @@ -1038,7 +1038,7 @@ namespace swift::misc::simulation CAircraftIcaoCodeList CAircraftModelList::getAircraftIcaoCodesFromDb() const { - if (this->isEmpty()) { return CAircraftIcaoCodeList(); } + if (this->isEmpty()) { return {}; } QSet keys; CAircraftIcaoCodeList icaos; for (const CAircraftModel &model : *this) @@ -1091,7 +1091,7 @@ namespace swift::misc::simulation CAirlineIcaoCodeList CAircraftModelList::getAirlineIcaoCodesFromDb() const { - if (this->isEmpty()) { return CAirlineIcaoCodeList(); } + if (this->isEmpty()) { return {}; } QSet keys; CAirlineIcaoCodeList icaos; for (const CAircraftModel &model : *this) @@ -1299,7 +1299,7 @@ namespace swift::misc::simulation CStatusMessageList CAircraftModelList::validateForPublishing(CAircraftModelList &validModels, CAircraftModelList &invalidModels) const { - if (this->isEmpty()) { return CStatusMessageList(); } + if (this->isEmpty()) { return {}; } CStatusMessageList msgs; for (const CAircraftModel &model : *this) { diff --git a/src/misc/simulation/data/modelcaches.cpp b/src/misc/simulation/data/modelcaches.cpp index 96946fe4f6..a33bd6c2d7 100644 --- a/src/misc/simulation/data/modelcaches.cpp +++ b/src/misc/simulation/data/modelcaches.cpp @@ -215,7 +215,7 @@ namespace swift::misc::simulation::data case CSimulatorInfo::FG: return m_modelCacheFG.get(); case CSimulatorInfo::MSFS: return m_modelCacheMsfs.get(); case CSimulatorInfo::MSFS2024: return m_modelCacheMsfs2024.get(); - default: Q_ASSERT_X(false, Q_FUNC_INFO, "wrong simulator"); return CAircraftModelList(); + default: Q_ASSERT_X(false, Q_FUNC_INFO, "wrong simulator"); return {}; } } @@ -235,7 +235,7 @@ namespace swift::misc::simulation::data case CSimulatorInfo::FG: msg = m_modelCacheFG.set(setModels); break; case CSimulatorInfo::MSFS: msg = m_modelCacheMsfs.set(setModels); break; case CSimulatorInfo::MSFS2024: msg = m_modelCacheMsfs2024.set(setModels); break; - default: Q_ASSERT_X(false, Q_FUNC_INFO, "wrong simulator"); return CStatusMessage(); + default: Q_ASSERT_X(false, Q_FUNC_INFO, "wrong simulator"); return {}; } this->emitCacheChanged(simulator); // set return msg; @@ -292,7 +292,7 @@ namespace swift::misc::simulation::data case CSimulatorInfo::FG: return m_modelCacheFG.getAvailableTimestamp(); case CSimulatorInfo::MSFS: return m_modelCacheMsfs.getAvailableTimestamp(); case CSimulatorInfo::MSFS2024: return m_modelCacheMsfs2024.getAvailableTimestamp(); - default: Q_ASSERT_X(false, Q_FUNC_INFO, "wrong simulator"); return QDateTime(); + default: Q_ASSERT_X(false, Q_FUNC_INFO, "wrong simulator"); return {}; } } @@ -315,7 +315,7 @@ namespace swift::misc::simulation::data return m_modelCacheMsfs2024.set(m_modelCacheMsfs2024.get(), ts.toMSecsSinceEpoch()); default: Q_ASSERT_X(false, Q_FUNC_INFO, "Wrong simulator"); break; } - return CStatusMessage(); + return {}; } void CModelCaches::synchronizeCache(const CSimulatorInfo &simulator) { this->synchronizeCacheImpl(simulator); } @@ -432,7 +432,7 @@ namespace swift::misc::simulation::data case CSimulatorInfo::FG: return m_modelCacheFG.get(); case CSimulatorInfo::MSFS: return m_modelCacheMsfs.get(); case CSimulatorInfo::MSFS2024: return m_modelCacheMsfs2024.get(); - default: Q_ASSERT_X(false, Q_FUNC_INFO, "wrong simulator"); return CAircraftModelList(); + default: Q_ASSERT_X(false, Q_FUNC_INFO, "wrong simulator"); return {}; } } @@ -463,7 +463,7 @@ namespace swift::misc::simulation::data case CSimulatorInfo::FG: msg = m_modelCacheFG.set(orderedModels); break; case CSimulatorInfo::MSFS: msg = m_modelCacheMsfs.set(orderedModels); break; case CSimulatorInfo::MSFS2024: msg = m_modelCacheMsfs2024.set(orderedModels); break; - default: Q_ASSERT_X(false, Q_FUNC_INFO, "wrong simulator"); return CStatusMessage(); + default: Q_ASSERT_X(false, Q_FUNC_INFO, "wrong simulator"); return {}; } this->emitCacheChanged(simulator); // set return msg; @@ -481,7 +481,7 @@ namespace swift::misc::simulation::data case CSimulatorInfo::FG: return m_modelCacheFG.getAvailableTimestamp(); case CSimulatorInfo::MSFS: return m_modelCacheMsfs.getAvailableTimestamp(); case CSimulatorInfo::MSFS2024: return m_modelCacheMsfs2024.getAvailableTimestamp(); - default: Q_ASSERT_X(false, Q_FUNC_INFO, "Wrong simulator"); return QDateTime(); + default: Q_ASSERT_X(false, Q_FUNC_INFO, "Wrong simulator"); return {}; } } @@ -504,7 +504,7 @@ namespace swift::misc::simulation::data return m_modelCacheMsfs2024.set(m_modelCacheMsfs2024.get(), ts.toMSecsSinceEpoch()); default: Q_ASSERT_X(false, Q_FUNC_INFO, "Wrong simulator"); break; } - return CStatusMessage(); + return {}; } void CModelSetCaches::synchronizeCache(const CSimulatorInfo &simulator) { this->synchronizeCacheImpl(simulator); } diff --git a/src/misc/simulation/distributor.cpp b/src/misc/simulation/distributor.cpp index 466fd271ad..96821623c0 100644 --- a/src/misc/simulation/distributor.cpp +++ b/src/misc/simulation/distributor.cpp @@ -173,7 +173,7 @@ namespace swift::misc::simulation if (!existsKey(json, prefix)) { // when using relationship, this can be null - return CDistributor(); + return {}; } const QString description(json.value(prefix % u"description").toString()); diff --git a/src/misc/simulation/distributorlist.cpp b/src/misc/simulation/distributorlist.cpp index 4753ce4d26..031ba01fda 100644 --- a/src/misc/simulation/distributorlist.cpp +++ b/src/misc/simulation/distributorlist.cpp @@ -16,12 +16,12 @@ namespace swift::misc::simulation CDistributor CDistributorList::findByKeyOrAlias(const QString &keyOrAlias) const { - if (keyOrAlias.isEmpty()) { return CDistributor(); } + if (keyOrAlias.isEmpty()) { return {}; } for (const CDistributor &distributor : (*this)) { if (distributor.matchesKeyOrAlias(keyOrAlias)) { return distributor; } } - return CDistributor(); + return {}; } CDistributor CDistributorList::findByModelData(const CAircraftModel &model) const @@ -37,7 +37,7 @@ namespace swift::misc::simulation return this->findByKeyOrAlias("PAI"); } - return CDistributor(); + return {}; } CDistributorList CDistributorList::findFsFamilyStandard() const @@ -58,7 +58,7 @@ namespace swift::misc::simulation // more lenient search return this->findByKeyOrAlias(key); } - return CDistributor(); + return {}; } CDistributor CDistributorList::smartDistributorSelector(const CDistributor &distributorPattern, @@ -81,7 +81,7 @@ namespace swift::misc::simulation QStringList CDistributorList::getDbKeysAndAliases(bool sort) const { - if (this->isEmpty()) { return QStringList(); } + if (this->isEmpty()) { return {}; } QStringList sl; for (const CDistributor &d : *this) { @@ -96,7 +96,7 @@ namespace swift::misc::simulation CDistributorList CDistributorList::matchesSimulator(const CSimulatorInfo &simulator) const { - if (this->isEmpty()) { return CDistributorList(); } + if (this->isEmpty()) { return {}; } CDistributorList distributors; for (const CDistributor &distributor : (*this)) { diff --git a/src/misc/simulation/fscommon/aircraftcfgparser.cpp b/src/misc/simulation/fscommon/aircraftcfgparser.cpp index f9bf5448c2..3a7c23ad10 100644 --- a/src/misc/simulation/fscommon/aircraftcfgparser.cpp +++ b/src/misc/simulation/fscommon/aircraftcfgparser.cpp @@ -140,14 +140,14 @@ namespace swift::misc::simulation::fscommon // function has to be threadsafe // - if (m_cancelLoading) { return CAircraftCfgEntriesList(); } + if (m_cancelLoading) { return {}; } // excluded? if (CFileUtils::isExcludedDirectory(directory, excludeDirectories) || isExcludedSubDirectory(directory)) { const CStatusMessage m = CStatusMessage(this).info(u"Skipping directory '%1' (excluded)") << directory; messages.push_back(m); - return CAircraftCfgEntriesList(); + return {}; } // set directory with name filters, get aircraft.cfg and sub directories @@ -160,7 +160,7 @@ namespace swift::misc::simulation::fscommon dir.setNameFilters(fileNameFilters(getSimulator().isMSFS(), getSimulator().isMSFS2024())); if (!dir.exists()) { - return CAircraftCfgEntriesList(); // can happen if there are shortcuts or linked dirs not available + return {}; // can happen if there are shortcuts or linked dirs not available } const QString currentDir = dir.absolutePath(); @@ -187,7 +187,7 @@ namespace swift::misc::simulation::fscommon for (const auto &fileInfo : files) { - if (m_cancelLoading) { return CAircraftCfgEntriesList(); } + if (m_cancelLoading) { return {}; } if (fileInfo.isDir()) { const QString nextDir = fileInfo.absoluteFilePath(); @@ -251,7 +251,7 @@ namespace swift::misc::simulation::fscommon CStatusMessage(static_cast(nullptr)).warning(u"Unable to read file '%1'") << fnFixed; msgs.push_back(m); - return CAircraftCfgEntriesList(); + return {}; } QTextStream in(&file); diff --git a/src/misc/simulation/interpolation/interpolationlogger.cpp b/src/misc/simulation/interpolation/interpolationlogger.cpp index 1bb0adf17d..68cd073901 100644 --- a/src/misc/simulation/interpolation/interpolationlogger.cpp +++ b/src/misc/simulation/interpolation/interpolationlogger.cpp @@ -212,56 +212,56 @@ namespace swift::misc::simulation SituationLog CInterpolationLogger::getLastSituationLog() const { QReadLocker l(&m_lockSituations); - if (m_situationLogs.isEmpty()) { return SituationLog(); } + if (m_situationLogs.isEmpty()) { return {}; } return m_situationLogs.last(); } SituationLog CInterpolationLogger::getLastSituationLog(const CCallsign &cs) const { const QList copy(this->getSituationsLog(cs)); - if (copy.isEmpty()) { return SituationLog(); } + if (copy.isEmpty()) { return {}; } return copy.last(); } CAircraftSituation CInterpolationLogger::getLastSituation() const { QReadLocker l(&m_lockSituations); - if (m_situationLogs.isEmpty()) { return CAircraftSituation(); } + if (m_situationLogs.isEmpty()) { return {}; } return m_situationLogs.last().situationCurrent; } CAircraftSituation CInterpolationLogger::getLastSituation(const CCallsign &cs) const { const QList copy(this->getSituationsLog(cs)); - if (copy.isEmpty()) { return CAircraftSituation(); } + if (copy.isEmpty()) { return {}; } return copy.last().situationCurrent; } CAircraftParts CInterpolationLogger::getLastParts() const { QReadLocker l(&m_lockParts); - if (m_partsLogs.isEmpty()) { return CAircraftParts(); } + if (m_partsLogs.isEmpty()) { return {}; } return m_partsLogs.last().parts; } CAircraftParts CInterpolationLogger::getLastParts(const CCallsign &cs) const { const QList copy(this->getPartsLog(cs)); - if (copy.isEmpty()) { return CAircraftParts(); } + if (copy.isEmpty()) { return {}; } return copy.last().parts; } PartsLog CInterpolationLogger::getLastPartsLog() const { QReadLocker l(&m_lockParts); - if (m_partsLogs.isEmpty()) { return PartsLog(); } + if (m_partsLogs.isEmpty()) { return {}; } return m_partsLogs.last(); } PartsLog CInterpolationLogger::getLastPartsLog(const CCallsign &cs) const { const QList copy(this->getPartsLog(cs)); - if (copy.isEmpty()) { return PartsLog(); } + if (copy.isEmpty()) { return {}; } return copy.last(); } diff --git a/src/misc/simulation/interpolation/interpolationsetupprovider.cpp b/src/misc/simulation/interpolation/interpolationsetupprovider.cpp index d64e3f4ab1..4f326e9e41 100644 --- a/src/misc/simulation/interpolation/interpolationsetupprovider.cpp +++ b/src/misc/simulation/interpolation/interpolationsetupprovider.cpp @@ -11,17 +11,14 @@ namespace swift::misc::simulation IInterpolationSetupProvider::getInterpolationSetupPerCallsignOrDefault(const CCallsign &callsign) const { QReadLocker l(&m_lockSetup); - if (!m_setupsPerCallsign.contains(callsign)) - { - return CInterpolationAndRenderingSetupPerCallsign(callsign, m_globalSetup); - } + if (!m_setupsPerCallsign.contains(callsign)) { return { callsign, m_globalSetup }; } return m_setupsPerCallsign.value(callsign); } CInterpolationSetupList IInterpolationSetupProvider::getInterpolationSetupsPerCallsign() const { const SetupsPerCallsign setups = this->getSetupsPerCallsign(); - return CInterpolationSetupList(setups.values()); + return { setups.values() }; } bool IInterpolationSetupProvider::hasSetupsPerCallsign() const @@ -200,13 +197,13 @@ namespace swift::misc::simulation CInterpolationAndRenderingSetupPerCallsign CInterpolationSetupAware::getInterpolationSetupPerCallsignOrDefault(const CCallsign &callsign) const { - if (!this->hasProvider()) { return CInterpolationAndRenderingSetupPerCallsign(); } + if (!this->hasProvider()) { return {}; } return this->provider()->getInterpolationSetupPerCallsignOrDefault(callsign); } CInterpolationAndRenderingSetupGlobal CInterpolationSetupAware::getInterpolationSetupGlobal() const { - if (!this->hasProvider()) { return CInterpolationAndRenderingSetupGlobal(); } + if (!this->hasProvider()) { return {}; } return this->provider()->getInterpolationSetupGlobal(); } } // namespace swift::misc::simulation diff --git a/src/misc/simulation/interpolation/interpolatorlinearpbh.cpp b/src/misc/simulation/interpolation/interpolatorlinearpbh.cpp index 40c9b067cd..dc8b410372 100644 --- a/src/misc/simulation/interpolation/interpolatorlinearpbh.cpp +++ b/src/misc/simulation/interpolation/interpolatorlinearpbh.cpp @@ -59,8 +59,7 @@ namespace swift::misc::simulation SWIFT_VERIFY_X(headingStart.getReferenceNorth() == headingEnd.getReferenceNorth(), Q_FUNC_INFO, "Need same reference"); } - return CHeading(interpolateAngle(headingStart, headingEnd, m_simulationTimeFraction), - headingEnd.getReferenceNorth()); + return { interpolateAngle(headingStart, headingEnd, m_simulationTimeFraction), headingEnd.getReferenceNorth() }; } CAngle CInterpolatorLinearPbh::getPitch() const diff --git a/src/misc/simulation/interpolation/interpolatormulti.cpp b/src/misc/simulation/interpolation/interpolatormulti.cpp index 487e983bc7..670a7d8d6b 100644 --- a/src/misc/simulation/interpolation/interpolatormulti.cpp +++ b/src/misc/simulation/interpolation/interpolatormulti.cpp @@ -28,7 +28,7 @@ namespace swift::misc::simulation default: break; } - return CInterpolationResult(); + return {}; } const CAircraftSituation & diff --git a/src/misc/simulation/matchingscript.cpp b/src/misc/simulation/matchingscript.cpp index 55fe02f20a..6c42728ceb 100644 --- a/src/misc/simulation/matchingscript.cpp +++ b/src/misc/simulation/matchingscript.cpp @@ -227,9 +227,9 @@ namespace swift::misc::simulation QString MSModelSet::findCombinedTypeWithClosestColorLivery(const QString &combinedType, const QString &rgbColor) const { - if (combinedType.isEmpty() || rgbColor.isEmpty()) { return QString(); } + if (combinedType.isEmpty() || rgbColor.isEmpty()) { return {}; } CAircraftModelList models = m_modelSet.findByCombinedTypeWithColorLivery(combinedType); - if (models.isEmpty()) { return QString(); } + if (models.isEmpty()) { return {}; } const CRgbColor color(rgbColor); models = models.findClosestFuselageColorDistance(color); return models.isEmpty() ? QString() : models.front().getModelString(); @@ -242,16 +242,16 @@ namespace swift::misc::simulation if (!ms.isEmpty()) { return ms; } if (combinedType.size() != 3) { return ms; } QString wildCard(combinedType); - if (wildCard.size() != 3) { return QString(); } + if (wildCard.size() != 3) { return {}; } wildCard[1] = '*'; return this->findCombinedTypeWithClosestColorLivery(wildCard, rgbColor); } QString MSModelSet::findAircraftFamilyWithClosestColorLivery(const QString &family, const QString &rgbColor) const { - if (family.isEmpty() || rgbColor.isEmpty()) { return QString(); } + if (family.isEmpty() || rgbColor.isEmpty()) { return {}; } CAircraftModelList models = m_modelSet.findByFamilyWithColorLivery(family); - if (models.isEmpty()) { return QString(); } + if (models.isEmpty()) { return {}; } const CRgbColor color(rgbColor); models = models.findClosestFuselageColorDistance(color); return models.isEmpty() ? QString() : models.front().getModelString(); diff --git a/src/misc/simulation/remoteaircraftprovider.cpp b/src/misc/simulation/remoteaircraftprovider.cpp index d68b79f0d7..b3caf8e00b 100644 --- a/src/misc/simulation/remoteaircraftprovider.cpp +++ b/src/misc/simulation/remoteaircraftprovider.cpp @@ -33,7 +33,7 @@ namespace swift::misc::simulation QReadLocker l(&m_lockAircraft); const QList aircraftInRange = m_aircraftInRange.values(); l.unlock(); - return CSimulatedAircraftList(aircraftInRange); + return { aircraftInRange }; } CCallsignSet CRemoteAircraftProvider::getAircraftInRangeCallsigns() const @@ -41,7 +41,7 @@ namespace swift::misc::simulation QReadLocker l(&m_lockAircraft); const QList callsigns = m_aircraftInRange.keys(); l.unlock(); - return CCallsignSet(callsigns); + return { callsigns }; } CSimulatedAircraft CRemoteAircraftProvider::getAircraftInRangeForCallsign(const CCallsign &callsign) const @@ -83,7 +83,7 @@ namespace swift::misc::simulation QReadLocker l(&m_lockSituations); const QList situations(m_latestSituationByCallsign.values()); l.unlock(); - return CAircraftSituationList(situations); + return { situations }; } CAircraftSituationList CRemoteAircraftProvider::latestOnGroundProviderElevations() const @@ -91,7 +91,7 @@ namespace swift::misc::simulation QReadLocker l(&m_lockSituations); const QList situations(m_latestOnGroundProviderElevation.values()); l.unlock(); - return CAircraftSituationList(situations); + return { situations }; } int CRemoteAircraftProvider::remoteAircraftSituationsCount(const CCallsign &callsign) const diff --git a/src/misc/simulation/remoteaircraftproviderdummy.cpp b/src/misc/simulation/remoteaircraftproviderdummy.cpp index a879356150..683e775067 100644 --- a/src/misc/simulation/remoteaircraftproviderdummy.cpp +++ b/src/misc/simulation/remoteaircraftproviderdummy.cpp @@ -45,8 +45,5 @@ namespace swift::misc::simulation } } - CAirspaceAircraftSnapshot CRemoteAircraftProviderDummy::getLatestAirspaceAircraftSnapshot() const - { - return CAirspaceAircraftSnapshot(); - } + CAirspaceAircraftSnapshot CRemoteAircraftProviderDummy::getLatestAirspaceAircraftSnapshot() const { return {}; } } // namespace swift::misc::simulation diff --git a/src/misc/simulation/settings/fgswiftbussettings.h b/src/misc/simulation/settings/fgswiftbussettings.h index e209f395aa..ef69b5f1d5 100644 --- a/src/misc/simulation/settings/fgswiftbussettings.h +++ b/src/misc/simulation/settings/fgswiftbussettings.h @@ -68,7 +68,7 @@ namespace swift::misc::simulation::settings } //! \copydoc swift::misc::TSettingTrait::defaultValue - static CFGSwiftBusSettings defaultValue() { return CFGSwiftBusSettings(); } + static CFGSwiftBusSettings defaultValue() { return {}; } //! \copydoc swift::misc::TSettingTrait::isValid static bool isValid(const CFGSwiftBusSettings &settings, QString &) diff --git a/src/misc/simulation/settings/simulatorsettings.cpp b/src/misc/simulation/settings/simulatorsettings.cpp index 613418e9a9..1f1c3e5531 100644 --- a/src/misc/simulation/settings/simulatorsettings.cpp +++ b/src/misc/simulation/settings/simulatorsettings.cpp @@ -186,7 +186,7 @@ namespace swift::misc::simulation::settings { // mostly happening with emulated driver, VERIFY for better debugging SWIFT_VERIFY_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "No single simulator"); - return CSimulatorSettings(); + return {}; } switch (simulator.getSimulator()) { @@ -200,12 +200,12 @@ namespace swift::misc::simulation::settings default: Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "No single simulator"); break; } - return CSimulatorSettings(); + return {}; } CSpecializedSimulatorSettings CMultiSimulatorSettings::getSpecializedSettings(const CSimulatorInfo &simulator) const { - return CSpecializedSimulatorSettings(this->getSettings(simulator), simulator); + return { this->getSettings(simulator), simulator }; } CStatusMessage CMultiSimulatorSettings::setSettings(const CSimulatorSettings &settings, @@ -570,7 +570,7 @@ namespace swift::misc::simulation::settings QStringList CSpecializedSimulatorSettings::getModelDirectoriesFromSimulatorDirectoy() const { - if (!m_genericSettings.hasSimulatorDirectory()) { return QStringList(); } + if (!m_genericSettings.hasSimulatorDirectory()) { return {}; } const QString s(m_genericSettings.getSimulatorDirectory()); QStringList dirs; switch (m_simulator.getSimulator()) diff --git a/src/misc/simulation/simulatedaircraft.cpp b/src/misc/simulation/simulatedaircraft.cpp index 53c5e52b25..4806ac86be 100644 --- a/src/misc/simulation/simulatedaircraft.cpp +++ b/src/misc/simulation/simulatedaircraft.cpp @@ -209,7 +209,7 @@ namespace swift::misc::simulation default: break; } SWIFT_VERIFY_X(false, Q_FUNC_INFO, "Wrong unit"); - return CComSystem(); // avoid warning + return {}; // avoid warning } void CSimulatedAircraft::setCockpit(const CSimulatedAircraft &aircraft) diff --git a/src/misc/simulation/simulationenvironmentprovider.cpp b/src/misc/simulation/simulationenvironmentprovider.cpp index a36ac0f373..b28f781d8c 100644 --- a/src/misc/simulation/simulationenvironmentprovider.cpp +++ b/src/misc/simulation/simulationenvironmentprovider.cpp @@ -345,7 +345,7 @@ namespace swift::misc::simulation if (found) { m_elvFound++; - return CElevationPlane(coordinate, reference); // plane with radius = distance to reference + return { coordinate, reference }; // plane with radius = distance to reference } else { @@ -379,7 +379,7 @@ namespace swift::misc::simulation QPair ISimulationEnvironmentProvider::getElevationsFoundMissed() const { QReadLocker l(&m_lockElvCoordinates); - return QPair(m_elvFound, m_elvMissed); + return { m_elvFound, m_elvMissed }; } QString ISimulationEnvironmentProvider::getElevationsFoundMissedInfo() const @@ -403,7 +403,7 @@ namespace swift::misc::simulation QPair ISimulationEnvironmentProvider::getElevationRequestTimes() const { QReadLocker l(&m_lockElvCoordinates); - return QPair(m_statsCurrentElevRequestTimeMs, m_statsMaxElevRequestTimeMs); + return { m_statsCurrentElevRequestTimeMs, m_statsMaxElevRequestTimeMs }; } QString ISimulationEnvironmentProvider::getElevationRequestTimesInfo() const @@ -787,37 +787,37 @@ namespace swift::misc::simulation QPair CSimulationEnvironmentAware::getElevationsFoundMissed() const { - if (!this->hasProvider()) { return QPair(0, 0); } + if (!this->hasProvider()) { return { 0, 0 }; } return this->provider()->getElevationsFoundMissed(); } QString CSimulationEnvironmentAware::getElevationsFoundMissedInfo() const { - if (!this->hasProvider()) { return QString(); } + if (!this->hasProvider()) { return {}; } return this->provider()->getElevationsFoundMissedInfo(); } QPair CSimulationEnvironmentAware::getElevationRequestTimes() const { - if (!this->hasProvider()) { return QPair(-1, -1); } + if (!this->hasProvider()) { return { -1, -1 }; } return this->provider()->getElevationRequestTimes(); } QString CSimulationEnvironmentAware::getElevationRequestTimesInfo() const { - if (!this->hasProvider()) { return QString(); } + if (!this->hasProvider()) { return {}; } return this->provider()->getElevationRequestTimesInfo(); } CSimulatorPluginInfo CSimulationEnvironmentAware::getSimulatorPluginInfo() const { - if (!this->hasProvider()) { return CSimulatorPluginInfo(); } + if (!this->hasProvider()) { return {}; } return this->provider()->getSimulatorPluginInfo(); } CSimulatorInfo CSimulationEnvironmentAware::getSimulatorInfo() const { - if (!this->hasProvider()) { return CSimulatorInfo(); } + if (!this->hasProvider()) { return {}; } return this->provider()->getSimulatorInfo(); } @@ -829,7 +829,7 @@ namespace swift::misc::simulation CAircraftModel CSimulationEnvironmentAware::getDefaultModel() const { - if (!this->hasProvider()) { return CAircraftModel(); } + if (!this->hasProvider()) { return {}; } return this->provider()->getDefaultModel(); } diff --git a/src/misc/simulation/simulatorinfo.cpp b/src/misc/simulation/simulatorinfo.cpp index de1bb720c8..ee44265d3c 100644 --- a/src/misc/simulation/simulatorinfo.cpp +++ b/src/misc/simulation/simulatorinfo.cpp @@ -416,14 +416,14 @@ namespace swift::misc::simulation { switch (internalIndex) { - case 0: return CSimulatorInfo(CSimulatorInfo::FSX); - case 1: return CSimulatorInfo(CSimulatorInfo::P3D); - case 2: return CSimulatorInfo(CSimulatorInfo::FS9); - case 3: return CSimulatorInfo(CSimulatorInfo::XPLANE); - case 4: return CSimulatorInfo(CSimulatorInfo::FG); - case 5: return CSimulatorInfo(CSimulatorInfo::MSFS); - case 6: return CSimulatorInfo(CSimulatorInfo::MSFS2024); - default: return CSimulatorInfo(CSimulatorInfo::None); + case 0: return { CSimulatorInfo::FSX }; + case 1: return { CSimulatorInfo::P3D }; + case 2: return { CSimulatorInfo::FS9 }; + case 3: return { CSimulatorInfo::XPLANE }; + case 4: return { CSimulatorInfo::FG }; + case 5: return { CSimulatorInfo::MSFS }; + case 6: return { CSimulatorInfo::MSFS2024 }; + default: return { CSimulatorInfo::None }; } } } // namespace swift::misc::simulation diff --git a/src/misc/simulation/simulatorinfolist.cpp b/src/misc/simulation/simulatorinfolist.cpp index 967db56e28..d89c3d2e97 100644 --- a/src/misc/simulation/simulatorinfolist.cpp +++ b/src/misc/simulation/simulatorinfolist.cpp @@ -15,7 +15,7 @@ namespace swift::misc::simulation CSimulatorInfoList CSimulatorInfoList::withNoDuplicates() const { - if (this->isEmpty()) { return CSimulatorInfoList(); } + if (this->isEmpty()) { return {}; } QList simIndexes; CSimulatorInfoList newList; for (const CSimulatorInfo &simulator : *this) @@ -30,7 +30,7 @@ namespace swift::misc::simulation CSimulatorInfoList CSimulatorInfoList::splitIntoSingleSimulators() const { - if (this->isEmpty()) { return CSimulatorInfoList(); } + if (this->isEmpty()) { return {}; } CSimulatorInfoList newList; for (const CSimulatorInfo &simulator : *this) { diff --git a/src/misc/simulation/simulatorplugininfolist.cpp b/src/misc/simulation/simulatorplugininfolist.cpp index 44e558c667..239697346b 100644 --- a/src/misc/simulation/simulatorplugininfolist.cpp +++ b/src/misc/simulation/simulatorplugininfolist.cpp @@ -35,6 +35,6 @@ namespace swift::misc::simulation { if (info.getSimulatorInfo() == simulator) { return info; } } - return CSimulatorPluginInfo(); + return {}; } } // namespace swift::misc::simulation diff --git a/src/misc/simulation/xplane/xplaneutil.cpp b/src/misc/simulation/xplane/xplaneutil.cpp index 25b9dda23a..07f2efc3cd 100644 --- a/src/misc/simulation/xplane/xplaneutil.cpp +++ b/src/misc/simulation/xplane/xplaneutil.cpp @@ -127,7 +127,7 @@ namespace swift::misc::simulation::xplane QStringList CXPlaneUtil::modelDirectoriesFromSimDir(const QString &simulatorDir) { - if (simulatorDir.isEmpty()) { return QStringList(); } + if (simulatorDir.isEmpty()) { return {}; } return QStringList({ simulatorDir }); } @@ -152,7 +152,7 @@ namespace swift::misc::simulation::xplane QStringList CXPlaneUtil::pluginSubdirectories(const QString &pluginDir) { const QString dirName = pluginDir.isEmpty() ? xplaneRootDir() : pluginDir; - if (!CDirectoryUtils::isDirExisting(dirName)) { return QStringList(); } + if (!CDirectoryUtils::isDirExisting(dirName)) { return {}; } const QDir dir(dirName); return dir.entryList(QDir::Dirs, QDir::Name | QDir::IgnoreCase); } @@ -227,7 +227,7 @@ namespace swift::misc::simulation::xplane { const QString dirName = CFileUtils::fixWindowsUncPath(pluginDir.isEmpty() ? xplaneRootDir() : pluginDir); const QDir directory(dirName); - if (!directory.exists()) { return QStringList(); } + if (!directory.exists()) { return {}; } // this finds the current levels XPLs QStringList files = directory.entryList(xplFileFilter(), QDir::Files, QDir::Name | QDir::IgnoreCase); diff --git a/src/misc/statusmessagelist.cpp b/src/misc/statusmessagelist.cpp index cff4638dbc..9ec5b78c49 100644 --- a/src/misc/statusmessagelist.cpp +++ b/src/misc/statusmessagelist.cpp @@ -177,7 +177,7 @@ namespace swift::misc CStatusMessage CStatusMessageList::toSingleMessage() const { - if (this->isEmpty()) { return CStatusMessage(); } + if (this->isEmpty()) { return {}; } if (this->size() == 1) { return this->front(); } QStringList newMsgs; CStatusMessage::StatusSeverity s = CStatusMessage::SeverityDebug; diff --git a/src/misc/swiftdirectories.cpp b/src/misc/swiftdirectories.cpp index 6b3d1bec88..b185bc0818 100644 --- a/src/misc/swiftdirectories.cpp +++ b/src/misc/swiftdirectories.cpp @@ -112,7 +112,7 @@ namespace swift::misc QFileInfoList CSwiftDirectories::currentApplicationDataDirectories() { const QDir swiftAppData(applicationDataDirectory()); // contains 1..n subdirs - if (!swiftAppData.isReadable()) { return QFileInfoList(); } + if (!swiftAppData.isReadable()) { return {}; } return swiftAppData.entryInfoList({}, QDir::Dirs | QDir::NoDotAndDotDot, QDir::Time); } diff --git a/src/misc/timestampbased.cpp b/src/misc/timestampbased.cpp index 90696954c0..9ad076d9d5 100644 --- a/src/misc/timestampbased.cpp +++ b/src/misc/timestampbased.cpp @@ -20,7 +20,7 @@ namespace swift::misc QDateTime ITimestampBased::getUtcTimestamp() const { - if (m_timestampMSecsSinceEpoch < 0) { return QDateTime(); } + if (m_timestampMSecsSinceEpoch < 0) { return {}; } return QDateTime::fromMSecsSinceEpoch(m_timestampMSecsSinceEpoch); } @@ -289,7 +289,7 @@ namespace swift::misc } const QString m = QStringLiteral("Cannot handle index %1").arg(index.toQString()); SWIFT_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable(m)); - return QVariant(); + return {}; } void ITimestampWithOffsetBased::setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant) diff --git a/src/misc/timestampobjectlist.h b/src/misc/timestampobjectlist.h index 014d33c4e3..fcd6f589e0 100644 --- a/src/misc/timestampobjectlist.h +++ b/src/misc/timestampobjectlist.h @@ -173,7 +173,7 @@ namespace swift::misc //! Oldest timestamp QDateTime oldestTimestamp() const { - if (this->container().isEmpty()) { return QDateTime(); } + if (this->container().isEmpty()) { return {}; } return this->oldestObject().getUtcTimestamp(); } @@ -674,14 +674,14 @@ namespace swift::misc //! Latest adjusted timestamp QDateTime latestAdjustedTimestamp() const { - if (this->container().isEmpty()) { return QDateTime(); } + if (this->container().isEmpty()) { return {}; } return this->latestAdjustedObject().getUtcTimestamp(); } //! Oldest adjusted timestamp QDateTime oldestAdjustedTimestamp() const { - if (this->container().isEmpty()) { return QDateTime(); } + if (this->container().isEmpty()) { return {}; } return this->oldestAdjustedObject().getUtcTimestamp(); } diff --git a/src/misc/valuecache.cpp b/src/misc/valuecache.cpp index 463a90b128..744ec116c9 100644 --- a/src/misc/valuecache.cpp +++ b/src/misc/valuecache.cpp @@ -680,7 +680,7 @@ namespace swift::misc { Q_ASSERT_X(!element.m_key.isEmpty(), Q_FUNC_INFO, "Empty key suggests an attempt to use value before objectName available for %%OwnerName%%"); - return element.m_value.read(); + return element.m_value.read(); // NOLINT(modernize-return-braced-init-list) } CStatusMessage CValuePage::setValue(Element &element, CVariant value, qint64 timestamp, bool save) diff --git a/src/misc/variant.cpp b/src/misc/variant.cpp index fdf6bb3c99..4b32e2964a 100644 --- a/src/misc/variant.cpp +++ b/src/misc/variant.cpp @@ -597,7 +597,7 @@ namespace swift::misc qFatal("Type cannot be resolved: %s (%d)", name ? name : "", type); } } - return QVariant(); // suppress compiler warning + return {}; // suppress compiler warning } } // namespace swift::misc diff --git a/src/plugins/simulator/emulated/simulatoremulated.cpp b/src/plugins/simulator/emulated/simulatoremulated.cpp index 3cba6e6fce..b7aeedef1a 100644 --- a/src/plugins/simulator/emulated/simulatoremulated.cpp +++ b/src/plugins/simulator/emulated/simulatoremulated.cpp @@ -181,7 +181,7 @@ namespace swift::simplugin::emulated CStatusMessageList CSimulatorEmulated::getInterpolationMessages(const CCallsign &callsign) const { if (canLog()) { m_monitorWidget->appendReceivingCall(Q_FUNC_INFO); } - if (!m_interpolators.contains(callsign)) { return CStatusMessageList(); } + if (!m_interpolators.contains(callsign)) { return {}; } const CInterpolationAndRenderingSetupPerCallsign setup = this->getInterpolationSetupPerCallsignOrDefault(callsign); // threadsafe copy return m_interpolators[callsign]->getInterpolationMessages(setup.getInterpolatorMode()); diff --git a/src/plugins/simulator/flightgear/flightgearmpaircraft.cpp b/src/plugins/simulator/flightgear/flightgearmpaircraft.cpp index 02ec254d99..c80f41882e 100644 --- a/src/plugins/simulator/flightgear/flightgearmpaircraft.cpp +++ b/src/plugins/simulator/flightgear/flightgearmpaircraft.cpp @@ -55,7 +55,7 @@ namespace swift::simplugin::flightgear return this->getInterpolator() ? this->getInterpolator()->getInterpolationMessages(mode) : CStatusMessageList(); } - CCallsignSet CFlightgearMPAircraftObjects::getAllCallsigns() const { return CCallsignSet(this->keys()); } + CCallsignSet CFlightgearMPAircraftObjects::getAllCallsigns() const { return { this->keys() }; } QStringList CFlightgearMPAircraftObjects::getAllCallsignStrings(bool sorted) const { diff --git a/src/plugins/simulator/flightgear/simulatorflightgear.cpp b/src/plugins/simulator/flightgear/simulatorflightgear.cpp index f51d10b0a4..fc57031a64 100644 --- a/src/plugins/simulator/flightgear/simulatorflightgear.cpp +++ b/src/plugins/simulator/flightgear/simulatorflightgear.cpp @@ -131,7 +131,7 @@ namespace swift::simplugin::flightgear CStatusMessageList CSimulatorFlightgear::getInterpolationMessages(const CCallsign &callsign) const { - if (callsign.isEmpty() || !m_flightgearAircraftObjects.contains(callsign)) { return CStatusMessageList(); } + if (callsign.isEmpty() || !m_flightgearAircraftObjects.contains(callsign)) { return {}; } const CInterpolationAndRenderingSetupPerCallsign setup = this->getInterpolationSetupConsolidated(callsign, false); return m_flightgearAircraftObjects[callsign].getInterpolationMessages(setup.getInterpolatorMode()); @@ -975,7 +975,7 @@ namespace swift::simplugin::flightgear if (m_addingInProgressAircraft.isEmpty()) { return empty; } const QList ts = m_addingInProgressAircraft.values(); const auto mm = std::minmax_element(ts.constBegin(), ts.constEnd()); - return QPair(*mm.first, *mm.second); + return { *mm.first, *mm.second }; } bool CSimulatorFlightgear::canAddAircraft() const diff --git a/src/plugins/simulator/xplane/simulatorxplane.cpp b/src/plugins/simulator/xplane/simulatorxplane.cpp index e0a5016328..afc6be625a 100644 --- a/src/plugins/simulator/xplane/simulatorxplane.cpp +++ b/src/plugins/simulator/xplane/simulatorxplane.cpp @@ -137,7 +137,7 @@ namespace swift::simplugin::xplane CStatusMessageList CSimulatorXPlane::getInterpolationMessages(const CCallsign &callsign) const { - if (callsign.isEmpty() || !m_xplaneAircraftObjects.contains(callsign)) { return CStatusMessageList(); } + if (callsign.isEmpty() || !m_xplaneAircraftObjects.contains(callsign)) { return {}; } const CInterpolationAndRenderingSetupPerCallsign setup = this->getInterpolationSetupConsolidated(callsign, false); return m_xplaneAircraftObjects[callsign].getInterpolationMessages(setup.getInterpolatorMode()); @@ -1085,7 +1085,7 @@ namespace swift::simplugin::xplane // so not to override it with some DB value in X mode, we set it to "0" if (model.getDistributor().matchesKeyOrAlias(CDistributor::xplaneXcsl()) && cg.isNull()) { - return CLength(0.0, CLengthUnit::ft()); + return { 0.0, CLengthUnit::ft() }; } return cg; } @@ -1293,7 +1293,7 @@ namespace swift::simplugin::xplane if (m_addingInProgressAircraft.isEmpty()) { return empty; } const QList ts = m_addingInProgressAircraft.values(); const auto mm = std::minmax_element(ts.constBegin(), ts.constEnd()); - return QPair(*mm.first, *mm.second); + return { *mm.first, *mm.second }; } bool CSimulatorXPlane::canAddAircraft() const diff --git a/src/plugins/simulator/xplane/xplanempaircraft.cpp b/src/plugins/simulator/xplane/xplanempaircraft.cpp index dd3381a523..315c4e7391 100644 --- a/src/plugins/simulator/xplane/xplanempaircraft.cpp +++ b/src/plugins/simulator/xplane/xplanempaircraft.cpp @@ -54,7 +54,7 @@ namespace swift::simplugin::xplane return this->getInterpolator() ? this->getInterpolator()->getInterpolationMessages(mode) : CStatusMessageList(); } - CCallsignSet CXPlaneMPAircraftObjects::getAllCallsigns() const { return CCallsignSet(this->keys()); } + CCallsignSet CXPlaneMPAircraftObjects::getAllCallsigns() const { return { this->keys() }; } QStringList CXPlaneMPAircraftObjects::getAllCallsignStrings(bool sorted) const { diff --git a/src/swiftguistandard/swiftguistdapplication.cpp b/src/swiftguistandard/swiftguistdapplication.cpp index c44ac90355..f58a66fa9b 100644 --- a/src/swiftguistandard/swiftguistdapplication.cpp +++ b/src/swiftguistandard/swiftguistdapplication.cpp @@ -40,7 +40,7 @@ CStatusMessageList CSwiftGuiStdApplication::startHookIn() const CStatusMessage m = CStatusMessage(this, CLogCategories::validation()).error(u"Inconsistent pair DBus: '%1' and core: '%2'") << dBusAddress << coreModeStr; - return CStatusMessageList(m); + return { m }; } } From 4e6a6887f1a910a9fd3f96fa6bd2a415f8a4912f Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Sat, 11 Oct 2025 20:27:46 +0200 Subject: [PATCH 10/21] refactor: Fix clang-tidy modernize-loop-convert --- .clang-tidy | 1 + src/core/afv/audio/soundcardsampleprovider.cpp | 3 +-- src/core/afv/model/afvmapreader.cpp | 10 +++++----- src/misc/aviation/aircraftenginelist.cpp | 4 ++-- src/misc/containerbase.h | 3 +-- src/misc/datacache.cpp | 4 ++-- src/misc/json.cpp | 6 +++--- src/misc/simulation/aircraftmodellist.cpp | 6 +++--- .../interpolation/interpolatorspline.cpp | 14 ++++---------- src/misc/stringutils.cpp | 3 +-- .../sampleprovider/equalizersampleprovider.cpp | 2 +- src/sound/sampleprovider/mixingsampleprovider.cpp | 3 +-- 12 files changed, 25 insertions(+), 34 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index c924a8f3e5..13b8a5bda5 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -6,6 +6,7 @@ Checks: > modernize-use-auto, modernize-use-override, modernize-return-braced-init-list, + modernize-loop-convert, CheckOptions: diff --git a/src/core/afv/audio/soundcardsampleprovider.cpp b/src/core/afv/audio/soundcardsampleprovider.cpp index e498f31dc4..686944f685 100644 --- a/src/core/afv/audio/soundcardsampleprovider.cpp +++ b/src/core/afv/audio/soundcardsampleprovider.cpp @@ -106,9 +106,8 @@ namespace swift::core::afv::audio { bool audioPlayed = false; QVector handledTransceiverIDs; - for (int i = 0; i < rxTransceiversFilteredAndSorted.size(); i++) + for (const auto rxTransceiver : rxTransceiversFilteredAndSorted) { - const RxTransceiverDto rxTransceiver = rxTransceiversFilteredAndSorted[i]; if (!handledTransceiverIDs.contains(rxTransceiver.id)) { handledTransceiverIDs.push_back(rxTransceiver.id); diff --git a/src/core/afv/model/afvmapreader.cpp b/src/core/afv/model/afvmapreader.cpp index 7c4bd1684c..f253d44af8 100644 --- a/src/core/afv/model/afvmapreader.cpp +++ b/src/core/afv/model/afvmapreader.cpp @@ -48,11 +48,11 @@ namespace swift::core::afv::model QVector transceivers; QString callsign; - for (auto it = rootArray.begin(); it != rootArray.end(); ++it) + for (auto it : rootArray) { - if (it->isObject()) + if (it.isObject()) { - const QJsonObject stationObject = it->toObject(); + const QJsonObject stationObject = it.toObject(); if (stationObject.contains("callsign")) { callsign = stationObject.value("callsign").toString(); } @@ -61,9 +61,9 @@ namespace swift::core::afv::model if (stationObject.contains("transceivers")) { QJsonArray txArray = stationObject.value("transceivers").toArray(); - for (auto jt = txArray.begin(); jt != txArray.end(); ++jt) + for (auto &&jt : txArray) { - const TransceiverDto transceiver = TransceiverDto::fromJson(jt->toObject()); + const TransceiverDto transceiver = TransceiverDto::fromJson(jt.toObject()); transceivers.push_back({ callsign, transceiver }); } } diff --git a/src/misc/aviation/aircraftenginelist.cpp b/src/misc/aviation/aircraftenginelist.cpp index 3bff27ae36..05267fb134 100644 --- a/src/misc/aviation/aircraftenginelist.cpp +++ b/src/misc/aviation/aircraftenginelist.cpp @@ -13,9 +13,9 @@ namespace swift::misc::aviation CAircraftEngineList::CAircraftEngineList(std::initializer_list enginesOnOff) { int no = 1; // engines 1 based - for (auto it = enginesOnOff.begin(); it != enginesOnOff.end(); ++it) + for (bool it : enginesOnOff) { - CAircraftEngine engine(no++, *it); + CAircraftEngine engine(no++, it); this->push_back(engine); } } diff --git a/src/misc/containerbase.h b/src/misc/containerbase.h index a29f612fde..574be11341 100644 --- a/src/misc/containerbase.h +++ b/src/misc/containerbase.h @@ -136,11 +136,10 @@ namespace swift::misc if (value.isUndefined()) { throw CJsonException("Missing 'containerbase'"); } QJsonArray array = value.toArray(); int index = 0; - for (auto i = array.begin(); i != array.end(); ++i) + for (auto ref : array) { CJsonScope scope("containerbase", index++); Q_UNUSED(scope); - QJsonValueRef ref = (*i); typename Derived::value_type val; ref >> val; derived().push_back(std::move(val)); diff --git a/src/misc/datacache.cpp b/src/misc/datacache.cpp index 0a934f1c16..6167ba02c0 100644 --- a/src/misc/datacache.cpp +++ b/src/misc/datacache.cpp @@ -763,14 +763,14 @@ namespace swift::misc QJsonArray CDataCacheRevision::toJson(const QSet &pins) { QJsonArray result; - for (auto it = pins.begin(); it != pins.end(); ++it) { result.push_back(*it); } + for (const auto &pin : pins) { result.push_back(pin); } return result; } QSet CDataCacheRevision::fromJson(const QJsonArray &pins) { QSet result; - for (auto it = pins.begin(); it != pins.end(); ++it) { result.insert(it->toString()); } + for (auto pin : pins) { result.insert(pin.toString()); } return result; } diff --git a/src/misc/json.cpp b/src/misc/json.cpp index 023c23217b..d55312fa00 100644 --- a/src/misc/json.cpp +++ b/src/misc/json.cpp @@ -639,10 +639,10 @@ namespace swift::misc::json { QStringList sl; if (array.isEmpty()) { return sl; } - for (int i = 0; i < array.size(); i++) + for (const auto &i : array) { - if (!array.at(i).isString()) { continue; } - sl.push_back(array.at(i).toString()); + if (!i.isString()) { continue; } + sl.push_back(i.toString()); } return sl; } diff --git a/src/misc/simulation/aircraftmodellist.cpp b/src/misc/simulation/aircraftmodellist.cpp index 93d0cc4af2..f6c766f5da 100644 --- a/src/misc/simulation/aircraftmodellist.cpp +++ b/src/misc/simulation/aircraftmodellist.cpp @@ -1507,7 +1507,7 @@ namespace swift::misc::simulation { CAircraftModel::MemoHelper::CMemoizer helper; QJsonArray array; - for (auto it = cbegin(); it != cend(); ++it) { array << it->toMemoizedJson(helper); } + for (const auto &it : *this) { array << it.toMemoizedJson(helper); } QJsonObject json; json.insert("containerbase", array); json.insert("aircraftIcaos", helper.getTable().toJson()); @@ -1563,12 +1563,12 @@ namespace swift::misc::simulation } int index = 0; - for (auto i = array.begin(); i != array.end(); ++i) + for (auto &&i : array) { CJsonScope scope("containerbase", index++); Q_UNUSED(scope) CAircraftModel value; - value.convertFromMemoizedJson(i->toObject(), helper); + value.convertFromMemoizedJson(i.toObject(), helper); this->push_back(value); } } diff --git a/src/misc/simulation/interpolation/interpolatorspline.cpp b/src/misc/simulation/interpolation/interpolatorspline.cpp index 5bd7911f7d..c7688158d0 100644 --- a/src/misc/simulation/interpolation/interpolatorspline.cpp +++ b/src/misc/simulation/interpolation/interpolatorspline.cpp @@ -295,20 +295,14 @@ namespace swift::misc::simulation bool CInterpolatorSpline::areAnyElevationsMissing() const { - for (unsigned int i = 0; i < m_s.size(); i++) - { - if (!m_s[i].hasGroundElevation()) { return true; } - } - return false; + return std::any_of(m_s.begin(), m_s.end(), + [](const auto &situation) { return !situation.hasGroundElevation(); }); } bool CInterpolatorSpline::isAnySituationNearGroundRelevant() const { - for (unsigned int i = 0; i < m_s.size(); i++) - { - if (!m_s[i].canLikelySkipNearGroundInterpolation()) { return true; } - } - return false; + return std::any_of(m_s.begin(), m_s.end(), + [](const auto &situation) { return !situation.canLikelySkipNearGroundInterpolation(); }); } CInterpolatorSpline::CInterpolant::CInterpolant(const CInterpolatorSpline::PosArray &pa, diff --git a/src/misc/stringutils.cpp b/src/misc/stringutils.cpp index 13f7442ecd..120ff6b1bc 100644 --- a/src/misc/stringutils.cpp +++ b/src/misc/stringutils.cpp @@ -226,9 +226,8 @@ namespace swift::misc "i", "o", "n", "o", "o", "o", "o", "o", "o", "u", "u", "u", "u", "y", "y" }); QString output = ""; - for (int i = 0; i < candidate.length(); i++) + for (const QChar c : candidate) { - const QChar c = candidate[i]; const qsizetype dIndex = diacriticLetters.indexOf(c); if (dIndex < 0) { output.append(c); } else diff --git a/src/sound/sampleprovider/equalizersampleprovider.cpp b/src/sound/sampleprovider/equalizersampleprovider.cpp index f2e7d5f1ad..8477e783c0 100644 --- a/src/sound/sampleprovider/equalizersampleprovider.cpp +++ b/src/sound/sampleprovider/equalizersampleprovider.cpp @@ -31,7 +31,7 @@ namespace swift::sound::sample_provider for (int n = 0; n < samplesRead; n++) { - for (int band = 0; band < m_filters.size(); band++) { samples[n] = m_filters[band].transform(samples[n]); } + for (auto &filter : m_filters) { samples[n] = filter.transform(samples[n]); } samples[n] *= static_cast(m_outputGain); } return samplesRead; diff --git a/src/sound/sampleprovider/mixingsampleprovider.cpp b/src/sound/sampleprovider/mixingsampleprovider.cpp index ffea1e91f3..718e35ea36 100644 --- a/src/sound/sampleprovider/mixingsampleprovider.cpp +++ b/src/sound/sampleprovider/mixingsampleprovider.cpp @@ -31,9 +31,8 @@ namespace swift::sound::sample_provider int outputLen = 0; QVector finishedProviders; - for (int i = 0; i < m_sources.size(); i++) + for (auto sampleProvider : m_sources) { - ISampleProvider *sampleProvider = m_sources.at(i); QVector sourceBuffer; const int len = sampleProvider->readSamples(sourceBuffer, count); From 369450107bbdb6123d8d88cb367870035a939fb2 Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Sat, 25 Oct 2025 15:48:35 +0200 Subject: [PATCH 11/21] refactor: Fix remaining modernize- warnings --- .clang-tidy | 39 +- scripts/run_static_analysis.py | 2 +- src/core/context/contextnetworkimpl.cpp | 2 - src/core/context/contextsimulatorproxy.cpp | 2 +- src/core/inputmanager.cpp | 2 +- src/core/inputmanager.h | 2 + src/core/simulator.h | 2 +- src/gui/components/atcbuttoncomponent.cpp | 2 +- .../components/rawfsdmessagescomponent.cpp | 2 +- .../components/settingstextmessagestyle.cpp | 4 +- src/gui/guiutility.h | 2 +- src/gui/models/textmessagelistmodel.cpp | 2 +- src/gui/models/userlistmodel.cpp | 3 +- src/misc/aviation/altitude.cpp | 2 +- src/misc/aviation/callsignobjectlist.h | 2 +- .../aviation/registermetadataaviation.cpp | 94 ++-- src/misc/cputime.cpp | 2 +- src/misc/db/datastore.h | 4 +- src/misc/dictionary.h | 14 +- src/misc/geo/coordinategeodetic.h | 2 +- src/misc/geo/earthangle.cpp | 2 +- src/misc/geo/geoobjectlist.h | 4 +- src/misc/identifiable.h | 2 +- src/misc/invoke.h | 2 + src/misc/iterator.h | 4 +- src/misc/mixin/mixinmetatype.h | 181 ++++---- src/misc/network/clientprovider.cpp | 2 +- src/misc/network/clientprovider.h | 2 +- src/misc/network/networkutils.h | 2 +- src/misc/network/registermetadatanetwork.cpp | 68 ++- src/misc/optional.h | 4 +- src/misc/pq/measurementunit.h | 6 +- src/misc/pq/pqstring.cpp | 2 +- src/misc/propertyindexref.cpp | 2 +- src/misc/provider.h | 2 +- src/misc/range.h | 22 +- src/misc/sequence.h | 24 +- .../simulation/flightgear/flightgearutil.cpp | 2 +- src/misc/simulation/remoteaircraftprovider.h | 2 +- .../settings/xswiftbussettingsqtfree.inc | 411 +++++++++--------- .../simulationenvironmentprovider.h | 2 +- .../xplane/aircraftmodelloaderxplane.cpp | 88 +++- .../flightgear/simulatorflightgear.cpp | 7 +- .../simulator/xplane/simulatorxplane.cpp | 8 +- src/swiftlauncher/swiftlauncher.cpp | 2 +- src/swiftlauncher/swiftlauncher.h | 2 +- 46 files changed, 559 insertions(+), 482 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 13b8a5bda5..07ffd5596b 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -3,10 +3,45 @@ Checks: > -*, + modernize-avoid-bind, + modernize-concat-nested-namespaces, + modernize-deprecated-headers, + modernize-deprecated-ios-base-aliases, + modernize-loop-convert, + modernize-macro-to-enum, + modernize-make-shared, + modernize-make-unique, + modernize-min-max-use-initializer-list, + modernize-raw-string-literal, + modernize-redundant-void-arg, + modernize-replace-auto-ptr, + modernize-replace-disallow-copy-and-assign-macro, + modernize-replace-random-shuffle, + modernize-return-braced-init-list, + modernize-shrink-to-fit, + modernize-type-traits, + modernize-unary-static-assert, modernize-use-auto, + modernize-use-bool-literals, + modernize-use-constraints, + modernize-use-default-member-init, + modernize-use-designated-initializers, + modernize-use-emplace, + modernize-use-equals-default, + modernize-use-equals-delete, + modernize-use-integer-sign-comparison, + modernize-use-noexcept, + modernize-use-nullptr, modernize-use-override, - modernize-return-braced-init-list, - modernize-loop-convert, + modernize-use-ranges, + modernize-use-scoped-lock, + modernize-use-starts-ends-with, + modernize-use-std-format, + modernize-use-std-numbers, + modernize-use-std-print, + modernize-use-transparent-functors, + modernize-use-uncaught-exceptions, + modernize-use-using, CheckOptions: diff --git a/scripts/run_static_analysis.py b/scripts/run_static_analysis.py index 76d11f73e6..6d91228445 100644 --- a/scripts/run_static_analysis.py +++ b/scripts/run_static_analysis.py @@ -113,7 +113,7 @@ def run_clazy(build_path: str, changed_source_files: set[str]): '-p', build_path, "-extra-arg", "-Werror", "-extra-arg", "-Wno-unnecessary-virtual-specifier", - '--header-filter', '(config|core|gui|input|misc|plugins|sound|swiftcore|swiftdata|swiftguistandard|swiftlauncher|xswiftbus)/', + '--header-filter', f'{utils.get_swift_source_path()}/src/', *changed_source_files ], text=True, check=True) except CalledProcessError: diff --git a/src/core/context/contextnetworkimpl.cpp b/src/core/context/contextnetworkimpl.cpp index 4fdd059c49..12b0b337ad 100644 --- a/src/core/context/contextnetworkimpl.cpp +++ b/src/core/context/contextnetworkimpl.cpp @@ -3,8 +3,6 @@ #include "core/context/contextnetworkimpl.h" -#include - #include #include diff --git a/src/core/context/contextsimulatorproxy.cpp b/src/core/context/contextsimulatorproxy.cpp index 8c69aa3b3f..3f9dd1f8f7 100644 --- a/src/core/context/contextsimulatorproxy.cpp +++ b/src/core/context/contextsimulatorproxy.cpp @@ -25,7 +25,7 @@ namespace swift::core::context { CContextSimulatorProxy::CContextSimulatorProxy(const QString &serviceName, QDBusConnection &connection, CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) - : IContextSimulator(mode, runtime), m_dBusInterface(nullptr) + : IContextSimulator(mode, runtime) { this->m_dBusInterface = new swift::misc::CGenericDBusInterface( serviceName, IContextSimulator::ObjectPath(), IContextSimulator::InterfaceName(), connection, this); diff --git a/src/core/inputmanager.cpp b/src/core/inputmanager.cpp index f8fed0a3b0..a3092af02a 100644 --- a/src/core/inputmanager.cpp +++ b/src/core/inputmanager.cpp @@ -3,7 +3,7 @@ #include "core/inputmanager.h" -#include +#include #include diff --git a/src/core/inputmanager.h b/src/core/inputmanager.h index 39f6391a36..25456c2487 100644 --- a/src/core/inputmanager.h +++ b/src/core/inputmanager.h @@ -48,9 +48,11 @@ namespace swift::core template int bind(const QString &action, RecvObj *receiver, void (RecvObj::*slotPointer)(bool)) { + // NOLINTBEGIN(modernize-avoid-bind) using namespace std::placeholders; auto function = std::bind(slotPointer, receiver, _1); return bindImpl(action, receiver, function); + // NOLINTEND(modernize-avoid-bind) } //! Register a new hotkey function diff --git a/src/core/simulator.h b/src/core/simulator.h index 20d48f90ee..5d6ab99fd3 100644 --- a/src/core/simulator.h +++ b/src/core/simulator.h @@ -715,7 +715,7 @@ namespace swift::core protected: //! Default ctor - ISimulatorFactory() {} + ISimulatorFactory() {} // NOLINT(modernize-use-equals-default) }; } // namespace swift::core diff --git a/src/gui/components/atcbuttoncomponent.cpp b/src/gui/components/atcbuttoncomponent.cpp index b737b09c40..8ca9f23899 100644 --- a/src/gui/components/atcbuttoncomponent.cpp +++ b/src/gui/components/atcbuttoncomponent.cpp @@ -3,7 +3,7 @@ #include "atcbuttoncomponent.h" -#include +#include #include #include diff --git a/src/gui/components/rawfsdmessagescomponent.cpp b/src/gui/components/rawfsdmessagescomponent.cpp index 96a668ea8d..81fdbe9d46 100644 --- a/src/gui/components/rawfsdmessagescomponent.cpp +++ b/src/gui/components/rawfsdmessagescomponent.cpp @@ -66,7 +66,7 @@ namespace swift::gui::components using namespace std::placeholders; QMetaObject::Connection c = sGui->getIContextNetwork()->connectRawFsdMessageSignal( - this, std::bind(&CRawFsdMessagesComponent::addFsdMessage, this, _1)); + this, [this](auto &&msg) { addFsdMessage(std::forward(msg)); }); if (!c) { ui->pte_RawFsdMessages->appendPlainText(QStringLiteral("Could not connect to raw FSD message.")); diff --git a/src/gui/components/settingstextmessagestyle.cpp b/src/gui/components/settingstextmessagestyle.cpp index 615eb281ea..948fa593ea 100644 --- a/src/gui/components/settingstextmessagestyle.cpp +++ b/src/gui/components/settingstextmessagestyle.cpp @@ -94,7 +94,7 @@ namespace swift::gui::components void CSettingsTextMessageStyle::replaceTableStyle(const QString &newTableStyle) { QString style = m_style; - thread_local const QRegularExpression re("table\\s*\\{.*\\}"); + thread_local const QRegularExpression re(R"(table\s*\{.*\})"); style.replace(re, newTableStyle); m_style = style; } @@ -112,7 +112,7 @@ namespace swift::gui::components bool CSettingsTextMessageStyle::changeFontSize(bool increase) { QString style = m_style; - thread_local const QRegularExpression re("table\\s*\\{.*:\\s*(\\d{1,2}).*\\}"); + thread_local const QRegularExpression re(R"(table\s*\{.*:\s*(\d{1,2}).*\})"); const QRegularExpressionMatch match = re.match(style); const QStringList matches = match.capturedTexts(); if (matches.size() != 2) { return false; } diff --git a/src/gui/guiutility.h b/src/gui/guiutility.h index 5cb585dfe7..95166563a9 100644 --- a/src/gui/guiutility.h +++ b/src/gui/guiutility.h @@ -318,7 +318,7 @@ namespace swift::gui private: //! No constructor, use static functions only - CGuiUtility() {} + CGuiUtility() {} // NOLINT(modernize-use-equals-default) static QWidget *s_mainApplicationWidget; }; diff --git a/src/gui/models/textmessagelistmodel.cpp b/src/gui/models/textmessagelistmodel.cpp index 3c4f266612..a944386ab1 100644 --- a/src/gui/models/textmessagelistmodel.cpp +++ b/src/gui/models/textmessagelistmodel.cpp @@ -21,7 +21,7 @@ using namespace swift::misc::aviation; namespace swift::gui::models { CTextMessageListModel::CTextMessageListModel(TextMessageMode mode, QObject *parent) - : CListModelTimestampObjects("ModelTextMessageList", parent), m_textMessageMode(NotSet) + : CListModelTimestampObjects("ModelTextMessageList", parent) { this->setTextMessageMode(mode); diff --git a/src/gui/models/userlistmodel.cpp b/src/gui/models/userlistmodel.cpp index 6681d7e98e..c10892c2a2 100644 --- a/src/gui/models/userlistmodel.cpp +++ b/src/gui/models/userlistmodel.cpp @@ -17,8 +17,7 @@ using namespace swift::misc::aviation; namespace swift::gui::models { - CUserListModel::CUserListModel(UserMode userMode, QObject *parent) - : CListModelBase("ModelUserList", parent), m_userMode(NotSet) + CUserListModel::CUserListModel(UserMode userMode, QObject *parent) : CListModelBase("ModelUserList", parent) { this->setUserMode(userMode); diff --git a/src/misc/aviation/altitude.cpp b/src/misc/aviation/altitude.cpp index 6768ba7801..cfde64d8bb 100644 --- a/src/misc/aviation/altitude.cpp +++ b/src/misc/aviation/altitude.cpp @@ -374,7 +374,7 @@ namespace swift::misc::aviation const QRegularExpression &CAltitude::fpAltitudeRegExp() { thread_local const QRegularExpression re( - "([Ff][Ll]?\\d{2,3})|([Ss]\\d{2,4})|([Aa]\\d{2,3})|([Mm]\\d{2,4})|(\\d{3,5}(ft|m))"); + R"(([Ff][Ll]?\d{2,3})|([Ss]\d{2,4})|([Aa]\d{2,3})|([Mm]\d{2,4})|(\d{3,5}(ft|m)))"); return re; } diff --git a/src/misc/aviation/callsignobjectlist.h b/src/misc/aviation/callsignobjectlist.h index 4504e80f1a..01cafb1b09 100644 --- a/src/misc/aviation/callsignobjectlist.h +++ b/src/misc/aviation/callsignobjectlist.h @@ -258,7 +258,7 @@ namespace swift::misc::aviation protected: //! Constructor - ICallsignObjectList() {} + ICallsignObjectList() {} // NOLINT(modernize-use-equals-default) //! Container const CONTAINER &container() const { return static_cast(*this); } diff --git a/src/misc/aviation/registermetadataaviation.cpp b/src/misc/aviation/registermetadataaviation.cpp index 5a13fb423b..51b890ceec 100644 --- a/src/misc/aviation/registermetadataaviation.cpp +++ b/src/misc/aviation/registermetadataaviation.cpp @@ -41,54 +41,50 @@ #include "misc/aviation/track.h" #include "misc/aviation/transponder.h" -namespace swift::misc +namespace swift::misc::aviation { - namespace aviation + void registerMetadata() { - void registerMetadata() - { - CAircraftEngine::registerMetadata(); - CAircraftEngineList::registerMetadata(); - CAircraftIcaoCode::registerMetadata(); - CAircraftIcaoCodeList::registerMetadata(); - CAircraftCategory::registerMetadata(); - CAircraftCategoryList::registerMetadata(); - CAircraftLights::registerMetadata(); - CAircraftParts::registerMetadata(); - CAircraftPartsList::registerMetadata(); - CAircraftSituation::registerMetadata(); - CAircraftSituationChange::registerMetadata(); - CAircraftSituationList::registerMetadata(); - CAircraftVelocity::registerMetadata(); - CAirlineIcaoCode::registerMetadata(); - CAirlineIcaoCodeList::registerMetadata(); - CAirportIcaoCode::registerMetadata(); - CAirport::registerMetadata(); - CAirportList::registerMetadata(); - CAltitude::registerMetadata(); - CAtcStation::registerMetadata(); - CAtcStationList::registerMetadata(); - CCallsign::registerMetadata(); - CCallsignSet::registerMetadata(); - CComSystem::registerMetadata(); - CSsrEquipment::registerMetadata(); - CComNavEquipment::registerMetadata(); - CWakeTurbulenceCategory::registerMetadata(); - CFlightPlan::registerMetadata(); - CFlightPlanAircraftInfo::registerMetadata(); - CFlightPlanList::registerMetadata(); - CSimBriefData::registerMetadata(); - CFlightPlanRemarks::registerMetadata(); - CHeading::registerMetadata(); - CInformationMessage::registerMetadata(); - CLivery::registerMetadata(); - CLiveryList::registerMetadata(); - CNavSystem::registerMetadata(); - CSelcal::registerMetadata(); - CTrack::registerMetadata(); - CTransponder::registerMetadata(); - COnGroundInfo::registerMetadata(); - } - } // namespace aviation - -} // namespace swift::misc + CAircraftEngine::registerMetadata(); + CAircraftEngineList::registerMetadata(); + CAircraftIcaoCode::registerMetadata(); + CAircraftIcaoCodeList::registerMetadata(); + CAircraftCategory::registerMetadata(); + CAircraftCategoryList::registerMetadata(); + CAircraftLights::registerMetadata(); + CAircraftParts::registerMetadata(); + CAircraftPartsList::registerMetadata(); + CAircraftSituation::registerMetadata(); + CAircraftSituationChange::registerMetadata(); + CAircraftSituationList::registerMetadata(); + CAircraftVelocity::registerMetadata(); + CAirlineIcaoCode::registerMetadata(); + CAirlineIcaoCodeList::registerMetadata(); + CAirportIcaoCode::registerMetadata(); + CAirport::registerMetadata(); + CAirportList::registerMetadata(); + CAltitude::registerMetadata(); + CAtcStation::registerMetadata(); + CAtcStationList::registerMetadata(); + CCallsign::registerMetadata(); + CCallsignSet::registerMetadata(); + CComSystem::registerMetadata(); + CSsrEquipment::registerMetadata(); + CComNavEquipment::registerMetadata(); + CWakeTurbulenceCategory::registerMetadata(); + CFlightPlan::registerMetadata(); + CFlightPlanAircraftInfo::registerMetadata(); + CFlightPlanList::registerMetadata(); + CSimBriefData::registerMetadata(); + CFlightPlanRemarks::registerMetadata(); + CHeading::registerMetadata(); + CInformationMessage::registerMetadata(); + CLivery::registerMetadata(); + CLiveryList::registerMetadata(); + CNavSystem::registerMetadata(); + CSelcal::registerMetadata(); + CTrack::registerMetadata(); + CTransponder::registerMetadata(); + COnGroundInfo::registerMetadata(); + } +} // namespace swift::misc::aviation \ No newline at end of file diff --git a/src/misc/cputime.cpp b/src/misc/cputime.cpp index 560dfc6190..7f61796d80 100644 --- a/src/misc/cputime.cpp +++ b/src/misc/cputime.cpp @@ -8,7 +8,7 @@ #if defined(Q_OS_WIN32) # include #elif defined(Q_OS_UNIX) -# include +# include #endif namespace swift::misc diff --git a/src/misc/db/datastore.h b/src/misc/db/datastore.h index 1fd6c9b1cf..d9bad5eba4 100644 --- a/src/misc/db/datastore.h +++ b/src/misc/db/datastore.h @@ -132,7 +132,7 @@ namespace swift::misc protected: //! Constructor - IDatastoreObjectWithIntegerKey() {} + IDatastoreObjectWithIntegerKey() {} // NOLINT(modernize-use-equals-default) //! Constructor IDatastoreObjectWithIntegerKey(int key) : m_dbKey(key) {} @@ -224,7 +224,7 @@ namespace swift::misc protected: //! Constructor - IDatastoreObjectWithStringKey() {} + IDatastoreObjectWithStringKey() {} // NOLINT(modernize-use-equals-default) //! Constructor IDatastoreObjectWithStringKey(const QString &key) : m_dbKey(key) {} diff --git a/src/misc/dictionary.h b/src/misc/dictionary.h index 47a3d95732..5e22121e1b 100644 --- a/src/misc/dictionary.h +++ b/src/misc/dictionary.h @@ -92,25 +92,25 @@ namespace swift::misc using impl_type = Impl; //! STL compatibility - typedef Key key_type; + using key_type = Key; //! STL compatibility - typedef Value value_type; + using value_type = Value; //! STL compatibility - typedef Value &reference; + using reference = Value &; //! STL compatibility - typedef const Value &const_reference; + using const_reference = Value &; //! STL compatibility - typedef typename Impl::size_type size_type; + using size_type = typename Impl::size_type; //! STL compatibility - typedef typename Impl::iterator iterator; + using iterator = typename Impl::iterator; //! STL compatibility - typedef typename Impl::const_iterator const_iterator; + using const_iterator = typename Impl::const_iterator; //! Return a copy containing only those elements for which the dictionary keys return true for a given //! predicate. diff --git a/src/misc/geo/coordinategeodetic.h b/src/misc/geo/coordinategeodetic.h index 5014e78341..4af8e99b9b 100644 --- a/src/misc/geo/coordinategeodetic.h +++ b/src/misc/geo/coordinategeodetic.h @@ -25,7 +25,7 @@ SWIFT_DECLARE_VALUEOBJECT_MIXINS(swift::misc::geo, CCoordinateGeodetic) -namespace swift::misc +namespace swift::misc // NOLINT(modernize-concat-nested-namespaces) { namespace geo { diff --git a/src/misc/geo/earthangle.cpp b/src/misc/geo/earthangle.cpp index 18a4de5c32..3a2075029e 100644 --- a/src/misc/geo/earthangle.cpp +++ b/src/misc/geo/earthangle.cpp @@ -84,7 +84,7 @@ namespace swift::misc::geo } // http://www.regular-expressions.info/floatingpoint.html - thread_local const QRegularExpression rx("[+-]?\\d+(?:\\.\\d+)?"); + thread_local const QRegularExpression rx(R"([+-]?\d+(?:\.\d+)?)"); int deg = 0; int min = 0; double sec = 0.0; diff --git a/src/misc/geo/geoobjectlist.h b/src/misc/geo/geoobjectlist.h index 719a4430b2..0cf44ad228 100644 --- a/src/misc/geo/geoobjectlist.h +++ b/src/misc/geo/geoobjectlist.h @@ -230,7 +230,7 @@ namespace swift::misc::geo protected: //! Constructor - IGeoObjectList() {} + IGeoObjectList() {} // NOLINT(modernize-use-equals-default) //! Container const CONTAINER &container() const { return static_cast(*this); } @@ -296,7 +296,7 @@ namespace swift::misc::geo protected: //! Constructor - IGeoObjectWithRelativePositionList() {} + IGeoObjectWithRelativePositionList() {} // NOLINT(modernize-use-equals-default) }; } // namespace swift::misc::geo diff --git a/src/misc/identifiable.h b/src/misc/identifiable.h index a1d8df043b..baa672d8f3 100644 --- a/src/misc/identifiable.h +++ b/src/misc/identifiable.h @@ -40,7 +40,7 @@ namespace swift::misc CIdentifiable(QObject *nameProvider); //! Construct without a name - CIdentifiable() {} + CIdentifiable() {} // NOLINT(modernize-use-equals-default) //! Destructor ~CIdentifiable(); diff --git a/src/misc/invoke.h b/src/misc/invoke.h index 87b526e87d..ae9dcfbb4a 100644 --- a/src/misc/invoke.h +++ b/src/misc/invoke.h @@ -48,7 +48,9 @@ namespace swift::misc::private_ns auto invokeMethod(T *object, F &&func, Ts &&...args) { const auto invoker = [](auto &&...x) { return private_ns::invokeSlot(std::forward(x)...); }; + // NOLINTBEGIN(modernize-avoid-bind) auto method = std::bind(invoker, std::forward(func), object, std::forward(args)...); + // NOLINTEND(modernize-avoid-bind) CPromise promise; QMetaObject::invokeMethod( object, [promise, method = std::move(method)]() mutable { promise.setResultFrom(std::move(method)); }); diff --git a/src/misc/iterator.h b/src/misc/iterator.h index 28a7ffec7c..5066e58971 100644 --- a/src/misc/iterator.h +++ b/src/misc/iterator.h @@ -134,8 +134,8 @@ namespace swift::misc::Iterators }; //! The type returned by this iterator's arrow operator, which may be a pointer or a pointer-like wrapper object - using pointer = typename std::conditional, - std::remove_reference_t *, PointerWrapper>::type; + using pointer = std::conditional_t, + std::remove_reference_t *, PointerWrapper>; //! Constructor. TransformIterator(I iterator, F function) : m_iterator(iterator), m_function(function) {} diff --git a/src/misc/mixin/mixinmetatype.h b/src/misc/mixin/mixinmetatype.h index 413832eea7..883ff1198e 100644 --- a/src/misc/mixin/mixinmetatype.h +++ b/src/misc/mixin/mixinmetatype.h @@ -14,106 +14,103 @@ #include "misc/propertyindexref.h" #include "misc/variant.h" -namespace swift::misc +namespace swift::misc::mixin { - namespace mixin + /*! + * CRTP class template from which a derived class can inherit common methods dealing with the metatype of the + * class. + * + * \see SWIFT_MISC_DECLARE_USING_MIXIN_METATYPE + */ + template + class MetaType { - /*! - * CRTP class template from which a derived class can inherit common methods dealing with the metatype of the - * class. - * - * \see SWIFT_MISC_DECLARE_USING_MIXIN_METATYPE - */ - template - class MetaType - { - public: - //! Register metadata - static void registerMetadata(); - - //! Returns the Qt meta type ID of this object - //! \remark for CVariant this returns the id of CVariant, not of the encapsulated object. - //! valueVariant.userType()` returns metatype of the contained object - int getMetaTypeId() const; - - //! Class name - QString getClassName() const; - - //! Returns true if this object is an instance of the class with the given meta type ID, or one of its - //! subclasses. - bool isA(int metaTypeId) const; - - private: - const Derived *derived() const; - Derived *derived(); - - template - static bool baseIsA(const Base2 *base, int metaTypeId); - static bool baseIsA(const void *, int); - }; - - template - void MetaType::registerMetadata() - { - private_ns::MetaTypeHelper::maybeRegisterMetaType(); - } - - template - int MetaType::getMetaTypeId() const - { - return private_ns::MetaTypeHelper::maybeGetMetaTypeId(); - } - - template - QString MetaType::getClassName() const - { - return QMetaType(getMetaTypeId()).name(); - } - - template - bool MetaType::isA(int metaTypeId) const - { - if (metaTypeId == QMetaType::UnknownType) { return false; } - if (metaTypeId == getMetaTypeId()) { return true; } - return baseIsA(static_cast *>(derived()), metaTypeId); - } - - template - const Derived *MetaType::derived() const - { - return static_cast(this); - } - - template - Derived *MetaType::derived() - { - return static_cast(this); - } - - template + public: + //! Register metadata + static void registerMetadata(); + + //! Returns the Qt meta type ID of this object + //! \remark for CVariant this returns the id of CVariant, not of the encapsulated object. + //! valueVariant.userType()` returns metatype of the contained object + int getMetaTypeId() const; + + //! Class name + QString getClassName() const; + + //! Returns true if this object is an instance of the class with the given meta type ID, or one of its + //! subclasses. + bool isA(int metaTypeId) const; + + private: + const Derived *derived() const; + Derived *derived(); + template - bool MetaType::baseIsA(const Base2 *base, int metaTypeId) - { - return base->isA(metaTypeId); - } - - template - bool MetaType::baseIsA(const void *, int) - { - return false; - } - - /*! - * When a derived class and a base class both inherit from mixin::MetaType, - * the derived class uses this macro to disambiguate the inherited members. - */ + static bool baseIsA(const Base2 *base, int metaTypeId); + static bool baseIsA(const void *, int); + }; + + template + void MetaType::registerMetadata() + { + private_ns::MetaTypeHelper::maybeRegisterMetaType(); + } + + template + int MetaType::getMetaTypeId() const + { + return private_ns::MetaTypeHelper::maybeGetMetaTypeId(); + } + + template + QString MetaType::getClassName() const + { + return QMetaType(getMetaTypeId()).name(); + } + + template + bool MetaType::isA(int metaTypeId) const + { + if (metaTypeId == QMetaType::UnknownType) { return false; } + if (metaTypeId == getMetaTypeId()) { return true; } + return baseIsA(static_cast *>(derived()), metaTypeId); + } + + template + const Derived *MetaType::derived() const + { + return static_cast(this); + } + + template + Derived *MetaType::derived() + { + return static_cast(this); + } + + template + template + bool MetaType::baseIsA(const Base2 *base, int metaTypeId) + { + return base->isA(metaTypeId); + } + + template + bool MetaType::baseIsA(const void *, int) + { + return false; + } + + /*! + * When a derived class and a base class both inherit from mixin::MetaType, + * the derived class uses this macro to disambiguate the inherited members. + */ #define SWIFT_MISC_DECLARE_USING_MIXIN_METATYPE(DERIVED) \ using ::swift::misc::mixin::MetaType::registerMetadata; \ using ::swift::misc::mixin::MetaType::getMetaTypeId; \ using ::swift::misc::mixin::MetaType::getClassName; \ using ::swift::misc::mixin::MetaType::isA; - } // namespace mixin -} // namespace swift::misc +} // namespace swift::misc::mixin #endif // SWIFT_MISC_MIXIN_MIXINMETATYPE_H diff --git a/src/misc/network/clientprovider.cpp b/src/misc/network/clientprovider.cpp index 37d57a7837..84c7017e49 100644 --- a/src/misc/network/clientprovider.cpp +++ b/src/misc/network/clientprovider.cpp @@ -124,7 +124,7 @@ namespace swift::misc::network bool CClientProvider::setClientGndCapability(const CCallsign &callsign, bool supportGndFlag) { SWIFT_VERIFY_X(!callsign.isEmpty(), Q_FUNC_INFO, "Missing client callsign"); - if (callsign.isEmpty()) { return 0; } + if (callsign.isEmpty()) { return false; } CClient client = this->getClientOrDefaultForCallsign(callsign); diff --git a/src/misc/network/clientprovider.h b/src/misc/network/clientprovider.h index a4a0116423..674eb2c325 100644 --- a/src/misc/network/clientprovider.h +++ b/src/misc/network/clientprovider.h @@ -157,7 +157,7 @@ namespace swift::misc protected: //! Default constructor - CClientAware() {} + CClientAware() {} // NOLINT(modernize-use-equals-default) //! Constructor CClientAware(IClientProvider *clientProvider) : IProviderAware(clientProvider) {} diff --git a/src/misc/network/networkutils.h b/src/misc/network/networkutils.h index 3f154f49df..05acf3d5fe 100644 --- a/src/misc/network/networkutils.h +++ b/src/misc/network/networkutils.h @@ -138,7 +138,7 @@ namespace swift::misc::network private: //! Hidden constructor - CNetworkUtils() {} + CNetworkUtils() {} // NOLINT(modernize-use-equals-default) }; } // namespace swift::misc::network diff --git a/src/misc/network/registermetadatanetwork.cpp b/src/misc/network/registermetadatanetwork.cpp index 8c86bc72fc..42f79de1bd 100644 --- a/src/misc/network/registermetadatanetwork.cpp +++ b/src/misc/network/registermetadatanetwork.cpp @@ -31,41 +31,37 @@ #include "misc/network/userlist.h" #include "misc/network/voicecapabilities.h" -namespace swift::misc +namespace swift::misc::network { - namespace network + void registerMetadata() { - void registerMetadata() - { - CAuthenticatedUser::registerMetadata(); - CConnectionStatus::registerMetadata(); - CClient::registerMetadata(); - qDBusRegisterMetaType(); - qDBusRegisterMetaType(); - CClientList::registerMetadata(); - CEcosystem::registerMetadata(); - CEcosystemList::registerMetadata(); - CEntityFlags::registerMetadata(); - CFacilityType::registerMetadata(); - CFsdSetup::registerMetadata(); - CLoginMode::registerMetadata(); - CRawFsdMessage::registerMetadata(); - CRawFsdMessageList::registerMetadata(); - CRemoteFile::registerMetadata(); - CRemoteFileList::registerMetadata(); - CRole::registerMetadata(); - CRoleList::registerMetadata(); - CServer::registerMetadata(); - CServerList::registerMetadata(); - CTextMessage::registerMetadata(); - CTextMessageList::registerMetadata(); - CUrl::registerMetadata(); - CUrlLog::registerMetadata(); - CUrlLogList::registerMetadata(); - CUser::registerMetadata(); - CUserList::registerMetadata(); - CVoiceCapabilities::registerMetadata(); - } - } // namespace network - -} // namespace swift::misc + CAuthenticatedUser::registerMetadata(); + CConnectionStatus::registerMetadata(); + CClient::registerMetadata(); + qDBusRegisterMetaType(); + qDBusRegisterMetaType(); + CClientList::registerMetadata(); + CEcosystem::registerMetadata(); + CEcosystemList::registerMetadata(); + CEntityFlags::registerMetadata(); + CFacilityType::registerMetadata(); + CFsdSetup::registerMetadata(); + CLoginMode::registerMetadata(); + CRawFsdMessage::registerMetadata(); + CRawFsdMessageList::registerMetadata(); + CRemoteFile::registerMetadata(); + CRemoteFileList::registerMetadata(); + CRole::registerMetadata(); + CRoleList::registerMetadata(); + CServer::registerMetadata(); + CServerList::registerMetadata(); + CTextMessage::registerMetadata(); + CTextMessageList::registerMetadata(); + CUrl::registerMetadata(); + CUrlLog::registerMetadata(); + CUrlLogList::registerMetadata(); + CUser::registerMetadata(); + CUserList::registerMetadata(); + CVoiceCapabilities::registerMetadata(); + } +} // namespace swift::misc::network \ No newline at end of file diff --git a/src/misc/optional.h b/src/misc/optional.h index 3a3688980b..d24195286b 100644 --- a/src/misc/optional.h +++ b/src/misc/optional.h @@ -117,8 +117,8 @@ namespace swift::misc } union Data { - Data() {} - ~Data() {} + Data() {} // NOLINT(modernize-use-equals-default) + ~Data() {} // NOLINT(modernize-use-equals-default) char bytes[sizeof(T)]; T object; }; diff --git a/src/misc/pq/measurementunit.h b/src/misc/pq/measurementunit.h index 6ba219eeff..41b68070b9 100644 --- a/src/misc/pq/measurementunit.h +++ b/src/misc/pq/measurementunit.h @@ -242,9 +242,6 @@ namespace swift::misc::physical_quantities //! Constructor CMeasurementUnit(const Data &data) : m_data(&data) {} - //! Constructor saves the address of its argument, so forbid rvalues - CMeasurementUnit(const Data &&) = delete; - //! Destructor ~CMeasurementUnit() = default; @@ -258,6 +255,9 @@ namespace swift::misc::physical_quantities const Data *m_data = (static_cast(throw std::logic_error("Uninitialized pimpl")), nullptr); public: + //! Constructor saves the address of its argument, so forbid rvalues + CMeasurementUnit(const Data &&) = delete; + //! \copydoc swift::misc::mixin::String::toQString QString convertToQString(bool i18n = false) const { return this->getSymbol(i18n); } diff --git a/src/misc/pq/pqstring.cpp b/src/misc/pq/pqstring.cpp index f5293c59b1..1094ec6318 100644 --- a/src/misc/pq/pqstring.cpp +++ b/src/misc/pq/pqstring.cpp @@ -35,7 +35,7 @@ namespace swift::misc::physical_quantities // check if (vs.isEmpty()) { return v; } - thread_local const QRegularExpression regex("([-+]?[0-9]*[\\.,]?[0-9]+)\\s*(\\D*)$"); + thread_local const QRegularExpression regex(R"(([-+]?[0-9]*[\.,]?[0-9]+)\s*(\D*)$)"); const auto match = regex.match(value); if (!match.hasMatch()) { return v; } // not a valid number QString unit = match.captured(2).trimmed(); diff --git a/src/misc/propertyindexref.cpp b/src/misc/propertyindexref.cpp index 9f862290ce..f6487af97f 100644 --- a/src/misc/propertyindexref.cpp +++ b/src/misc/propertyindexref.cpp @@ -11,7 +11,7 @@ namespace swift::misc { - CPropertyIndexRef::CPropertyIndexRef(int index) : m_begin(nullptr), m_sizeOrIndex(index) {} + CPropertyIndexRef::CPropertyIndexRef(int index) : m_sizeOrIndex(index) {} CPropertyIndexRef::CPropertyIndexRef(const QVector &indexes) : m_begin(indexes.data()), m_sizeOrIndex(indexes.size()) diff --git a/src/misc/provider.h b/src/misc/provider.h index 3cf7a9e05b..d9b1fda6a9 100644 --- a/src/misc/provider.h +++ b/src/misc/provider.h @@ -32,7 +32,7 @@ namespace swift::misc protected: //! Constructor - IProvider() {} + IProvider() {} // NOLINT(modernize-use-equals-default) }; //! Base class of provider aware classes diff --git a/src/misc/range.h b/src/misc/range.h index ddf717a2a4..c063af1d71 100644 --- a/src/misc/range.h +++ b/src/misc/range.h @@ -191,16 +191,16 @@ namespace swift::misc public: //! @{ //! STL compatibility - typedef typename std::iterator_traits::value_type value_type; - typedef typename std::iterator_traits::reference reference; - typedef typename std::iterator_traits::difference_type difference_type; - typedef const value_type &const_reference; - typedef value_type key_type; - typedef difference_type size_type; - typedef I iterator; - typedef I const_iterator; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; + using value_type = typename std::iterator_traits::value_type; + using reference = typename std::iterator_traits::reference; + using difference_type = typename std::iterator_traits::difference_type; + using const_reference = const value_type &; + using key_type = value_type; + using size_type = difference_type; + using iterator = I; + using const_iterator = I; + using reverse_iterator = std::reverse_iterator; + using const_reverse_iterator = std::reverse_iterator; //! @} //! Constructor. @@ -225,7 +225,7 @@ namespace swift::misc //! Create a range from reverse iterators. CRange reverse() const { - static_assert(std::is_same_v, ""); + static_assert(std::is_same_v); return { rbegin(), rend() }; } diff --git a/src/misc/sequence.h b/src/misc/sequence.h index cffe1b2b63..de67ce400d 100644 --- a/src/misc/sequence.h +++ b/src/misc/sequence.h @@ -86,40 +86,40 @@ namespace swift::misc { public: //! STL compatibility - typedef T key_type; + using key_type = T; //! STL compatilibty - typedef T value_type; + using value_type = T; //! STL compatibility - typedef T &reference; + using reference = T &; //! STL compatibility - typedef const T &const_reference; + using const_reference = const T &; //! STL compatibility - typedef T *pointer; + using pointer = T *; //! STL compatibility - typedef const T *const_pointer; + using const_pointer = const T *; //! STL compatibility - typedef typename QVector::const_iterator const_iterator; + using const_iterator = typename QVector::const_iterator; //! STL compatibility - typedef typename QVector::iterator iterator; + using iterator = typename QVector::iterator; //! STL compatibility - typedef typename QVector::const_reverse_iterator const_reverse_iterator; + using const_reverse_iterator = typename QVector::const_reverse_iterator; //! STL compatibility - typedef typename QVector::reverse_iterator reverse_iterator; + using reverse_iterator = typename QVector::reverse_iterator; //! STL compatibility - typedef ptrdiff_t difference_type; + using difference_type = ptrdiff_t; //! STL compatibility - typedef int size_type; + using size_type = int; //! Default constructor. CSequence() = default; diff --git a/src/misc/simulation/flightgear/flightgearutil.cpp b/src/misc/simulation/flightgear/flightgearutil.cpp index c02d3b54a4..600d360bf9 100644 --- a/src/misc/simulation/flightgear/flightgearutil.cpp +++ b/src/misc/simulation/flightgear/flightgearutil.cpp @@ -28,7 +28,7 @@ namespace swift::misc::simulation::flightgear if (CBuildConfig::isRunningOnWindowsNtPlatform()) { QSettings flightgearRegistry( - "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\FlightGear_is1", + R"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FlightGear_is1)", QSettings::NativeFormat); flightgearRootDir = flightgearRegistry.value("InstallLocation").toString().trimmed(); } diff --git a/src/misc/simulation/remoteaircraftprovider.h b/src/misc/simulation/remoteaircraftprovider.h index a0b7cffdd4..1b86263e44 100644 --- a/src/misc/simulation/remoteaircraftprovider.h +++ b/src/misc/simulation/remoteaircraftprovider.h @@ -689,7 +689,7 @@ namespace swift::misc::simulation protected: //! Default constructor - CRemoteAircraftAware() {} + CRemoteAircraftAware() {} // NOLINT(modernize-use-equals-default) //! Constructor CRemoteAircraftAware(IRemoteAircraftProvider *remoteAircraftProvider) : IProviderAware(remoteAircraftProvider) diff --git a/src/misc/simulation/settings/xswiftbussettingsqtfree.inc b/src/misc/simulation/settings/xswiftbussettingsqtfree.inc index a130e51441..ceb39b5e9b 100644 --- a/src/misc/simulation/settings/xswiftbussettingsqtfree.inc +++ b/src/misc/simulation/settings/xswiftbussettingsqtfree.inc @@ -31,218 +31,209 @@ constexpr char swift::misc::simulation::settings::CXSwiftBusSettingsQtFree::Json constexpr char swift::misc::simulation::settings::CXSwiftBusSettingsQtFree::JsonLogRenderPhases[]; //! @endcond -namespace swift::misc +namespace swift::misc::simulation::settings { - namespace simulation + bool CXSwiftBusSettingsQtFree::parseXSwiftBusString(const std::string &json) { - namespace settings - { - bool CXSwiftBusSettingsQtFree::parseXSwiftBusString(const std::string &json) - { - if (json.empty()) { return false; } - - const nlohmann::basic_json parsed = nlohmann::json::parse(json, nullptr, false); - - if (parsed.is_discarded()) { return false; } - - int c = 0; - if (parsed.contains(CXSwiftBusSettingsQtFree::JsonDBusServerAddress) && - parsed[CXSwiftBusSettingsQtFree::JsonDBusServerAddress].is_string()) - { - m_dBusServerAddress = parsed[CXSwiftBusSettingsQtFree::JsonDBusServerAddress].get(); - c++; - } - if (parsed.contains(CXSwiftBusSettingsQtFree::JsonMessageBox) && - parsed[CXSwiftBusSettingsQtFree::JsonMessageBox].is_string()) - { - m_msgBox = parsed[CXSwiftBusSettingsQtFree::JsonMessageBox].get(); - c++; - } - if (parsed.contains(CXSwiftBusSettingsQtFree::JsonNightTextureMode) && - parsed[CXSwiftBusSettingsQtFree::JsonNightTextureMode].is_string()) - { - m_nightTextureMode = parsed[CXSwiftBusSettingsQtFree::JsonNightTextureMode].get(); - c++; - } - if (parsed.contains(CXSwiftBusSettingsQtFree::JsonDrawingLabels) && - parsed[CXSwiftBusSettingsQtFree::JsonDrawingLabels].is_boolean()) - { - m_drawingLabels = parsed[CXSwiftBusSettingsQtFree::JsonDrawingLabels].get(); - c++; - } - if (parsed.contains(CXSwiftBusSettingsQtFree::JsonLabelColor) && - parsed[CXSwiftBusSettingsQtFree::JsonLabelColor].is_number_integer()) - { - m_labelColor = parsed[CXSwiftBusSettingsQtFree::JsonLabelColor].get(); - c++; - } - if (parsed.contains(CXSwiftBusSettingsQtFree::JsonBundleTaxiLandingLights) && - parsed[CXSwiftBusSettingsQtFree::JsonBundleTaxiLandingLights].is_boolean()) - { - m_bundleTaxiLandingLights = - parsed[CXSwiftBusSettingsQtFree::JsonBundleTaxiLandingLights].get(); - c++; - } - if (parsed.contains(CXSwiftBusSettingsQtFree::JsonTcas) && - parsed[CXSwiftBusSettingsQtFree::JsonTcas].is_boolean()) - { - m_tcasEnabled = parsed[CXSwiftBusSettingsQtFree::JsonTcas].get(); - c++; - } - if (parsed.contains(CXSwiftBusSettingsQtFree::JsonTerrainProbe) && - parsed[CXSwiftBusSettingsQtFree::JsonTerrainProbe].is_boolean()) - { - m_terrainProbeEnabled = parsed[CXSwiftBusSettingsQtFree::JsonTerrainProbe].get(); - c++; - } - if (parsed.contains(CXSwiftBusSettingsQtFree::JsonLogRenderPhases) && - parsed[CXSwiftBusSettingsQtFree::JsonLogRenderPhases].is_boolean()) - { - m_logRenderPhases = parsed[CXSwiftBusSettingsQtFree::JsonLogRenderPhases].get(); - c++; - } - if (parsed.contains(CXSwiftBusSettingsQtFree::JsonMaxPlanes) && - parsed[CXSwiftBusSettingsQtFree::JsonMaxPlanes].is_number_integer()) - { - m_maxPlanes = parsed[CXSwiftBusSettingsQtFree::JsonMaxPlanes].get(); - c++; - } - if (parsed.contains(CXSwiftBusSettingsQtFree::JsonMaxDrawDistance) && - parsed[CXSwiftBusSettingsQtFree::JsonMaxDrawDistance].is_number_float()) - { - m_maxDrawDistanceNM = parsed[CXSwiftBusSettingsQtFree::JsonMaxDrawDistance].get(); - c++; - } - if (parsed.contains(CXSwiftBusSettingsQtFree::JsonFollowAircraftDistanceM) && - parsed[CXSwiftBusSettingsQtFree::JsonFollowAircraftDistanceM].is_number_integer()) - { - m_followAircraftDistanceM = - parsed[CXSwiftBusSettingsQtFree::JsonFollowAircraftDistanceM].get(); - c++; - } - if (parsed.contains(CXSwiftBusSettingsQtFree::JsonTimestamp) && - parsed[CXSwiftBusSettingsQtFree::JsonTimestamp].is_number_integer()) - { - m_msSinceEpochQtFree = parsed[CXSwiftBusSettingsQtFree::JsonTimestamp].get(); - c++; - } - this->objectUpdated(); // post processing - return c == 13; - } - - std::string CXSwiftBusSettingsQtFree::toXSwiftBusJsonString() const - { - nlohmann::json json; - - json[JsonDBusServerAddress] = m_dBusServerAddress; - json[JsonNightTextureMode] = m_nightTextureMode; - json[JsonMessageBox] = m_msgBox; - json[JsonMaxPlanes] = m_maxPlanes; - json[JsonMaxDrawDistance] = m_maxDrawDistanceNM; - json[JsonTimestamp] = m_msSinceEpochQtFree; - json[JsonDrawingLabels] = m_drawingLabels; - json[JsonLabelColor] = m_labelColor; - json[JsonBundleTaxiLandingLights] = m_bundleTaxiLandingLights; - json[JsonFollowAircraftDistanceM] = m_followAircraftDistanceM; - json[JsonLogRenderPhases] = m_logRenderPhases; - json[JsonTcas] = m_tcasEnabled; - json[JsonTerrainProbe] = m_terrainProbeEnabled; - - return json.dump(2); - } - - std::string CXSwiftBusSettingsQtFree::convertToString() const - { - return "DBusServer: " + m_dBusServerAddress + - ", drawLabels: " + qtfreeutils::boolToYesNo(m_drawingLabels) + - ", labelColor: " + std::to_string((m_labelColor >> 16) & 0xff) + ";" + - std::to_string((m_labelColor >> 8) & 0xff) + ";" + std::to_string(m_labelColor & 0xff) + - ", bundle lights: " + qtfreeutils::boolToYesNo(m_bundleTaxiLandingLights) + - ", phases: " + qtfreeutils::boolToYesNo(m_logRenderPhases) + - ", TCAS: " + qtfreeutils::boolToYesNo(m_tcasEnabled) + - ", terr.probe: " + qtfreeutils::boolToYesNo(m_terrainProbeEnabled) + - ", night t.: " + m_nightTextureMode + ", max planes: " + std::to_string(m_maxPlanes) + - ", max distance NM: " + std::to_string(m_maxDrawDistanceNM) + - ", follow dist m: " + std::to_string(m_followAircraftDistanceM) + ", msg.box: " + m_msgBox + - ", ts: " + std::to_string(m_msSinceEpochQtFree); - } - - int CXSwiftBusSettingsQtFree::update(const CXSwiftBusSettingsQtFree &newValues) - { - int changed = 0; - if (m_dBusServerAddress != newValues.m_dBusServerAddress) - { - m_dBusServerAddress = newValues.m_dBusServerAddress; - changed++; - } - if (m_msgBox != newValues.m_msgBox) - { - m_msgBox = newValues.m_msgBox; - changed++; - } - if (m_drawingLabels != newValues.m_drawingLabels) - { - m_drawingLabels = newValues.m_drawingLabels; - changed++; - } - if (m_labelColor != newValues.m_labelColor) - { - m_labelColor = newValues.m_labelColor; - changed++; - } - if (m_nightTextureMode != newValues.m_nightTextureMode) - { - m_nightTextureMode = newValues.m_nightTextureMode; - changed++; - } - if (m_logRenderPhases != newValues.m_logRenderPhases) - { - m_logRenderPhases = newValues.m_logRenderPhases; - changed++; - } - if (m_tcasEnabled != newValues.m_tcasEnabled) - { - m_tcasEnabled = newValues.m_tcasEnabled; - changed++; - } - if (m_terrainProbeEnabled != newValues.m_terrainProbeEnabled) - { - m_terrainProbeEnabled = newValues.m_terrainProbeEnabled; - changed++; - } - if (m_maxPlanes != newValues.m_maxPlanes) - { - m_maxPlanes = newValues.m_maxPlanes; - changed++; - } - if (m_msSinceEpochQtFree != newValues.m_msSinceEpochQtFree) - { - m_msSinceEpochQtFree = newValues.m_msSinceEpochQtFree; - changed++; - } - if (m_bundleTaxiLandingLights != newValues.m_bundleTaxiLandingLights) - { - m_bundleTaxiLandingLights = newValues.m_bundleTaxiLandingLights; - changed++; - } - if (m_followAircraftDistanceM != newValues.m_followAircraftDistanceM) - { - m_followAircraftDistanceM = newValues.m_followAircraftDistanceM; - changed++; - } - if (!qtfreeutils::isFuzzyEqual(m_maxDrawDistanceNM, newValues.m_maxDrawDistanceNM)) - { - m_maxDrawDistanceNM = newValues.m_maxDrawDistanceNM; - changed++; - } - - if (changed > 0) { this->objectUpdated(); } // post processing - return changed; - } - - } // namespace settings - } // namespace simulation -} // namespace swift::misc + if (json.empty()) { return false; } + + const nlohmann::basic_json parsed = nlohmann::json::parse(json, nullptr, false); + + if (parsed.is_discarded()) { return false; } + + int c = 0; + if (parsed.contains(CXSwiftBusSettingsQtFree::JsonDBusServerAddress) && + parsed[CXSwiftBusSettingsQtFree::JsonDBusServerAddress].is_string()) + { + m_dBusServerAddress = parsed[CXSwiftBusSettingsQtFree::JsonDBusServerAddress].get(); + c++; + } + if (parsed.contains(CXSwiftBusSettingsQtFree::JsonMessageBox) && + parsed[CXSwiftBusSettingsQtFree::JsonMessageBox].is_string()) + { + m_msgBox = parsed[CXSwiftBusSettingsQtFree::JsonMessageBox].get(); + c++; + } + if (parsed.contains(CXSwiftBusSettingsQtFree::JsonNightTextureMode) && + parsed[CXSwiftBusSettingsQtFree::JsonNightTextureMode].is_string()) + { + m_nightTextureMode = parsed[CXSwiftBusSettingsQtFree::JsonNightTextureMode].get(); + c++; + } + if (parsed.contains(CXSwiftBusSettingsQtFree::JsonDrawingLabels) && + parsed[CXSwiftBusSettingsQtFree::JsonDrawingLabels].is_boolean()) + { + m_drawingLabels = parsed[CXSwiftBusSettingsQtFree::JsonDrawingLabels].get(); + c++; + } + if (parsed.contains(CXSwiftBusSettingsQtFree::JsonLabelColor) && + parsed[CXSwiftBusSettingsQtFree::JsonLabelColor].is_number_integer()) + { + m_labelColor = parsed[CXSwiftBusSettingsQtFree::JsonLabelColor].get(); + c++; + } + if (parsed.contains(CXSwiftBusSettingsQtFree::JsonBundleTaxiLandingLights) && + parsed[CXSwiftBusSettingsQtFree::JsonBundleTaxiLandingLights].is_boolean()) + { + m_bundleTaxiLandingLights = parsed[CXSwiftBusSettingsQtFree::JsonBundleTaxiLandingLights].get(); + c++; + } + if (parsed.contains(CXSwiftBusSettingsQtFree::JsonTcas) && + parsed[CXSwiftBusSettingsQtFree::JsonTcas].is_boolean()) + { + m_tcasEnabled = parsed[CXSwiftBusSettingsQtFree::JsonTcas].get(); + c++; + } + if (parsed.contains(CXSwiftBusSettingsQtFree::JsonTerrainProbe) && + parsed[CXSwiftBusSettingsQtFree::JsonTerrainProbe].is_boolean()) + { + m_terrainProbeEnabled = parsed[CXSwiftBusSettingsQtFree::JsonTerrainProbe].get(); + c++; + } + if (parsed.contains(CXSwiftBusSettingsQtFree::JsonLogRenderPhases) && + parsed[CXSwiftBusSettingsQtFree::JsonLogRenderPhases].is_boolean()) + { + m_logRenderPhases = parsed[CXSwiftBusSettingsQtFree::JsonLogRenderPhases].get(); + c++; + } + if (parsed.contains(CXSwiftBusSettingsQtFree::JsonMaxPlanes) && + parsed[CXSwiftBusSettingsQtFree::JsonMaxPlanes].is_number_integer()) + { + m_maxPlanes = parsed[CXSwiftBusSettingsQtFree::JsonMaxPlanes].get(); + c++; + } + if (parsed.contains(CXSwiftBusSettingsQtFree::JsonMaxDrawDistance) && + parsed[CXSwiftBusSettingsQtFree::JsonMaxDrawDistance].is_number_float()) + { + m_maxDrawDistanceNM = parsed[CXSwiftBusSettingsQtFree::JsonMaxDrawDistance].get(); + c++; + } + if (parsed.contains(CXSwiftBusSettingsQtFree::JsonFollowAircraftDistanceM) && + parsed[CXSwiftBusSettingsQtFree::JsonFollowAircraftDistanceM].is_number_integer()) + { + m_followAircraftDistanceM = parsed[CXSwiftBusSettingsQtFree::JsonFollowAircraftDistanceM].get(); + c++; + } + if (parsed.contains(CXSwiftBusSettingsQtFree::JsonTimestamp) && + parsed[CXSwiftBusSettingsQtFree::JsonTimestamp].is_number_integer()) + { + m_msSinceEpochQtFree = parsed[CXSwiftBusSettingsQtFree::JsonTimestamp].get(); + c++; + } + this->objectUpdated(); // post processing + return c == 13; + } + + std::string CXSwiftBusSettingsQtFree::toXSwiftBusJsonString() const + { + nlohmann::json json; + + json[JsonDBusServerAddress] = m_dBusServerAddress; + json[JsonNightTextureMode] = m_nightTextureMode; + json[JsonMessageBox] = m_msgBox; + json[JsonMaxPlanes] = m_maxPlanes; + json[JsonMaxDrawDistance] = m_maxDrawDistanceNM; + json[JsonTimestamp] = m_msSinceEpochQtFree; + json[JsonDrawingLabels] = m_drawingLabels; + json[JsonLabelColor] = m_labelColor; + json[JsonBundleTaxiLandingLights] = m_bundleTaxiLandingLights; + json[JsonFollowAircraftDistanceM] = m_followAircraftDistanceM; + json[JsonLogRenderPhases] = m_logRenderPhases; + json[JsonTcas] = m_tcasEnabled; + json[JsonTerrainProbe] = m_terrainProbeEnabled; + + return json.dump(2); + } + + std::string CXSwiftBusSettingsQtFree::convertToString() const + { + return "DBusServer: " + m_dBusServerAddress + ", drawLabels: " + qtfreeutils::boolToYesNo(m_drawingLabels) + + ", labelColor: " + std::to_string((m_labelColor >> 16) & 0xff) + ";" + + std::to_string((m_labelColor >> 8) & 0xff) + ";" + std::to_string(m_labelColor & 0xff) + + ", bundle lights: " + qtfreeutils::boolToYesNo(m_bundleTaxiLandingLights) + + ", phases: " + qtfreeutils::boolToYesNo(m_logRenderPhases) + + ", TCAS: " + qtfreeutils::boolToYesNo(m_tcasEnabled) + + ", terr.probe: " + qtfreeutils::boolToYesNo(m_terrainProbeEnabled) + + ", night t.: " + m_nightTextureMode + ", max planes: " + std::to_string(m_maxPlanes) + + ", max distance NM: " + std::to_string(m_maxDrawDistanceNM) + + ", follow dist m: " + std::to_string(m_followAircraftDistanceM) + ", msg.box: " + m_msgBox + + ", ts: " + std::to_string(m_msSinceEpochQtFree); + } + + int CXSwiftBusSettingsQtFree::update(const CXSwiftBusSettingsQtFree &newValues) + { + int changed = 0; + if (m_dBusServerAddress != newValues.m_dBusServerAddress) + { + m_dBusServerAddress = newValues.m_dBusServerAddress; + changed++; + } + if (m_msgBox != newValues.m_msgBox) + { + m_msgBox = newValues.m_msgBox; + changed++; + } + if (m_drawingLabels != newValues.m_drawingLabels) + { + m_drawingLabels = newValues.m_drawingLabels; + changed++; + } + if (m_labelColor != newValues.m_labelColor) + { + m_labelColor = newValues.m_labelColor; + changed++; + } + if (m_nightTextureMode != newValues.m_nightTextureMode) + { + m_nightTextureMode = newValues.m_nightTextureMode; + changed++; + } + if (m_logRenderPhases != newValues.m_logRenderPhases) + { + m_logRenderPhases = newValues.m_logRenderPhases; + changed++; + } + if (m_tcasEnabled != newValues.m_tcasEnabled) + { + m_tcasEnabled = newValues.m_tcasEnabled; + changed++; + } + if (m_terrainProbeEnabled != newValues.m_terrainProbeEnabled) + { + m_terrainProbeEnabled = newValues.m_terrainProbeEnabled; + changed++; + } + if (m_maxPlanes != newValues.m_maxPlanes) + { + m_maxPlanes = newValues.m_maxPlanes; + changed++; + } + if (m_msSinceEpochQtFree != newValues.m_msSinceEpochQtFree) + { + m_msSinceEpochQtFree = newValues.m_msSinceEpochQtFree; + changed++; + } + if (m_bundleTaxiLandingLights != newValues.m_bundleTaxiLandingLights) + { + m_bundleTaxiLandingLights = newValues.m_bundleTaxiLandingLights; + changed++; + } + if (m_followAircraftDistanceM != newValues.m_followAircraftDistanceM) + { + m_followAircraftDistanceM = newValues.m_followAircraftDistanceM; + changed++; + } + if (!qtfreeutils::isFuzzyEqual(m_maxDrawDistanceNM, newValues.m_maxDrawDistanceNM)) + { + m_maxDrawDistanceNM = newValues.m_maxDrawDistanceNM; + changed++; + } + + if (changed > 0) { this->objectUpdated(); } // post processing + return changed; + } + +} // namespace swift::misc::simulation::settings #ifdef __GNUC__ # pragma GCC diagnostic pop diff --git a/src/misc/simulation/simulationenvironmentprovider.h b/src/misc/simulation/simulationenvironmentprovider.h index 07b91284e0..7e17e16445 100644 --- a/src/misc/simulation/simulationenvironmentprovider.h +++ b/src/misc/simulation/simulationenvironmentprovider.h @@ -404,7 +404,7 @@ namespace swift::misc::simulation protected: //! Default constructor - CSimulationEnvironmentAware() {} + CSimulationEnvironmentAware() {} // NOLINT(modernize-use-equals-default) //! Constructor CSimulationEnvironmentAware(ISimulationEnvironmentProvider *simEnvProvider) : IProviderAware(simEnvProvider) diff --git a/src/misc/simulation/xplane/aircraftmodelloaderxplane.cpp b/src/misc/simulation/xplane/aircraftmodelloaderxplane.cpp index 5c1bd36168..b946ae2927 100644 --- a/src/misc/simulation/xplane/aircraftmodelloaderxplane.cpp +++ b/src/misc/simulation/xplane/aircraftmodelloaderxplane.cpp @@ -3,9 +3,8 @@ #include "misc/simulation/xplane/aircraftmodelloaderxplane.h" -#include - #include +#include #include #include @@ -614,9 +613,14 @@ namespace swift::misc::simulation::xplane using command = std::function; using namespace std::placeholders; - const QMap commands { - { "EXPORT_NAME", std::bind(&CAircraftModelLoaderXPlane::parseExportCommand, this, _1, _2, _3, _4) } - }; + const QMap commands { { "EXPORT_NAME", + [this](auto &&tokens, auto &&package, auto &&path, auto &&lineNum) { + return parseExportCommand( + std::forward(tokens), + std::forward(package), + std::forward(path), + std::forward(lineNum)); + } } }; CSLPackage package; int lineNum = 0; @@ -648,18 +652,68 @@ namespace swift::misc::simulation::xplane using namespace std::placeholders; const QMap commands { - { "EXPORT_NAME", std::bind(&CAircraftModelLoaderXPlane::parseDummyCommand, this, _1, _2, _3, _4) }, - { "DEPENDENCY", std::bind(&CAircraftModelLoaderXPlane::parseDependencyCommand, this, _1, _2, _3, _4) }, - { "OBJECT", std::bind(&CAircraftModelLoaderXPlane::parseObjectCommand, this, _1, _2, _3, _4) }, - { "TEXTURE", std::bind(&CAircraftModelLoaderXPlane::parseTextureCommand, this, _1, _2, _3, _4) }, - { "AIRCRAFT", std::bind(&CAircraftModelLoaderXPlane::parseAircraftCommand, this, _1, _2, _3, _4) }, - { "OBJ8_AIRCRAFT", std::bind(&CAircraftModelLoaderXPlane::parseObj8AircraftCommand, this, _1, _2, _3, _4) }, - { "OBJ8", std::bind(&CAircraftModelLoaderXPlane::parseObj8Command, this, _1, _2, _3, _4) }, - { "HASGEAR", std::bind(&CAircraftModelLoaderXPlane::parseHasGearCommand, this, _1, _2, _3, _4) }, - { "ICAO", std::bind(&CAircraftModelLoaderXPlane::parseIcaoCommand, this, _1, _2, _3, _4) }, - { "AIRLINE", std::bind(&CAircraftModelLoaderXPlane::parseAirlineCommand, this, _1, _2, _3, _4) }, - { "LIVERY", std::bind(&CAircraftModelLoaderXPlane::parseLiveryCommand, this, _1, _2, _3, _4) }, - { "VERT_OFFSET", std::bind(&CAircraftModelLoaderXPlane::parseDummyCommand, this, _1, _2, _3, _4) }, + { "EXPORT_NAME", + [this](auto &&PH1, auto &&PH2, auto &&PH3, auto &&PH4) { + return parseDummyCommand(std::forward(PH1), std::forward(PH2), + std::forward(PH3), std::forward(PH4)); + } }, + { "DEPENDENCY", + [this](auto &&PH1, auto &&PH2, auto &&PH3, auto &&PH4) { + return parseDependencyCommand(std::forward(PH1), std::forward(PH2), + std::forward(PH3), std::forward(PH4)); + } }, + { "OBJECT", + [this](auto &&PH1, auto &&PH2, auto &&PH3, auto &&PH4) { + return parseObjectCommand(std::forward(PH1), std::forward(PH2), + std::forward(PH3), std::forward(PH4)); + } }, + { "TEXTURE", + [this](auto &&PH1, auto &&PH2, auto &&PH3, auto &&PH4) { + return parseTextureCommand(std::forward(PH1), std::forward(PH2), + std::forward(PH3), std::forward(PH4)); + } }, + { + "AIRCRAFT", + [this](auto &&PH1, auto &&PH2, auto &&PH3, auto &&PH4) { + return parseAircraftCommand(std::forward(PH1), std::forward(PH2), + std::forward(PH3), std::forward(PH4)); + }, + }, + { "OBJ8_AIRCRAFT", + [this](auto &&PH1, auto &&PH2, auto &&PH3, auto &&PH4) { + return parseObj8AircraftCommand(std::forward(PH1), std::forward(PH2), + std::forward(PH3), std::forward(PH4)); + } }, + { "OBJ8", + [this](auto &&PH1, auto &&PH2, auto &&PH3, auto &&PH4) { + return parseObj8Command(std::forward(PH1), std::forward(PH2), + std::forward(PH3), std::forward(PH4)); + } }, + { "HASGEAR", + [this](auto &&PH1, auto &&PH2, auto &&PH3, auto &&PH4) { + return parseHasGearCommand(std::forward(PH1), std::forward(PH2), + std::forward(PH3), std::forward(PH4)); + } }, + { "ICAO", + [this](auto &&PH1, auto &&PH2, auto &&PH3, auto &&PH4) { + return parseIcaoCommand(std::forward(PH1), std::forward(PH2), + std::forward(PH3), std::forward(PH4)); + } }, + { "AIRLINE", + [this](auto &&PH1, auto &&PH2, auto &&PH3, auto &&PH4) { + return parseAirlineCommand(std::forward(PH1), std::forward(PH2), + std::forward(PH3), std::forward(PH4)); + } }, + { "LIVERY", + [this](auto &&PH1, auto &&PH2, auto &&PH3, auto &&PH4) { + return parseLiveryCommand(std::forward(PH1), std::forward(PH2), + std::forward(PH3), std::forward(PH4)); + } }, + { "VERT_OFFSET", + [this](auto &&PH1, auto &&PH2, auto &&PH3, auto &&PH4) { + return parseDummyCommand(std::forward(PH1), std::forward(PH2), + std::forward(PH3), std::forward(PH4)); + } }, }; int lineNum = 0; diff --git a/src/plugins/simulator/flightgear/simulatorflightgear.cpp b/src/plugins/simulator/flightgear/simulatorflightgear.cpp index fc57031a64..1949ebcb3e 100644 --- a/src/plugins/simulator/flightgear/simulatorflightgear.cpp +++ b/src/plugins/simulator/flightgear/simulatorflightgear.cpp @@ -3,7 +3,7 @@ #include "simulatorflightgear.h" -#include +#include #include #include @@ -872,7 +872,10 @@ namespace swift::simplugin::flightgear } using namespace std::placeholders; - auto callback = std::bind(&CSimulatorFlightgear::callbackReceivedRequestedElevation, this, _1, _2, false); + auto callback = [this](auto &&plane, auto &&callsign) { + callbackReceivedRequestedElevation(std::forward(plane), + std::forward(callsign), false); + }; // Request m_trafficProxy->getElevationAtPosition(callsign, pos.latitude().value(CAngleUnit::deg()), diff --git a/src/plugins/simulator/xplane/simulatorxplane.cpp b/src/plugins/simulator/xplane/simulatorxplane.cpp index afc6be625a..3972583bea 100644 --- a/src/plugins/simulator/xplane/simulatorxplane.cpp +++ b/src/plugins/simulator/xplane/simulatorxplane.cpp @@ -3,7 +3,7 @@ #include "simulatorxplane.h" -#include +#include #include #include @@ -267,7 +267,11 @@ namespace swift::simplugin::xplane } using namespace std::placeholders; - auto callback = std::bind(&CSimulatorXPlane::callbackReceivedRequestedElevation, this, _1, _2, _3); + auto callback = [this](auto &&plane, auto &&callsign, auto &&isWater) { + callbackReceivedRequestedElevation(std::forward(plane), + std::forward(callsign), + std::forward(isWater)); + }; // Request m_trafficProxy->getElevationAtPosition(callsign, pos.latitude().value(CAngleUnit::deg()), diff --git a/src/swiftlauncher/swiftlauncher.cpp b/src/swiftlauncher/swiftlauncher.cpp index 505d168fe2..cd96c29a56 100644 --- a/src/swiftlauncher/swiftlauncher.cpp +++ b/src/swiftlauncher/swiftlauncher.cpp @@ -181,7 +181,7 @@ void CSwiftLauncher::clearWindowsRegistry() CGuiApplication::removeAllWindowsSwiftRegistryEntries(); } -CSwiftLauncher::~CSwiftLauncher() {} +CSwiftLauncher::~CSwiftLauncher() = default; QString CSwiftLauncher::getCmdLine() const { return this->toCmdLine(m_executable, m_executableArgs); } diff --git a/src/swiftlauncher/swiftlauncher.h b/src/swiftlauncher/swiftlauncher.h index 025dc7e3b3..6294d3af52 100644 --- a/src/swiftlauncher/swiftlauncher.h +++ b/src/swiftlauncher/swiftlauncher.h @@ -66,7 +66,7 @@ class CSwiftLauncher : CSwiftLauncher(bool installerMode, QWidget *parent = nullptr); //! Destructor - virtual ~CSwiftLauncher() override; + ~CSwiftLauncher() override; //! Executable (to be started) const QString &getExecutable() const { return m_executable; } From 8a877e85b7a360c09087b15a982dedff510669fd Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Sat, 25 Oct 2025 15:49:22 +0200 Subject: [PATCH 12/21] refactor: Fix readability-use-std-min-max --- .clang-tidy | 2 +- src/core/afv/audio/input.cpp | 2 +- src/core/afv/audio/output.cpp | 4 ++-- src/core/simulator.cpp | 2 +- .../components/dbautosimulatorstashingcomponent.cpp | 3 +-- src/gui/components/dbautostashingcomponent.cpp | 5 ++--- src/gui/components/logincomponent.cpp | 2 +- src/gui/models/listmodelbasenontemplate.cpp | 2 +- src/misc/network/urlloglist.cpp | 4 ++-- src/misc/simulation/settings/xswiftbussettingsqtfree.h | 2 +- src/misc/simulation/simulationenvironmentprovider.cpp | 2 +- src/misc/statusmessagelist.cpp | 2 +- src/misc/timestampobjectlist.h | 10 ++++++---- .../simulator/flightgear/simulatorflightgear.cpp | 2 +- src/plugins/simulator/xplane/simulatorxplane.cpp | 2 +- 15 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 07ffd5596b..02121bdaf7 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -42,7 +42,7 @@ Checks: > modernize-use-transparent-functors, modernize-use-uncaught-exceptions, modernize-use-using, - + readability-use-std-min-max, CheckOptions: - key: readability-identifier-naming.ClassCase diff --git a/src/core/afv/audio/input.cpp b/src/core/afv/audio/input.cpp index 6d81d7aa5c..5a4893f1dd 100644 --- a/src/core/afv/audio/input.cpp +++ b/src/core/afv/audio/input.cpp @@ -173,7 +173,7 @@ namespace swift::core::afv::audio double db = qBound(minDb, inputVolumeStreamArgs.PeakDB, maxDb); double ratio = (db - minDb) / (maxDb - minDb); if (ratio < 0.30) { ratio = 0.0; } - if (ratio > 1.0) { ratio = 1.0; } + ratio = std::min(ratio, 1.0); inputVolumeStreamArgs.PeakVU = ratio; emit inputVolumeStream(inputVolumeStreamArgs); m_sampleCount = 0; diff --git a/src/core/afv/audio/output.cpp b/src/core/afv/audio/output.cpp index 60f6df4871..3d33f1a58e 100644 --- a/src/core/afv/audio/output.cpp +++ b/src/core/afv/audio/output.cpp @@ -51,7 +51,7 @@ namespace swift::core::afv::audio for (float sample : std::as_const(buffer)) { const float absSample = qAbs(sample); - if (absSample > m_maxSampleOutput) { m_maxSampleOutput = absSample; } + m_maxSampleOutput = std::max(absSample, m_maxSampleOutput); } m_sampleCount += buffer.size(); @@ -63,7 +63,7 @@ namespace swift::core::afv::audio const double db = qBound(m_minDb, outputVolumeStreamArgs.PeakDb, m_maxDb); double ratio = (db - m_minDb) / (m_maxDb - m_minDb); if (ratio < 0.30) { ratio = 0.0; } - if (ratio > 1.0) { ratio = 1.0; } + ratio = std::min(ratio, 1.0); outputVolumeStreamArgs.PeakVU = ratio; emit outputVolumeStream(outputVolumeStreamArgs); m_sampleCount = 0; diff --git a/src/core/simulator.cpp b/src/core/simulator.cpp index 69bef852f4..830477929e 100644 --- a/src/core/simulator.cpp +++ b/src/core/simulator.cpp @@ -1040,7 +1040,7 @@ namespace swift::core if (!this->isUpdateAllRemoteAircraft(startTime)) { this->resetUpdateAllRemoteAircraft(); } - if (m_statsMaxUpdateTimeMs < dt) { m_statsMaxUpdateTimeMs = dt; } + m_statsMaxUpdateTimeMs = std::max(m_statsMaxUpdateTimeMs, dt); if (m_statsLastUpdateAircraftRequestedMs > 0) { m_statsUpdateAircraftRequestedDeltaMs = startTime - m_statsLastUpdateAircraftRequestedMs; diff --git a/src/gui/components/dbautosimulatorstashingcomponent.cpp b/src/gui/components/dbautosimulatorstashingcomponent.cpp index 56c9442a24..e52f4b67f1 100644 --- a/src/gui/components/dbautosimulatorstashingcomponent.cpp +++ b/src/gui/components/dbautosimulatorstashingcomponent.cpp @@ -65,8 +65,7 @@ namespace swift::gui::components void CDbAutoSimulatorStashingComponent::updateProgressIndicator(int percent) { - if (percent > 100) { percent = 100; } - if (percent < 0) { percent = 0; } + percent = std::clamp(percent, 0, 100); ui->pb_StashingProgress->setValue(percent); } diff --git a/src/gui/components/dbautostashingcomponent.cpp b/src/gui/components/dbautostashingcomponent.cpp index 1330e838b7..c2b9f7f4c9 100644 --- a/src/gui/components/dbautostashingcomponent.cpp +++ b/src/gui/components/dbautostashingcomponent.cpp @@ -163,8 +163,7 @@ namespace swift::gui::components void CDbAutoStashingComponent::updateProgressIndicator(int percent) { - if (percent > 100) { percent = 100; } - if (percent < 0) { percent = 0; } + percent = std::clamp(percent, 0, 100); ui->pb_StashingProgress->setValue(percent); ui->le_Stashed->setText(QString::number(m_noStashed)); ui->le_NoData->setText(QString::number(m_noData)); @@ -249,7 +248,7 @@ namespace swift::gui::components if (max < all) { int maxPercent = autoStashed.size() * 100 / max; - if (maxPercent > percent) { percent = maxPercent; } + percent = std::max(maxPercent, percent); } this->updateProgressIndicator(percent); } diff --git a/src/gui/components/logincomponent.cpp b/src/gui/components/logincomponent.cpp index 0daf2baf4f..e9eb99d7f2 100644 --- a/src/gui/components/logincomponent.cpp +++ b/src/gui/components/logincomponent.cpp @@ -403,7 +403,7 @@ namespace swift::gui::components { int v = ui->pb_LogoffTimeout->value(); v -= 1; - if (v < 0) { v = 0; } + v = std::max(v, 0); ui->pb_LogoffTimeout->setValue(v); if (v <= 0) { diff --git a/src/gui/models/listmodelbasenontemplate.cpp b/src/gui/models/listmodelbasenontemplate.cpp index 6298bb2522..d216ae8ce8 100644 --- a/src/gui/models/listmodelbasenontemplate.cpp +++ b/src/gui/models/listmodelbasenontemplate.cpp @@ -150,7 +150,7 @@ namespace swift::gui::models const int columns = columnCount(); const int rows = rowCount(); if (columns < 1) { return; } - if (startRowIndex < 0) { startRowIndex = 0; } + startRowIndex = std::max(startRowIndex, 0); if (endRowIndex >= rows) { endRowIndex = rows - 1; } const QModelIndex topLeft(createIndex(startRowIndex, 0)); const QModelIndex bottomRight(createIndex(endRowIndex, columns - 1)); diff --git a/src/misc/network/urlloglist.cpp b/src/misc/network/urlloglist.cpp index d1251f0bb5..6e543b54dd 100644 --- a/src/misc/network/urlloglist.cpp +++ b/src/misc/network/urlloglist.cpp @@ -93,7 +93,7 @@ namespace swift::misc::network for (const CUrlLog &rl : *this) { if (rl.isPending()) { continue; } - if (rl.getResponseTimeMs() > max) { max = rl.getResponseTimeMs(); } + max = std::max(rl.getResponseTimeMs(), max); } return max; } @@ -105,7 +105,7 @@ namespace swift::misc::network for (const CUrlLog &rl : *this) { if (rl.isPending()) { continue; } - if (rl.getResponseTimeMs() < min) { min = rl.getResponseTimeMs(); } + min = std::min(rl.getResponseTimeMs(), min); } return min; } diff --git a/src/misc/simulation/settings/xswiftbussettingsqtfree.h b/src/misc/simulation/settings/xswiftbussettingsqtfree.h index b2e153dc22..14838b5d96 100644 --- a/src/misc/simulation/settings/xswiftbussettingsqtfree.h +++ b/src/misc/simulation/settings/xswiftbussettingsqtfree.h @@ -63,7 +63,7 @@ namespace swift::misc::simulation::settings int freqRgb, int privRgb, int servRgb, int statRgb, int supRgb) { if (topPx >= 0) { bottomPx = -1; } - if (lines < 3) { lines = 3; } + lines = std::max(lines, 3); this->setMessageBoxValues( std::to_string(leftPx) + ";" + std::to_string(topPx) + ";" + std::to_string(rightPx) + ";" + std::to_string(bottomPx) + ";" + std::to_string(lines) + ";" + std::to_string(durationMs) + ";" + diff --git a/src/misc/simulation/simulationenvironmentprovider.cpp b/src/misc/simulation/simulationenvironmentprovider.cpp index b28f781d8c..371260d91c 100644 --- a/src/misc/simulation/simulationenvironmentprovider.cpp +++ b/src/misc/simulation/simulationenvironmentprovider.cpp @@ -105,7 +105,7 @@ namespace swift::misc::simulation const qint64 deltaMs = now - startedMs; m_pendingElevationRequests.remove(requestedForCallsign); m_statsCurrentElevRequestTimeMs = deltaMs; - if (m_statsMaxElevRequestTimeMs < deltaMs) { m_statsMaxElevRequestTimeMs = deltaMs; } + m_statsMaxElevRequestTimeMs = std::max(m_statsMaxElevRequestTimeMs, deltaMs); } } return true; diff --git a/src/misc/statusmessagelist.cpp b/src/misc/statusmessagelist.cpp index 9ec5b78c49..bede4109f5 100644 --- a/src/misc/statusmessagelist.cpp +++ b/src/misc/statusmessagelist.cpp @@ -187,7 +187,7 @@ namespace swift::misc if (msg.isEmpty()) { continue; } newMsgs.append(msg.getMessage()); CStatusMessage::StatusSeverity ms = msg.getSeverity(); - if (s < ms) { s = ms; } + s = std::max(s, ms); cats.push_back(msg.getCategories()); } const CStatusMessage newMsg(cats, s, newMsgs.join(", ")); diff --git a/src/misc/timestampobjectlist.h b/src/misc/timestampobjectlist.h index fcd6f589e0..c8c6e2f25a 100644 --- a/src/misc/timestampobjectlist.h +++ b/src/misc/timestampobjectlist.h @@ -6,6 +6,8 @@ #ifndef SWIFT_MISC_TIMESTAMPOBJECTLIST_H #define SWIFT_MISC_TIMESTAMPOBJECTLIST_H +#include + #include #include "config/buildconfig.h" @@ -382,8 +384,8 @@ namespace swift::misc const ITimestampBased &l = last; const ITimestampBased &o = object; const qint64 diff = l.getAbsTimeDifferenceMs(o); - if (diff > mmm.max) { mmm.max = diff; } - if (diff < mmm.min) { mmm.min = diff; } + mmm.max = std::max(diff, mmm.max); + mmm.min = std::min(diff, mmm.min); mean += diff; } c++; @@ -722,8 +724,8 @@ namespace swift::misc { if (!object.hasNonZeroOffsetTime()) { continue; } const qint64 os = object.getTimeOffsetMs(); - if (os > mmm.max) { mmm.max = os; } - if (os < mmm.min) { mmm.min = os; } + mmm.max = std::max(os, mmm.max); + mmm.min = std::min(os, mmm.min); mean += os; c++; } diff --git a/src/plugins/simulator/flightgear/simulatorflightgear.cpp b/src/plugins/simulator/flightgear/simulatorflightgear.cpp index 1949ebcb3e..25d1b58b46 100644 --- a/src/plugins/simulator/flightgear/simulatorflightgear.cpp +++ b/src/plugins/simulator/flightgear/simulatorflightgear.cpp @@ -821,7 +821,7 @@ namespace swift::simplugin::flightgear const qint64 wasStartedMs = m_addingInProgressAircraft.value(cs); const qint64 deltaTimeMs = QDateTime::currentMSecsSinceEpoch() - wasStartedMs; m_statsAddCurrentTimeMs = deltaTimeMs; - if (deltaTimeMs > m_statsAddMaxTimeMs) { m_statsAddMaxTimeMs = deltaTimeMs; } + m_statsAddMaxTimeMs = std::max(deltaTimeMs, m_statsAddMaxTimeMs); m_addingInProgressAircraft.remove(cs); } diff --git a/src/plugins/simulator/xplane/simulatorxplane.cpp b/src/plugins/simulator/xplane/simulatorxplane.cpp index 3972583bea..b8076c7d71 100644 --- a/src/plugins/simulator/xplane/simulatorxplane.cpp +++ b/src/plugins/simulator/xplane/simulatorxplane.cpp @@ -1171,7 +1171,7 @@ namespace swift::simplugin::xplane const qint64 wasStartedMs = m_addingInProgressAircraft.value(cs); const qint64 deltaTimeMs = QDateTime::currentMSecsSinceEpoch() - wasStartedMs; m_statsAddCurrentTimeMs = deltaTimeMs; - if (deltaTimeMs > m_statsAddMaxTimeMs) { m_statsAddMaxTimeMs = deltaTimeMs; } + m_statsAddMaxTimeMs = std::max(deltaTimeMs, m_statsAddMaxTimeMs); m_addingInProgressAircraft.remove(cs); } From 3758b2b5b952a98f768dd52bdc613ab5f9b33016 Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Sat, 25 Oct 2025 16:42:41 +0200 Subject: [PATCH 13/21] refactor: Fix readability-use-anyofallof --- .clang-tidy | 1 + src/core/application/applicationsettings.h | 24 +++------ src/core/context/contextaudioimpl.cpp | 7 +-- src/core/db/databasereaderconfig.cpp | 51 +++++++------------ src/core/pluginmanager.cpp | 8 +-- src/gui/models/columns.cpp | 7 +-- src/misc/audio/audiodeviceinfolist.cpp | 8 ++- src/misc/aviation/aircraftsituationlist.cpp | 16 +++--- src/misc/aviation/callsign.cpp | 8 +-- src/misc/db/artifact.cpp | 10 ++-- src/misc/db/datastoreobjectlist.h | 17 +++---- src/misc/directoryutils.cpp | 8 ++- src/misc/fileutils.cpp | 14 ++--- src/misc/network/rolelist.cpp | 6 +-- src/misc/network/serverlist.cpp | 12 +---- src/misc/orderablelist.h | 7 +-- src/misc/pq/measurementunit.h | 15 ++---- src/misc/simulation/aircraftmodellist.cpp | 18 +++---- src/misc/simulation/distributorlist.cpp | 7 +-- .../fscommon/aircraftcfgentrieslist.cpp | 8 ++- .../interpolationsetupprovider.cpp | 8 ++- src/misc/timestampobjectlist.h | 14 ++--- 22 files changed, 90 insertions(+), 184 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 02121bdaf7..6b2e383ade 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -43,6 +43,7 @@ Checks: > modernize-use-uncaught-exceptions, modernize-use-using, readability-use-std-min-max, + readability-use-anyofallof, CheckOptions: - key: readability-identifier-naming.ClassCase diff --git a/src/core/application/applicationsettings.h b/src/core/application/applicationsettings.h index b2bfad00d0..b3fe5c5e3b 100644 --- a/src/core/application/applicationsettings.h +++ b/src/core/application/applicationsettings.h @@ -30,15 +30,10 @@ namespace swift::core::application //! \copydoc swift::misc::TSettingTrait::isValid static bool isValid(const misc::input::CActionHotkeyList &value, QString &) { - for (const auto &actionHotkey : value) - { - if (actionHotkey.getApplicableMachine().getMachineName().isEmpty() || - actionHotkey.getAction().isEmpty() || actionHotkey.getCombination().isEmpty()) - { - return false; - } - } - return true; + return std::all_of(value.cbegin(), value.cend(), [](const auto &actionHotkey) { + return !actionHotkey.getApplicableMachine().getMachineName().isEmpty() && + !actionHotkey.getAction().isEmpty() && !actionHotkey.getCombination().isEmpty(); + }); } }; @@ -66,14 +61,9 @@ namespace swift::core::application //! \copydoc swift::misc::TSettingTrait::isValid static bool isValid(const QStringList &pluginIdentifiers, QString &) { - for (const QString &pluginIdentifier : pluginIdentifiers) - { - if (!misc::simulation::CSimulatorPluginInfo::allIdentifiers().contains(pluginIdentifier)) - { - return false; - } - } - return true; + return std::all_of(pluginIdentifiers.cbegin(), pluginIdentifiers.cend(), [](const auto &pluginIdentifier) { + return misc::simulation::CSimulatorPluginInfo::allIdentifiers().contains(pluginIdentifier); + }); } }; diff --git a/src/core/context/contextaudioimpl.cpp b/src/core/context/contextaudioimpl.cpp index abb7c20a7b..2cbc2f2128 100644 --- a/src/core/context/contextaudioimpl.cpp +++ b/src/core/context/contextaudioimpl.cpp @@ -53,11 +53,8 @@ namespace swift::core::context bool CContextAudio::hasRegisteredAudioCallsign(const CCallsign &callsign) const { - for (const CCallsign &cs : m_registeredCallsigns.values()) - { - if (callsign == cs) { return true; } - } - return false; + return std::any_of(m_registeredCallsigns.begin(), m_registeredCallsigns.end(), + [&](const CCallsign &cs) { return callsign == cs; }); } CAudioDeviceInfoList CContextAudio::getRegisteredDevices() const { return m_registeredDevices; } diff --git a/src/core/db/databasereaderconfig.cpp b/src/core/db/databasereaderconfig.cpp index 9a1a1df510..ce4129fd09 100644 --- a/src/core/db/databasereaderconfig.cpp +++ b/src/core/db/databasereaderconfig.cpp @@ -125,56 +125,43 @@ namespace swift::core::db bool CDatabaseReaderConfigList::possiblyReadsFromSwiftDb() const { - for (const CDatabaseReaderConfig &config : *this) - { - if (config.possiblyReadsFromSwiftDb()) { return true; } - } - return false; + return std::any_of(cbegin(), cend(), + [](const CDatabaseReaderConfig &config) { return config.possiblyReadsFromSwiftDb(); }); } bool CDatabaseReaderConfigList::possiblyWritesToSwiftDb() const { - for (const CDatabaseReaderConfig &config : *this) - { - if (config.possiblyWritesToSwiftDb()) { return true; } - } - return false; + return std::any_of(cbegin(), cend(), + [](const CDatabaseReaderConfig &config) { return config.possiblyWritesToSwiftDb(); }); } bool CDatabaseReaderConfigList::needsSharedInfoObjects(CEntityFlags::Entity entities) const { - for (const CDatabaseReaderConfig &config : *this) - { - if (!config.supportsEntities(entities)) { continue; } - if (config.needsSharedInfoFile()) { return true; } - } - return false; + return std::any_of(cbegin(), cend(), [&](const CDatabaseReaderConfig &config) { + return config.supportsEntities(entities) && config.needsSharedInfoFile(); + }); } bool CDatabaseReaderConfigList::needsSharedInfoFile(CEntityFlags::Entity entities) const { - for (const CDatabaseReaderConfig &config : *this) - { - if (!config.supportsEntities(entities)) { continue; } - if (config.needsSharedInfoFile()) { return true; } - } - return false; + return std::any_of(cbegin(), cend(), [&](const CDatabaseReaderConfig &config) { + return config.supportsEntities(entities) && config.needsSharedInfoFile(); + }); } bool CDatabaseReaderConfigList::needsSharedInfoObjectsIfCachesEmpty(CEntityFlags::Entity entities, CEntityFlags::Entity cachedEntities) const { - for (const CDatabaseReaderConfig &config : *this) - { - if (!config.supportsEntities(entities)) { continue; } - if (!config.needsSharedInfoFile()) { continue; } - if (!config.getRetrievalMode().testFlag(CDbFlags::Cached)) { return true; } // does not support caching + return std::any_of(this->begin(), this->end(), + [&entities, &cachedEntities](const CDatabaseReaderConfig &config) { + if (!config.supportsEntities(entities)) return false; + if (!config.needsSharedInfoFile()) return false; + if (!config.getRetrievalMode().testFlag(CDbFlags::Cached)) return true; - const CEntityFlags::Entity configEntities = config.getEntities(); - const CEntityFlags::Entity configEntitiesNotCached = configEntities & ~cachedEntities; - if (configEntitiesNotCached != CEntityFlags::NoEntity) { return true; } // we have entities not yet cached - } - return false; + const CEntityFlags::Entity configEntities = config.getEntities(); + const CEntityFlags::Entity configEntitiesNotCached = configEntities & ~cachedEntities; + return configEntitiesNotCached != CEntityFlags::NoEntity; + }); } CEntityFlags::Entity CDatabaseReaderConfigList::getEntitesCachedOrReadFromDB() const diff --git a/src/core/pluginmanager.cpp b/src/core/pluginmanager.cpp index 793813c8b8..238781a126 100644 --- a/src/core/pluginmanager.cpp +++ b/src/core/pluginmanager.cpp @@ -52,12 +52,8 @@ namespace swift::core if (!data.contains("identifier") || !data["identifier"].isString()) { return false; } auto iids = acceptedIids(); - for (const QString &iid : iids) - { - if (metadata["IID"].toString() == iid) { return true; } - } - - return false; + return std::any_of(iids.cbegin(), iids.cend(), + [&](const QString &iid) { return metadata["IID"].toString() == iid; }); } QString IPluginManager::pluginIdentifier(const QJsonObject &metadata) const diff --git a/src/gui/models/columns.cpp b/src/gui/models/columns.cpp index 3fa92466d9..01f919ca1b 100644 --- a/src/gui/models/columns.cpp +++ b/src/gui/models/columns.cpp @@ -201,11 +201,8 @@ namespace swift::gui::models bool CColumns::hasAnyWidthPercentage() const { - for (const CColumn &c : m_columns) - { - if (c.hasWidthPercentage()) { return true; } - } - return false; + return std::any_of(m_columns.cbegin(), m_columns.cend(), + [](const CColumn &c) { return c.hasWidthPercentage(); }); } void CColumns::setWidthPercentages(const QList &percentages) diff --git a/src/misc/audio/audiodeviceinfolist.cpp b/src/misc/audio/audiodeviceinfolist.cpp index ddd33ad2d6..c35086b029 100644 --- a/src/misc/audio/audiodeviceinfolist.cpp +++ b/src/misc/audio/audiodeviceinfolist.cpp @@ -121,11 +121,9 @@ namespace swift::misc::audio bool CAudioDeviceInfoList::hasSameDevices(const CAudioDeviceInfoList &compareDevices) const { if (compareDevices.size() != this->size()) { return false; } - for (const CAudioDeviceInfo &d : *this) - { - if (!compareDevices.findRegisteredDeviceOrDefault(d).isValid()) { return false; } - } - return true; + return std::all_of(cbegin(), cend(), [&](const CAudioDeviceInfo &d) { + return compareDevices.findRegisteredDeviceOrDefault(d).isValid(); + }); } CAudioDeviceInfoList CAudioDeviceInfoList::allInputDevices() diff --git a/src/misc/aviation/aircraftsituationlist.cpp b/src/misc/aviation/aircraftsituationlist.cpp index 05e5b0dafa..cd683ce7bf 100644 --- a/src/misc/aviation/aircraftsituationlist.cpp +++ b/src/misc/aviation/aircraftsituationlist.cpp @@ -74,11 +74,9 @@ namespace swift::misc::aviation bool CAircraftSituationList::areAllOnGroundDetailsSame(COnGroundInfo::OnGroundDetails details) const { - for (const CAircraftSituation &situation : *this) - { - if (situation.getOnGroundInfo().getGroundDetails() != details) { return false; } - } - return true; + return std::all_of(cbegin(), cend(), [&](const CAircraftSituation &situation) { + return situation.getOnGroundInfo().getGroundDetails() == details; + }); } bool CAircraftSituationList::isConstOnGround() const @@ -242,11 +240,9 @@ namespace swift::misc::aviation bool CAircraftSituationList::containsPushBack() const { - for (const CAircraftSituation &situation : *this) - { - if (situation.getGroundSpeed().isNegativeWithEpsilonConsidered()) { return true; } - } - return false; + return std::any_of(cbegin(), cend(), [](const CAircraftSituation &situation) { + return situation.getGroundSpeed().isNegativeWithEpsilonConsidered(); + }); } int CAircraftSituationList::countOnGround(COnGroundInfo::IsOnGround og) const diff --git a/src/misc/aviation/callsign.cpp b/src/misc/aviation/callsign.cpp index 3240eef939..55354cf353 100644 --- a/src/misc/aviation/callsign.cpp +++ b/src/misc/aviation/callsign.cpp @@ -402,11 +402,7 @@ namespace swift::misc::aviation { if (!callsign.contains("_")) { return false; } const QStringView uc = callsign.toUpper(); - - for (const QString &r : CCallsign::atcAlikeCallsignSuffixes()) - { - if (uc.endsWith(r)) { return true; } - } - return false; + return std::any_of(CCallsign::atcAlikeCallsignSuffixes().cbegin(), CCallsign::atcAlikeCallsignSuffixes().cend(), + [&](const QString &r) { return uc.endsWith(r); }); } } // namespace swift::misc::aviation diff --git a/src/misc/db/artifact.cpp b/src/misc/db/artifact.cpp index 2149a21147..aa708d1402 100644 --- a/src/misc/db/artifact.cpp +++ b/src/misc/db/artifact.cpp @@ -46,12 +46,10 @@ namespace swift::misc::db bool CArtifact::isWithDistribution(const CDistribution &distribution, bool acceptMoreStableDistributions) const { if (distribution.isEmpty() || !this->hasDistributions()) { return false; } - for (const CDistribution &dist : this->getDistributions()) - { - if (dist == distribution) { return true; } - if (acceptMoreStableDistributions && dist.isStabilityBetter(distribution)) { return true; } - } - return false; + return std::any_of( + this->getDistributions().cbegin(), this->getDistributions().cend(), [&](const CDistribution &dist) { + return dist == distribution || (acceptMoreStableDistributions && dist.isStabilityBetter(distribution)); + }); } CRemoteFile CArtifact::asRemoteFile() const diff --git a/src/misc/db/datastoreobjectlist.h b/src/misc/db/datastoreobjectlist.h index 3091be82f9..442d634f42 100644 --- a/src/misc/db/datastoreobjectlist.h +++ b/src/misc/db/datastoreobjectlist.h @@ -241,22 +241,17 @@ namespace swift::misc::db //! Any object without key? bool containsAnyObjectWithoutKey() const { - for (const OBJ &obj : ITimestampObjectList::container()) - { - if (!obj.hasValidDbKey()) { return true; } - } - return false; + return std::any_of(ITimestampObjectList::container().cbegin(), + ITimestampObjectList::container().cend(), + [](const OBJ &obj) { return !obj.hasValidDbKey(); }); } //! Contains object with key? bool containsDbKey(KEYTYPE key) const { - for (const OBJ &obj : ITimestampObjectList::container()) - { - if (!obj.hasValidDbKey()) { continue; } - if (obj.getDbKey() == key) { return true; } - } - return false; + return std::any_of(ITimestampObjectList::container().cbegin(), + ITimestampObjectList::container().cend(), + [&](const OBJ &obj) { return obj.hasValidDbKey() && obj.getDbKey() == key; }); } //! From multiple JSON formats diff --git a/src/misc/directoryutils.cpp b/src/misc/directoryutils.cpp index f6fe8388f8..ddd63941bf 100644 --- a/src/misc/directoryutils.cpp +++ b/src/misc/directoryutils.cpp @@ -58,12 +58,10 @@ namespace swift::misc if (!recursively) { return false; } const QStringList relSubDirs = CDirectoryUtils::getRelativeSubDirectories(dir); - for (const QString &relSubDir : relSubDirs) - { + return std::any_of(relSubDirs.cbegin(), relSubDirs.cend(), [&](const QString &relSubDir) { const QString absSubDir = CFileUtils::appendFilePaths(directory.absolutePath(), relSubDir); - if (CDirectoryUtils::containsFileInDir(absSubDir, filter, recursively)) { return true; } - } - return false; + return CDirectoryUtils::containsFileInDir(absSubDir, filter, recursively); + }); } bool CDirectoryUtils::existsUnemptyDirectory(const QString &testDir) diff --git a/src/misc/fileutils.cpp b/src/misc/fileutils.cpp index 3de0074bf3..c88714f87a 100644 --- a/src/misc/fileutils.cpp +++ b/src/misc/fileutils.cpp @@ -217,11 +217,8 @@ namespace swift::misc int d2 = 0; dirs1Cleaned.sort(cs); dirs2Cleaned.sort(cs); - for (const QString &d1 : dirs1) - { - if (!stringCompare(d1, dirs2.at(d2), cs)) { return false; } - } - return true; + return std::all_of(dirs1.cbegin(), dirs1.cend(), + [&](const QString &d1) { return stringCompare(d1, dirs2.at(d2), cs); }); } Qt::CaseSensitivity CFileUtils::osFileNameCaseSensitivity() @@ -258,11 +255,8 @@ namespace swift::misc Qt::CaseSensitivity cs) { if (excludeDirectories.isEmpty()) { return false; } - for (const QString &ex : excludeDirectories) - { - if (matchesExcludeDirectory(directoryPath, ex, cs)) { return true; } - } - return false; + return std::any_of(excludeDirectories.cbegin(), excludeDirectories.cend(), + [&](const QString &ex) { return matchesExcludeDirectory(directoryPath, ex, cs); }); } QStringList CFileUtils::removeSubDirectories(const QStringList &directories, Qt::CaseSensitivity cs) diff --git a/src/misc/network/rolelist.cpp b/src/misc/network/rolelist.cpp index 0f0979486b..033c62494b 100644 --- a/src/misc/network/rolelist.cpp +++ b/src/misc/network/rolelist.cpp @@ -20,11 +20,7 @@ namespace swift::misc::network bool CRoleList::hasAnyRole(const QStringList &roles) const { - for (const QString &r : roles) - { - if (this->hasRole(r)) { return true; } - } - return false; + return std::any_of(roles.cbegin(), roles.cend(), [&](const QString &r) { return this->hasRole(r); }); } CRoleList::CRoleList(const CSequence &other) : CSequence(other) {} diff --git a/src/misc/network/serverlist.cpp b/src/misc/network/serverlist.cpp index 2d7b292242..b7519daef8 100644 --- a/src/misc/network/serverlist.cpp +++ b/src/misc/network/serverlist.cpp @@ -11,11 +11,7 @@ namespace swift::misc::network bool CServerList::containsName(const QString &name) const { - for (const CServer &s : *this) - { - if (s.matchesName(name)) { return true; } - } - return false; + return std::any_of(cbegin(), cend(), [&](const CServer &s) { return s.matchesName(name); }); } bool CServerList::removeByName(const QString &name) @@ -39,11 +35,7 @@ namespace swift::misc::network bool CServerList::containsAddressPort(const CServer &server) { - for (const CServer &s : *this) - { - if (s.matchesAddressPort(server)) { return true; } - } - return false; + return std::any_of(cbegin(), cend(), [&](const CServer &s) { return s.matchesAddressPort(server); }); } void CServerList::addIfAddressNotExists(const CServer &server) diff --git a/src/misc/orderablelist.h b/src/misc/orderablelist.h index 3bbc5297b8..10d1f77b38 100644 --- a/src/misc/orderablelist.h +++ b/src/misc/orderablelist.h @@ -40,11 +40,8 @@ namespace swift::misc //! All order values set or missing some? bool needsOrder() const { - for (const OBJ &obj : container()) - { - if (!obj.hasValidOrder()) { return true; } - } - return false; + return std::any_of(this->container().begin(), this->container().end(), + [](const OBJ &obj) { return !obj.hasValidOrder(); }); } //! All order values IOrderable::order diff --git a/src/misc/pq/measurementunit.h b/src/misc/pq/measurementunit.h index 41b68070b9..d69ee857e6 100644 --- a/src/misc/pq/measurementunit.h +++ b/src/misc/pq/measurementunit.h @@ -443,11 +443,9 @@ namespace swift::misc::physical_quantities static bool isValidUnitSymbol(const QString &symbol, Qt::CaseSensitivity caseSensitivity) { if (symbol.isEmpty()) return false; - for (const auto &unit : U::allUnits()) - { - if (stringCompare(unit.getSymbol(), symbol, caseSensitivity)) { return true; } - } - return false; + return std::any_of(U::allUnits().cbegin(), U::allUnits().cend(), [&](const auto &unit) { + return stringCompare(unit.getSymbol(), symbol, caseSensitivity); + }); } /*! @@ -477,11 +475,8 @@ namespace swift::misc::physical_quantities Qt::CaseSensitivity caseSensitivity = Qt::CaseSensitive) { if (candidate.isEmpty()) return false; - for (const auto &unit : U::allUnits()) - { - if (candidate.endsWith(unit.getSymbol(), caseSensitivity)) { return true; } - } - return false; + return std::any_of(U::allUnits().cbegin(), U::allUnits().cend(), + [&](const auto &unit) { return candidate.endsWith(unit.getSymbol(), caseSensitivity); }); } //! Dimensionless unit diff --git a/src/misc/simulation/aircraftmodellist.cpp b/src/misc/simulation/aircraftmodellist.cpp index f6c766f5da..3acdad57e1 100644 --- a/src/misc/simulation/aircraftmodellist.cpp +++ b/src/misc/simulation/aircraftmodellist.cpp @@ -40,22 +40,18 @@ namespace swift::misc::simulation bool CAircraftModelList::containsModelString(const QString &modelString, Qt::CaseSensitivity sensitivity) const { - for (const CAircraftModel &model : (*this)) - { - if (model.matchesModelString(modelString, sensitivity)) { return true; } - } - return false; + return std::any_of(cbegin(), cend(), [&](const CAircraftModel &model) { + return model.matchesModelString(modelString, sensitivity); + }); } bool CAircraftModelList::containsModelStringOrDbKey(const CAircraftModel &model, Qt::CaseSensitivity sensitivity) const { - for (const CAircraftModel &m : (*this)) - { - if (m.hasValidDbKey() && m.getDbKey() == model.getDbKey()) { return true; } - if (m.matchesModelString(model.getModelString(), sensitivity)) { return true; } - } - return false; + return std::any_of(cbegin(), cend(), [&](const CAircraftModel &m) { + return (m.hasValidDbKey() && m.getDbKey() == model.getDbKey()) || + m.matchesModelString(model.getModelString(), sensitivity); + }); } bool CAircraftModelList::containsCallsign(const CCallsign &callsign) const diff --git a/src/misc/simulation/distributorlist.cpp b/src/misc/simulation/distributorlist.cpp index 031ba01fda..7801f272a3 100644 --- a/src/misc/simulation/distributorlist.cpp +++ b/src/misc/simulation/distributorlist.cpp @@ -72,11 +72,8 @@ namespace swift::misc::simulation bool CDistributorList::matchesAnyKeyOrAlias(const QString &keyOrAlias) const { - for (const CDistributor &distributor : (*this)) - { - if (distributor.matchesKeyOrAlias(keyOrAlias)) { return true; } - } - return false; + return std::any_of(cbegin(), cend(), + [&](const CDistributor &distributor) { return distributor.matchesKeyOrAlias(keyOrAlias); }); } QStringList CDistributorList::getDbKeysAndAliases(bool sort) const diff --git a/src/misc/simulation/fscommon/aircraftcfgentrieslist.cpp b/src/misc/simulation/fscommon/aircraftcfgentrieslist.cpp index 44eb426334..44468dc0e9 100644 --- a/src/misc/simulation/fscommon/aircraftcfgentrieslist.cpp +++ b/src/misc/simulation/fscommon/aircraftcfgentrieslist.cpp @@ -66,11 +66,9 @@ namespace swift::misc::simulation::fscommon bool CAircraftCfgEntriesList::containsTitle(const QString &title) const { if (title.isEmpty()) { return false; } - for (const CAircraftCfgEntries &entries : (*this)) - { - if (stringCompare(entries.getTitle(), title, Qt::CaseInsensitive)) { return true; } - } - return false; + return std::any_of(cbegin(), cend(), [&](const CAircraftCfgEntries &entries) { + return stringCompare(entries.getTitle(), title, Qt::CaseInsensitive); + }); } CAircraftModelList CAircraftCfgEntriesList::toAircraftModelList(bool ignoreDuplicatesAndEmptyModelStrings, diff --git a/src/misc/simulation/interpolation/interpolationsetupprovider.cpp b/src/misc/simulation/interpolation/interpolationsetupprovider.cpp index 4f326e9e41..8075b1891a 100644 --- a/src/misc/simulation/interpolation/interpolationsetupprovider.cpp +++ b/src/misc/simulation/interpolation/interpolationsetupprovider.cpp @@ -178,11 +178,9 @@ namespace swift::misc::simulation { const SetupsPerCallsign setupsCopy = this->getSetupsPerCallsign(); if (setupsCopy.isEmpty()) { return false; } - for (const CInterpolationAndRenderingSetupPerCallsign &setup : setupsCopy) - { - if (setup.logInterpolation()) { return true; } - } - return false; + return std::any_of( + setupsCopy.cbegin(), setupsCopy.cend(), + [](const CInterpolationAndRenderingSetupPerCallsign &setup) { return setup.logInterpolation(); }); } IInterpolationSetupProvider::SetupsPerCallsign IInterpolationSetupProvider::getSetupsPerCallsign() const diff --git a/src/misc/timestampobjectlist.h b/src/misc/timestampobjectlist.h index c8c6e2f25a..b157fe0335 100644 --- a/src/misc/timestampobjectlist.h +++ b/src/misc/timestampobjectlist.h @@ -458,21 +458,15 @@ namespace swift::misc //! Any negative or zero offset time? bool containsZeroOrNegativeOffsetTime() const { - for (const ITimestampWithOffsetBased &obj : this->container()) - { - if (obj.getTimeOffsetMs() <= 0) { return true; } - } - return false; + return std::any_of(this->container().begin(), this->container().end(), + [](const ITimestampWithOffsetBased &obj) { return obj.getTimeOffsetMs() <= 0; }); } //! Any negative offset time? bool containsNegativeOffsetTime() const { - for (const ITimestampWithOffsetBased &obj : this->container()) - { - if (obj.getTimeOffsetMs() < 0) { return true; } - } - return false; + return std::any_of(this->container().begin(), this->container().end(), + [](const ITimestampWithOffsetBased &obj) { return obj.getTimeOffsetMs() < 0; }); } //! Adds a time to all offset values From fc540236441ab8e827ae6fe144841e8a2d87b849 Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Sat, 25 Oct 2025 17:08:05 +0200 Subject: [PATCH 14/21] refactor: Fix readability-redundant-member-init warning --- .clang-tidy | 1 + src/core/fsd/addatc.cpp | 2 -- src/core/fsd/addatc.h | 2 +- src/core/fsd/addpilot.h | 2 +- src/core/fsd/atcdataupdate.cpp | 2 -- src/core/fsd/atcdataupdate.h | 2 +- src/core/fsd/authchallenge.cpp | 2 -- src/core/fsd/authchallenge.h | 2 +- src/core/fsd/authresponse.cpp | 2 -- src/core/fsd/authresponse.h | 2 +- src/core/fsd/clientidentification.cpp | 2 -- src/core/fsd/clientidentification.h | 2 +- src/core/fsd/clientquery.cpp | 2 -- src/core/fsd/clientquery.h | 2 +- src/core/fsd/deleteatc.cpp | 2 -- src/core/fsd/deleteatc.h | 2 +- src/core/fsd/deletepilot.cpp | 2 -- src/core/fsd/deletepilot.h | 2 +- src/core/fsd/fsdidentification.cpp | 2 -- src/core/fsd/fsdidentification.h | 2 +- src/core/fsd/interimpilotdataupdate.cpp | 2 -- src/core/fsd/interimpilotdataupdate.h | 2 +- src/core/fsd/killrequest.cpp | 2 -- src/core/fsd/killrequest.h | 2 +- src/core/fsd/pilotdataupdate.cpp | 2 -- src/core/fsd/pilotdataupdate.h | 2 +- src/core/fsd/ping.cpp | 2 -- src/core/fsd/ping.h | 2 +- src/core/fsd/planeinforequest.cpp | 2 -- src/core/fsd/planeinforequest.h | 2 +- src/core/fsd/planeinforequestfsinn.cpp | 2 -- src/core/fsd/planeinforequestfsinn.h | 2 +- src/core/fsd/planeinformation.cpp | 2 -- src/core/fsd/planeinformation.h | 2 +- src/core/fsd/planeinformationfsinn.cpp | 2 -- src/core/fsd/planeinformationfsinn.h | 2 +- src/core/fsd/pong.cpp | 2 -- src/core/fsd/pong.h | 2 +- src/core/fsd/rehost.cpp | 2 -- src/core/fsd/rehost.h | 2 +- src/core/fsd/textmessage.cpp | 2 -- src/core/fsd/textmessage.h | 2 +- src/core/fsd/visualpilotdataperiodic.cpp | 2 -- src/core/fsd/visualpilotdataperiodic.h | 2 +- src/core/fsd/visualpilotdatastopped.cpp | 2 -- src/core/fsd/visualpilotdatastopped.h | 2 +- src/core/fsd/visualpilotdatatoggle.cpp | 2 -- src/core/fsd/visualpilotdatatoggle.h | 2 +- src/core/fsd/visualpilotdataupdate.cpp | 2 -- src/core/fsd/visualpilotdataupdate.h | 2 +- src/core/simulator.cpp | 2 +- src/gui/components/simulatorcomponent.cpp | 3 +-- src/gui/components/usercomponent.cpp | 3 +-- src/misc/network/urllog.cpp | 5 +---- src/misc/simulation/remoteaircraftprovider.cpp | 4 +--- 55 files changed, 31 insertions(+), 85 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 6b2e383ade..57efd7d150 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -44,6 +44,7 @@ Checks: > modernize-use-using, readability-use-std-min-max, readability-use-anyofallof, + readability-redundant-member-init, CheckOptions: - key: readability-identifier-naming.ClassCase diff --git a/src/core/fsd/addatc.cpp b/src/core/fsd/addatc.cpp index b4bf6552af..42dde8d35d 100644 --- a/src/core/fsd/addatc.cpp +++ b/src/core/fsd/addatc.cpp @@ -8,8 +8,6 @@ namespace swift::core::fsd { - AddAtc::AddAtc() : MessageBase() {} - AddAtc::AddAtc(const QString &callsign, const QString &realName, const QString &cid, const QString &password, AtcRating rating, int protocolRevision) : MessageBase(callsign, "SERVER"), m_cid(cid), m_password(password), m_rating(rating), diff --git a/src/core/fsd/addatc.h b/src/core/fsd/addatc.h index c1bb25b794..118c2a2a5c 100644 --- a/src/core/fsd/addatc.h +++ b/src/core/fsd/addatc.h @@ -47,7 +47,7 @@ namespace swift::core::fsd QString realName() const { return m_realName; } private: - AddAtc(); + AddAtc() = default; QString m_cid; QString m_password; diff --git a/src/core/fsd/addpilot.h b/src/core/fsd/addpilot.h index 1957d1231a..8c6ca58c5e 100644 --- a/src/core/fsd/addpilot.h +++ b/src/core/fsd/addpilot.h @@ -50,7 +50,7 @@ namespace swift::core::fsd static QString pdu() { return "#AP"; } private: - AddPilot() : MessageBase() {} + AddPilot() = default; QString m_cid; QString m_password; diff --git a/src/core/fsd/atcdataupdate.cpp b/src/core/fsd/atcdataupdate.cpp index 7a482119bf..b666ba1372 100644 --- a/src/core/fsd/atcdataupdate.cpp +++ b/src/core/fsd/atcdataupdate.cpp @@ -11,8 +11,6 @@ using namespace swift::misc::network; namespace swift::core::fsd { - AtcDataUpdate::AtcDataUpdate() : MessageBase() {} - AtcDataUpdate::AtcDataUpdate(const QString &sender, int frequencykHz, CFacilityType facility, int visibleRange, AtcRating rating, double latitude, double longitude, int elevation) : MessageBase(sender, {}), m_frequencykHz(frequencykHz), m_facility(facility), m_visibleRange(visibleRange), diff --git a/src/core/fsd/atcdataupdate.h b/src/core/fsd/atcdataupdate.h index 023006f4fa..637f5ec7fd 100644 --- a/src/core/fsd/atcdataupdate.h +++ b/src/core/fsd/atcdataupdate.h @@ -46,7 +46,7 @@ namespace swift::core::fsd private: //! Ctor - AtcDataUpdate(); + AtcDataUpdate() = default; }; //! Equal to operator diff --git a/src/core/fsd/authchallenge.cpp b/src/core/fsd/authchallenge.cpp index a4d05d9667..efbe4499e1 100644 --- a/src/core/fsd/authchallenge.cpp +++ b/src/core/fsd/authchallenge.cpp @@ -7,8 +7,6 @@ namespace swift::core::fsd { - AuthChallenge::AuthChallenge() : MessageBase() {} - AuthChallenge::AuthChallenge(const QString &sender, const QString &target, const QString &challengeKey) : MessageBase(sender, target), m_challengeKey(challengeKey) {} diff --git a/src/core/fsd/authchallenge.h b/src/core/fsd/authchallenge.h index 460219ef64..4f13a38d2c 100644 --- a/src/core/fsd/authchallenge.h +++ b/src/core/fsd/authchallenge.h @@ -30,7 +30,7 @@ namespace swift::core::fsd private: //! Ctor - AuthChallenge(); + AuthChallenge() = default; }; //! Equal to operator diff --git a/src/core/fsd/authresponse.cpp b/src/core/fsd/authresponse.cpp index e1859c961e..94895c50a4 100644 --- a/src/core/fsd/authresponse.cpp +++ b/src/core/fsd/authresponse.cpp @@ -7,8 +7,6 @@ namespace swift::core::fsd { - AuthResponse::AuthResponse() : MessageBase() {} - AuthResponse::AuthResponse(const QString &sender, const QString &receiver, const QString &response) : MessageBase(sender, receiver), m_response(response) {} diff --git a/src/core/fsd/authresponse.h b/src/core/fsd/authresponse.h index 60b2f85230..fe702e806c 100644 --- a/src/core/fsd/authresponse.h +++ b/src/core/fsd/authresponse.h @@ -30,7 +30,7 @@ namespace swift::core::fsd QString m_response; //!< response private: - AuthResponse(); + AuthResponse() = default; }; //! Equal to operator diff --git a/src/core/fsd/clientidentification.cpp b/src/core/fsd/clientidentification.cpp index e17c7aa7c7..81ecc899fd 100644 --- a/src/core/fsd/clientidentification.cpp +++ b/src/core/fsd/clientidentification.cpp @@ -7,8 +7,6 @@ namespace swift::core::fsd { - ClientIdentification::ClientIdentification() : MessageBase() {} - ClientIdentification::ClientIdentification(const QString &sender, quint16 clientId, const QString &clientName, int clientVersionMajor, int clientVersionMinor, const QString &userCid, const QString &sysUid, const QString &initialChallenge) diff --git a/src/core/fsd/clientidentification.h b/src/core/fsd/clientidentification.h index 21398a1e14..4fcf32edc3 100644 --- a/src/core/fsd/clientidentification.h +++ b/src/core/fsd/clientidentification.h @@ -43,7 +43,7 @@ namespace swift::core::fsd //! @} private: - ClientIdentification(); + ClientIdentification() = default; }; //! Equal to operator diff --git a/src/core/fsd/clientquery.cpp b/src/core/fsd/clientquery.cpp index c8b412d5ea..1cd6d333f7 100644 --- a/src/core/fsd/clientquery.cpp +++ b/src/core/fsd/clientquery.cpp @@ -8,8 +8,6 @@ namespace swift::core::fsd { - ClientQuery::ClientQuery() : MessageBase() {} - ClientQuery::ClientQuery(const QString &sender, const QString &clientToBeQueried, ClientQueryType queryType, const QStringList &queryData) : MessageBase(sender, clientToBeQueried), m_queryType(queryType), m_queryData(queryData) diff --git a/src/core/fsd/clientquery.h b/src/core/fsd/clientquery.h index c83be9d761..a021955b03 100644 --- a/src/core/fsd/clientquery.h +++ b/src/core/fsd/clientquery.h @@ -40,7 +40,7 @@ namespace swift::core::fsd //! @} private: - ClientQuery(); + ClientQuery() = default; }; //! Equal to operator diff --git a/src/core/fsd/deleteatc.cpp b/src/core/fsd/deleteatc.cpp index 2577b03dae..4b9c40b8e7 100644 --- a/src/core/fsd/deleteatc.cpp +++ b/src/core/fsd/deleteatc.cpp @@ -7,8 +7,6 @@ namespace swift::core::fsd { - DeleteAtc::DeleteAtc() : MessageBase() {} - DeleteAtc::DeleteAtc(const QString &sender, const QString &cid) : MessageBase(sender), m_cid(cid) {} QStringList DeleteAtc::toTokens() const diff --git a/src/core/fsd/deleteatc.h b/src/core/fsd/deleteatc.h index 3ac1cc0948..98148110d0 100644 --- a/src/core/fsd/deleteatc.h +++ b/src/core/fsd/deleteatc.h @@ -29,7 +29,7 @@ namespace swift::core::fsd QString m_cid; //!< id private: - DeleteAtc(); + DeleteAtc() = default; }; //! Equal to operator diff --git a/src/core/fsd/deletepilot.cpp b/src/core/fsd/deletepilot.cpp index 8995ed7915..f6810c8b48 100644 --- a/src/core/fsd/deletepilot.cpp +++ b/src/core/fsd/deletepilot.cpp @@ -9,8 +9,6 @@ using namespace swift::misc; namespace swift::core::fsd { - DeletePilot::DeletePilot() : MessageBase() {} - DeletePilot::DeletePilot(const QString &callsign, const QString &id) : MessageBase(callsign), m_cid(id) {} QStringList DeletePilot::toTokens() const diff --git a/src/core/fsd/deletepilot.h b/src/core/fsd/deletepilot.h index 736796938d..1c666818f6 100644 --- a/src/core/fsd/deletepilot.h +++ b/src/core/fsd/deletepilot.h @@ -31,7 +31,7 @@ namespace swift::core::fsd private: //! Ctor - DeletePilot(); + DeletePilot() = default; }; //! Equal to operator diff --git a/src/core/fsd/fsdidentification.cpp b/src/core/fsd/fsdidentification.cpp index 2b58b38a47..4e273c704a 100644 --- a/src/core/fsd/fsdidentification.cpp +++ b/src/core/fsd/fsdidentification.cpp @@ -7,8 +7,6 @@ namespace swift::core::fsd { - FSDIdentification::FSDIdentification() : MessageBase() {} - FSDIdentification::FSDIdentification(const QString &callsign, const QString &receiver, const QString &serverVersion, const QString &initialChallenge) : MessageBase(callsign, receiver), m_serverVersion(serverVersion), m_initialChallenge(initialChallenge) diff --git a/src/core/fsd/fsdidentification.h b/src/core/fsd/fsdidentification.h index 277ab090db..f74b968200 100644 --- a/src/core/fsd/fsdidentification.h +++ b/src/core/fsd/fsdidentification.h @@ -34,7 +34,7 @@ namespace swift::core::fsd //! @} private: - FSDIdentification(); + FSDIdentification() = default; }; } // namespace swift::core::fsd diff --git a/src/core/fsd/interimpilotdataupdate.cpp b/src/core/fsd/interimpilotdataupdate.cpp index a9ace13cc6..2f704ed328 100644 --- a/src/core/fsd/interimpilotdataupdate.cpp +++ b/src/core/fsd/interimpilotdataupdate.cpp @@ -8,8 +8,6 @@ namespace swift::core::fsd { - InterimPilotDataUpdate::InterimPilotDataUpdate() : MessageBase() {} - InterimPilotDataUpdate::InterimPilotDataUpdate(const QString &sender, const QString &receiver, double latitude, double longitude, int altitudeTrue, int groundSpeed, double pitch, double bank, double heading, bool onGround) diff --git a/src/core/fsd/interimpilotdataupdate.h b/src/core/fsd/interimpilotdataupdate.h index 42f5900d55..411aa02996 100644 --- a/src/core/fsd/interimpilotdataupdate.h +++ b/src/core/fsd/interimpilotdataupdate.h @@ -42,7 +42,7 @@ namespace swift::core::fsd //! @} private: - InterimPilotDataUpdate(); + InterimPilotDataUpdate() = default; }; //! Equal to operator diff --git a/src/core/fsd/killrequest.cpp b/src/core/fsd/killrequest.cpp index ad05a9ff1f..fbadf0504f 100644 --- a/src/core/fsd/killrequest.cpp +++ b/src/core/fsd/killrequest.cpp @@ -7,8 +7,6 @@ namespace swift::core::fsd { - KillRequest::KillRequest() : MessageBase() {} - KillRequest::KillRequest(const QString &callsign, const QString &receiver, const QString &reason) : MessageBase(callsign, receiver), m_reason(reason) {} diff --git a/src/core/fsd/killrequest.h b/src/core/fsd/killrequest.h index d54d7b04dd..57be64f784 100644 --- a/src/core/fsd/killrequest.h +++ b/src/core/fsd/killrequest.h @@ -30,7 +30,7 @@ namespace swift::core::fsd QString m_reason; //!< reason for kill request/kicked private: - KillRequest(); + KillRequest() = default; }; //! Equal to operator diff --git a/src/core/fsd/pilotdataupdate.cpp b/src/core/fsd/pilotdataupdate.cpp index 51dd63c619..905dcf4a8c 100644 --- a/src/core/fsd/pilotdataupdate.cpp +++ b/src/core/fsd/pilotdataupdate.cpp @@ -12,8 +12,6 @@ using namespace swift::misc::aviation; namespace swift::core::fsd { - PilotDataUpdate::PilotDataUpdate() : MessageBase() {} - PilotDataUpdate::PilotDataUpdate(CTransponder::TransponderMode transponderMode, const QString &sender, int transponderCode, PilotRating rating, double latitude, double longitude, int altitudeTrue, int altitudePressure, int groundSpeed, double pitch, double bank, diff --git a/src/core/fsd/pilotdataupdate.h b/src/core/fsd/pilotdataupdate.h index 5b811831a1..ea53f4d5e9 100644 --- a/src/core/fsd/pilotdataupdate.h +++ b/src/core/fsd/pilotdataupdate.h @@ -49,7 +49,7 @@ namespace swift::core::fsd //! @} private: - PilotDataUpdate(); + PilotDataUpdate() = default; }; //! Equal to operator diff --git a/src/core/fsd/ping.cpp b/src/core/fsd/ping.cpp index c3c2f776f4..49774ded4b 100644 --- a/src/core/fsd/ping.cpp +++ b/src/core/fsd/ping.cpp @@ -7,8 +7,6 @@ namespace swift::core::fsd { - Ping::Ping() : MessageBase() {} - Ping::Ping(const QString &sender, const QString &receiver, const QString ×tamp) : MessageBase(sender, receiver), m_timestamp(timestamp) {} diff --git a/src/core/fsd/ping.h b/src/core/fsd/ping.h index 6d3d190239..ba5270b639 100644 --- a/src/core/fsd/ping.h +++ b/src/core/fsd/ping.h @@ -29,7 +29,7 @@ namespace swift::core::fsd QString m_timestamp; //!< timestamp private: - Ping(); + Ping() = default; }; //! Equal to operator diff --git a/src/core/fsd/planeinforequest.cpp b/src/core/fsd/planeinforequest.cpp index ea2adbb1c4..adc0d29ae2 100644 --- a/src/core/fsd/planeinforequest.cpp +++ b/src/core/fsd/planeinforequest.cpp @@ -7,8 +7,6 @@ namespace swift::core::fsd { - PlaneInfoRequest::PlaneInfoRequest() : MessageBase() {} - PlaneInfoRequest::PlaneInfoRequest(const QString &sender, const QString &receiver) : MessageBase(sender, receiver) {} diff --git a/src/core/fsd/planeinforequest.h b/src/core/fsd/planeinforequest.h index 3693ec753d..a4c624cfe7 100644 --- a/src/core/fsd/planeinforequest.h +++ b/src/core/fsd/planeinforequest.h @@ -28,7 +28,7 @@ namespace swift::core::fsd static QString pdu() { return QStringLiteral("#SB"); } private: - PlaneInfoRequest(); + PlaneInfoRequest() = default; }; //! Equal to operator diff --git a/src/core/fsd/planeinforequestfsinn.cpp b/src/core/fsd/planeinforequestfsinn.cpp index 8d07f982e9..e1d69ccacc 100644 --- a/src/core/fsd/planeinforequestfsinn.cpp +++ b/src/core/fsd/planeinforequestfsinn.cpp @@ -7,8 +7,6 @@ namespace swift::core::fsd { - PlaneInfoRequestFsinn::PlaneInfoRequestFsinn() : MessageBase() {} - PlaneInfoRequestFsinn::PlaneInfoRequestFsinn(const QString &sender, const QString &receiver, const QString &airlineIcao, const QString &aircraftIcao, const QString &aircraftIcaoCombinedType, diff --git a/src/core/fsd/planeinforequestfsinn.h b/src/core/fsd/planeinforequestfsinn.h index 014bfcad23..bee865160e 100644 --- a/src/core/fsd/planeinforequestfsinn.h +++ b/src/core/fsd/planeinforequestfsinn.h @@ -37,7 +37,7 @@ namespace swift::core::fsd //! @} private: - PlaneInfoRequestFsinn(); + PlaneInfoRequestFsinn() = default; }; //! Equal to operator diff --git a/src/core/fsd/planeinformation.cpp b/src/core/fsd/planeinformation.cpp index 0856324ec3..c296bb9875 100644 --- a/src/core/fsd/planeinformation.cpp +++ b/src/core/fsd/planeinformation.cpp @@ -7,8 +7,6 @@ namespace swift::core::fsd { - PlaneInformation::PlaneInformation() : MessageBase() {} - PlaneInformation::PlaneInformation(const QString &sender, const QString &receiver, const QString &aircraft, const QString &airline = QString(), const QString &livery = QString()) : MessageBase(sender, receiver), m_aircraft(aircraft), m_airline(airline), m_livery(livery) diff --git a/src/core/fsd/planeinformation.h b/src/core/fsd/planeinformation.h index 39d4611357..45d024a326 100644 --- a/src/core/fsd/planeinformation.h +++ b/src/core/fsd/planeinformation.h @@ -36,7 +36,7 @@ namespace swift::core::fsd //! @} private: - PlaneInformation(); + PlaneInformation() = default; }; //! Equal to operator diff --git a/src/core/fsd/planeinformationfsinn.cpp b/src/core/fsd/planeinformationfsinn.cpp index a618cc0077..1bcf87f6cf 100644 --- a/src/core/fsd/planeinformationfsinn.cpp +++ b/src/core/fsd/planeinformationfsinn.cpp @@ -7,8 +7,6 @@ namespace swift::core::fsd { - PlaneInformationFsinn::PlaneInformationFsinn() : MessageBase() {} - PlaneInformationFsinn::PlaneInformationFsinn(const QString &sender, const QString &receiver, const QString &airlineIcao, const QString &aircraftIcao, const QString &aircraftIcaoCombinedType, diff --git a/src/core/fsd/planeinformationfsinn.h b/src/core/fsd/planeinformationfsinn.h index 51d356464d..955a36fe6d 100644 --- a/src/core/fsd/planeinformationfsinn.h +++ b/src/core/fsd/planeinformationfsinn.h @@ -37,7 +37,7 @@ namespace swift::core::fsd //! @} private: - PlaneInformationFsinn(); + PlaneInformationFsinn() = default; }; //! Equal to operator diff --git a/src/core/fsd/pong.cpp b/src/core/fsd/pong.cpp index 1e1ef6a9c7..5c57305790 100644 --- a/src/core/fsd/pong.cpp +++ b/src/core/fsd/pong.cpp @@ -7,8 +7,6 @@ namespace swift::core::fsd { - Pong::Pong() : MessageBase() {} - Pong::Pong(const QString &sender, const QString &receiver, const QString ×tamp) : MessageBase(sender, receiver), m_timestamp(timestamp) {} diff --git a/src/core/fsd/pong.h b/src/core/fsd/pong.h index 9ad28b17b1..a3314108f3 100644 --- a/src/core/fsd/pong.h +++ b/src/core/fsd/pong.h @@ -29,7 +29,7 @@ namespace swift::core::fsd QString m_timestamp; //!< timestamp private: - Pong(); + Pong() = default; }; //! Equal to operator diff --git a/src/core/fsd/rehost.cpp b/src/core/fsd/rehost.cpp index e5bd207fb8..c30609232c 100644 --- a/src/core/fsd/rehost.cpp +++ b/src/core/fsd/rehost.cpp @@ -12,8 +12,6 @@ using namespace swift::misc::aviation; namespace swift::core::fsd { - Rehost::Rehost() : MessageBase() {} - Rehost::Rehost(const QString &sender, const QString &hostname) : MessageBase(sender, {}), m_hostname(hostname) {} QStringList Rehost::toTokens() const { return { m_sender, m_hostname }; } diff --git a/src/core/fsd/rehost.h b/src/core/fsd/rehost.h index 15db228c65..ab756d3c3e 100644 --- a/src/core/fsd/rehost.h +++ b/src/core/fsd/rehost.h @@ -33,7 +33,7 @@ namespace swift::core::fsd //! @} private: - Rehost(); + Rehost() = default; }; //! Equal to operator diff --git a/src/core/fsd/textmessage.cpp b/src/core/fsd/textmessage.cpp index c5da36a5af..190ad605af 100644 --- a/src/core/fsd/textmessage.cpp +++ b/src/core/fsd/textmessage.cpp @@ -7,8 +7,6 @@ namespace swift::core::fsd { - TextMessage::TextMessage() : MessageBase() {} - TextMessage::TextMessage(const QString &sender, const QString &receiver, const QString &message) : MessageBase(sender, receiver), m_message(message) { diff --git a/src/core/fsd/textmessage.h b/src/core/fsd/textmessage.h index e98fde22e0..a1448ac835 100644 --- a/src/core/fsd/textmessage.h +++ b/src/core/fsd/textmessage.h @@ -42,7 +42,7 @@ namespace swift::core::fsd QVector m_frequencies; //!< frequencies in case of radio message. private: - TextMessage(); + TextMessage() = default; }; } // namespace swift::core::fsd diff --git a/src/core/fsd/visualpilotdataperiodic.cpp b/src/core/fsd/visualpilotdataperiodic.cpp index cb1c8b4f3d..ad5b686c71 100644 --- a/src/core/fsd/visualpilotdataperiodic.cpp +++ b/src/core/fsd/visualpilotdataperiodic.cpp @@ -14,8 +14,6 @@ using namespace swift::misc::aviation; namespace swift::core::fsd { - VisualPilotDataPeriodic::VisualPilotDataPeriodic() : MessageBase() {} - VisualPilotDataPeriodic::VisualPilotDataPeriodic(const QString &sender, double latitude, double longitude, double altitudeTrue, double heightAgl, double pitch, double bank, double heading, double xVelocity, double yVelocity, diff --git a/src/core/fsd/visualpilotdataperiodic.h b/src/core/fsd/visualpilotdataperiodic.h index 56a5c3450c..d7b4476dfe 100644 --- a/src/core/fsd/visualpilotdataperiodic.h +++ b/src/core/fsd/visualpilotdataperiodic.h @@ -54,7 +54,7 @@ namespace swift::core::fsd //! @} private: - VisualPilotDataPeriodic(); + VisualPilotDataPeriodic() = default; }; //! Equal to operator diff --git a/src/core/fsd/visualpilotdatastopped.cpp b/src/core/fsd/visualpilotdatastopped.cpp index 9fb0a7d94f..5ef5597b5c 100644 --- a/src/core/fsd/visualpilotdatastopped.cpp +++ b/src/core/fsd/visualpilotdatastopped.cpp @@ -14,8 +14,6 @@ using namespace swift::misc::aviation; namespace swift::core::fsd { - VisualPilotDataStopped::VisualPilotDataStopped() : MessageBase() {} - VisualPilotDataStopped::VisualPilotDataStopped(const QString &sender, double latitude, double longitude, double altitudeTrue, double heightAgl, double pitch, double bank, double heading, double noseGearAngle) diff --git a/src/core/fsd/visualpilotdatastopped.h b/src/core/fsd/visualpilotdatastopped.h index 525a67bc5f..0bc3dc5203 100644 --- a/src/core/fsd/visualpilotdatastopped.h +++ b/src/core/fsd/visualpilotdatastopped.h @@ -46,7 +46,7 @@ namespace swift::core::fsd //! @} private: - VisualPilotDataStopped(); + VisualPilotDataStopped() = default; }; //! Equal to operator diff --git a/src/core/fsd/visualpilotdatatoggle.cpp b/src/core/fsd/visualpilotdatatoggle.cpp index 88ee70ba4f..4b5a2019c8 100644 --- a/src/core/fsd/visualpilotdatatoggle.cpp +++ b/src/core/fsd/visualpilotdatatoggle.cpp @@ -13,8 +13,6 @@ using namespace swift::misc::aviation; namespace swift::core::fsd { - VisualPilotDataToggle::VisualPilotDataToggle() : MessageBase() {} - VisualPilotDataToggle::VisualPilotDataToggle(const QString &sender, const QString &client, bool active) : MessageBase(sender, {}), m_client(client), m_active(active) {} diff --git a/src/core/fsd/visualpilotdatatoggle.h b/src/core/fsd/visualpilotdatatoggle.h index 059437d790..db17b49b55 100644 --- a/src/core/fsd/visualpilotdatatoggle.h +++ b/src/core/fsd/visualpilotdatatoggle.h @@ -34,7 +34,7 @@ namespace swift::core::fsd //! @} private: - VisualPilotDataToggle(); + VisualPilotDataToggle() = default; }; //! Equal to operator diff --git a/src/core/fsd/visualpilotdataupdate.cpp b/src/core/fsd/visualpilotdataupdate.cpp index 1755f42101..ec5e450580 100644 --- a/src/core/fsd/visualpilotdataupdate.cpp +++ b/src/core/fsd/visualpilotdataupdate.cpp @@ -15,8 +15,6 @@ using namespace swift::misc::aviation; namespace swift::core::fsd { - VisualPilotDataUpdate::VisualPilotDataUpdate() : MessageBase() {} - VisualPilotDataUpdate::VisualPilotDataUpdate(const QString &sender, double latitude, double longitude, double altitudeTrue, double heightAgl, double pitch, double bank, double heading, double xVelocity, double yVelocity, double zVelocity, diff --git a/src/core/fsd/visualpilotdataupdate.h b/src/core/fsd/visualpilotdataupdate.h index 390103a0e3..4015776429 100644 --- a/src/core/fsd/visualpilotdataupdate.h +++ b/src/core/fsd/visualpilotdataupdate.h @@ -58,7 +58,7 @@ namespace swift::core::fsd //! @} // private: // not private: used in CFSDClient::handleVisualPilotDataUpdate - VisualPilotDataUpdate(); + VisualPilotDataUpdate() = default; }; //! Equal to operator diff --git a/src/core/simulator.cpp b/src/core/simulator.cpp index 830477929e..a65be0964d 100644 --- a/src/core/simulator.cpp +++ b/src/core/simulator.cpp @@ -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()); diff --git a/src/gui/components/simulatorcomponent.cpp b/src/gui/components/simulatorcomponent.cpp index 7a38bc8e51..047495f375 100644 --- a/src/gui/components/simulatorcomponent.cpp +++ b/src/gui/components/simulatorcomponent.cpp @@ -39,8 +39,7 @@ namespace swift::gui::components return cats; } - CSimulatorComponent::CSimulatorComponent(QWidget *parent) - : QTabWidget(parent), CEnableForDockWidgetInfoArea(), ui(new Ui::CSimulatorComponent) + CSimulatorComponent::CSimulatorComponent(QWidget *parent) : QTabWidget(parent), ui(new Ui::CSimulatorComponent) { Q_ASSERT_X(sGui, Q_FUNC_INFO, "Need sGui"); diff --git a/src/gui/components/usercomponent.cpp b/src/gui/components/usercomponent.cpp index 612cf329e7..f2cd2030b2 100644 --- a/src/gui/components/usercomponent.cpp +++ b/src/gui/components/usercomponent.cpp @@ -25,8 +25,7 @@ using namespace swift::core::context; namespace swift::gui::components { - CUserComponent::CUserComponent(QWidget *parent) - : QTabWidget(parent), CEnableForDockWidgetInfoArea(), ui(new Ui::CUserComponent) + CUserComponent::CUserComponent(QWidget *parent) : QTabWidget(parent), ui(new Ui::CUserComponent) { ui->setupUi(this); this->setCurrentIndex(0); diff --git a/src/misc/network/urllog.cpp b/src/misc/network/urllog.cpp index 04ee8a3e82..72dc8422ff 100644 --- a/src/misc/network/urllog.cpp +++ b/src/misc/network/urllog.cpp @@ -16,10 +16,7 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::misc::network, CUrlLog) namespace swift::misc::network { - CUrlLog::CUrlLog(const CUrl &url) : ITimestampBased(), m_id(uniqueId()), m_url(url) - { - ITimestampBased::setCurrentUtcTime(); - } + CUrlLog::CUrlLog(const CUrl &url) : m_id(uniqueId()), m_url(url) { ITimestampBased::setCurrentUtcTime(); } void CUrlLog::setResponseTimestampToNow() { diff --git a/src/misc/simulation/remoteaircraftprovider.cpp b/src/misc/simulation/remoteaircraftprovider.cpp index b3caf8e00b..7b12cb0b90 100644 --- a/src/misc/simulation/remoteaircraftprovider.cpp +++ b/src/misc/simulation/remoteaircraftprovider.cpp @@ -24,9 +24,7 @@ namespace swift::misc::simulation return cats; } - CRemoteAircraftProvider::CRemoteAircraftProvider(QObject *parent) - : QObject(parent), IRemoteAircraftProvider(), CIdentifiable(this) - {} + CRemoteAircraftProvider::CRemoteAircraftProvider(QObject *parent) : QObject(parent), CIdentifiable(this) {} CSimulatedAircraftList CRemoteAircraftProvider::getAircraftInRange() const { From 5eafb1282dfec629acad882528188079b478f8ea Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Sat, 25 Oct 2025 21:40:02 +0200 Subject: [PATCH 15/21] refactor: Fix cppcoreguidelines-init-variables warnings --- .clang-tidy | 1 + src/core/afv/audio/input.cpp | 2 +- src/core/context/contextapplicationproxy.h | 2 +- src/core/context/contextownaircraftimpl.cpp | 4 ++-- src/core/db/databaseutils.cpp | 2 +- src/core/db/databasewriter.cpp | 2 +- src/core/fsd/interimpilotdataupdate.cpp | 2 +- src/core/fsd/pilotdataupdate.cpp | 2 +- src/core/fsd/visualpilotdataperiodic.cpp | 2 +- src/core/fsd/visualpilotdatastopped.cpp | 2 +- src/core/fsd/visualpilotdataupdate.cpp | 2 +- src/core/setupreader.h | 2 +- src/core/simulator.cpp | 2 +- src/gui/components/atcstationcomponent.cpp | 3 ++- .../components/cockpittranspondermodeledscomponent.cpp | 2 +- .../components/dbautosimulatorstashingcomponent.cpp | 2 +- src/gui/components/dbmappingcomponent.cpp | 2 +- src/gui/components/hotkeydialog.cpp | 2 +- src/gui/components/rawfsdmessagescomponent.cpp | 2 +- src/gui/components/settingstextmessagestyle.cpp | 2 +- src/gui/components/textmessagecomponent.cpp | 7 +++++-- src/gui/editors/aircrafticaoform.cpp | 2 +- src/gui/editors/airlineicaoform.cpp | 4 ++-- src/gui/editors/coordinateform.cpp | 4 ++-- src/gui/editors/liveryform.cpp | 2 +- src/gui/editors/modelmappingform.cpp | 2 +- src/gui/editors/pbhsform.cpp | 6 +++--- src/gui/editors/situationform.cpp | 8 ++++---- src/gui/models/listmodelbasenontemplate.cpp | 2 +- src/gui/models/listmodelbasenontemplate.h | 4 ++-- src/misc/aviation/aircrafticaocode.cpp | 2 +- src/misc/aviation/altitude.cpp | 2 +- src/misc/aviation/callsign.cpp | 2 +- src/misc/aviation/callsignobjectlist.h | 2 +- src/misc/aviation/comsystem.cpp | 2 +- src/misc/aviation/flightplan.cpp | 4 ++-- src/misc/aviation/selcal.cpp | 5 ++++- src/misc/aviation/transponder.cpp | 4 ++-- src/misc/db/datastore.cpp | 4 ++-- src/misc/dbus.h | 2 +- src/misc/dbusserver.cpp | 4 ++-- src/misc/geo/earthangle.cpp | 4 ++-- src/misc/loghandler.cpp | 2 +- src/misc/logpattern.cpp | 4 ++-- src/misc/math/mathutils.cpp | 10 +++++----- src/misc/math/mathutils.h | 2 +- src/misc/network/networkutils.cpp | 2 +- src/misc/network/urlloglist.cpp | 2 +- src/misc/pq/pqstring.cpp | 2 +- src/misc/pq/time.cpp | 2 +- src/misc/propertyindex.cpp | 2 +- src/misc/simulation/simulationenvironmentprovider.cpp | 6 +++--- src/misc/timestampbased.h | 2 +- src/misc/variant.cpp | 2 +- src/misc/worker.h | 1 + .../simulator/flightgear/fgswiftbusserviceproxy.cpp | 2 +- .../simulator/flightgear/fgswiftbustrafficproxy.cpp | 2 +- src/plugins/simulator/xplane/simulatorxplane.cpp | 2 +- src/plugins/simulator/xplane/xswiftbusserviceproxy.cpp | 2 +- src/plugins/simulator/xplane/xswiftbustrafficproxy.cpp | 2 +- .../xplaneconfig/simulatorxplaneconfigwindow.cpp | 2 +- src/sound/codecs/opusdecoder.cpp | 2 +- src/sound/codecs/opusencoder.cpp | 2 +- src/sound/wav/wavfile.cpp | 4 ++-- src/sound/wav/wavfile.h | 2 +- 65 files changed, 95 insertions(+), 86 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 57efd7d150..e7c970cae4 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -45,6 +45,7 @@ Checks: > readability-use-std-min-max, readability-use-anyofallof, readability-redundant-member-init, + cppcoreguidelines-init-variables, CheckOptions: - key: readability-identifier-naming.ClassCase diff --git a/src/core/afv/audio/input.cpp b/src/core/afv/audio/input.cpp index 5a4893f1dd..a0c1d67e55 100644 --- a/src/core/afv/audio/input.cpp +++ b/src/core/afv/audio/input.cpp @@ -159,7 +159,7 @@ namespace swift::core::afv::audio m_maxSampleInput = qMax(qAbs(sampleInput), m_maxSampleInput); } - int length; + int length {}; const QByteArray encodedBuffer = m_encoder.encode(samples, samples.size(), &length); m_opusBytesEncoded += length; diff --git a/src/core/context/contextapplicationproxy.h b/src/core/context/contextapplicationproxy.h index 71773e6e63..a7b8267482 100644 --- a/src/core/context/contextapplicationproxy.h +++ b/src/core/context/contextapplicationproxy.h @@ -96,7 +96,7 @@ namespace swift::core protected: //! Constructor CContextApplicationProxy(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) - : IContextApplication(mode, runtime), m_dBusInterface(nullptr) + : IContextApplication(mode, runtime) {} //! DBus version constructor diff --git a/src/core/context/contextownaircraftimpl.cpp b/src/core/context/contextownaircraftimpl.cpp index 4b3191ff7c..a00a74c4b9 100644 --- a/src/core/context/contextownaircraftimpl.cpp +++ b/src/core/context/contextownaircraftimpl.cpp @@ -284,7 +284,7 @@ namespace swift::core::context { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << com1 << com2 << transponder; } - bool changed; + bool changed {}; { QWriteLocker l(&m_lockAircraft); changed = m_ownAircraft.hasChangedCockpitData(com1, com2, transponder); @@ -301,7 +301,7 @@ namespace swift::core::context { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << transponderMode; } - bool changed; + bool changed {}; { QWriteLocker l(&m_lockAircraft); changed = m_ownAircraft.setTransponderMode(transponderMode); diff --git a/src/core/db/databaseutils.cpp b/src/core/db/databaseutils.cpp index 505b152e57..a1c06c2628 100644 --- a/src/core/db/databaseutils.cpp +++ b/src/core/db/databaseutils.cpp @@ -425,7 +425,7 @@ namespace swift::core::db const int contentIndex = content.indexOf(':', cl); if (contentIndex < cl) break; // should not happen, malformed const QString ls = content.mid(cl, contentIndex - cl); // content length - bool ok; + bool ok {}; const qint32 size = ls.toInt(&ok); if (!ok) break; // malformed size if (size < 1) break; diff --git a/src/core/db/databasewriter.cpp b/src/core/db/databasewriter.cpp index 9ba63d3bbe..cd48853c31 100644 --- a/src/core/db/databasewriter.cpp +++ b/src/core/db/databasewriter.cpp @@ -172,7 +172,7 @@ namespace swift::core::db CAircraftModelList modelsPublished; CAircraftModelList modelsSkipped; CStatusMessageList msgs; - bool directWrite; + bool directWrite {}; const bool sendingSuccessful = parseSwiftPublishResponse(responseData, modelsPublished, modelsSkipped, msgs, directWrite); const int c = CDatabaseUtils::fillInMissingAircraftAndLiveryEntities(modelsPublished); diff --git a/src/core/fsd/interimpilotdataupdate.cpp b/src/core/fsd/interimpilotdataupdate.cpp index 2f704ed328..0ae9124268 100644 --- a/src/core/fsd/interimpilotdataupdate.cpp +++ b/src/core/fsd/interimpilotdataupdate.cpp @@ -17,7 +17,7 @@ namespace swift::core::fsd QStringList InterimPilotDataUpdate::toTokens() const { - std::uint32_t pbh; + std::uint32_t pbh {}; packPBH(m_pitch, m_bank, m_heading, m_onGround, pbh); auto tokens = QStringList {}; diff --git a/src/core/fsd/pilotdataupdate.cpp b/src/core/fsd/pilotdataupdate.cpp index 905dcf4a8c..8c8113c8db 100644 --- a/src/core/fsd/pilotdataupdate.cpp +++ b/src/core/fsd/pilotdataupdate.cpp @@ -24,7 +24,7 @@ namespace swift::core::fsd QStringList PilotDataUpdate::toTokens() const { - std::uint32_t pbh; + std::uint32_t pbh {}; packPBH(m_pitch, m_bank, m_heading, m_onGround, pbh); QStringList tokens; diff --git a/src/core/fsd/visualpilotdataperiodic.cpp b/src/core/fsd/visualpilotdataperiodic.cpp index ad5b686c71..5e209ca7d6 100644 --- a/src/core/fsd/visualpilotdataperiodic.cpp +++ b/src/core/fsd/visualpilotdataperiodic.cpp @@ -27,7 +27,7 @@ namespace swift::core::fsd QStringList VisualPilotDataPeriodic::toTokens() const { - std::uint32_t pbh; + std::uint32_t pbh {}; packPBH(m_pitch, m_bank, m_heading, false /*! \todo check if needed? */, pbh); QStringList tokens; diff --git a/src/core/fsd/visualpilotdatastopped.cpp b/src/core/fsd/visualpilotdatastopped.cpp index 5ef5597b5c..5af262df77 100644 --- a/src/core/fsd/visualpilotdatastopped.cpp +++ b/src/core/fsd/visualpilotdatastopped.cpp @@ -23,7 +23,7 @@ namespace swift::core::fsd QStringList VisualPilotDataStopped::toTokens() const { - std::uint32_t pbh; + std::uint32_t pbh {}; packPBH(m_pitch, m_bank, m_heading, false /*! \todo check if needed? */, pbh); QStringList tokens; diff --git a/src/core/fsd/visualpilotdataupdate.cpp b/src/core/fsd/visualpilotdataupdate.cpp index ec5e450580..740870c9e3 100644 --- a/src/core/fsd/visualpilotdataupdate.cpp +++ b/src/core/fsd/visualpilotdataupdate.cpp @@ -28,7 +28,7 @@ namespace swift::core::fsd QStringList VisualPilotDataUpdate::toTokens() const { - std::uint32_t pbh; + std::uint32_t pbh {}; packPBH(m_pitch, m_bank, m_heading, false /*! \todo check if needed? */, pbh); QStringList tokens; diff --git a/src/core/setupreader.h b/src/core/setupreader.h index c215845f5a..e298c11790 100644 --- a/src/core/setupreader.h +++ b/src/core/setupreader.h @@ -58,7 +58,7 @@ namespace swift::core private: std::atomic m_setupAvailable { false }; //!< setup available? - data::CGlobalSetup m_setup {}; //!< data setup + data::CGlobalSetup m_setup; //!< data setup //! Read by local file swift::misc::CStatusMessageList readLocalBootstrapFile(); diff --git a/src/core/simulator.cpp b/src/core/simulator.cpp index a65be0964d..202d184b55 100644 --- a/src/core/simulator.cpp +++ b/src/core/simulator.cpp @@ -333,7 +333,7 @@ namespace swift::core if (part2.startsWith("max")) { if (!parser.hasPart(3)) { return false; } - bool ok; + bool ok {}; const int max = parser.part(3).toInt(&ok); if (!ok) { return false; } m_interpolationLogger.setMaxSituations(max); diff --git a/src/gui/components/atcstationcomponent.cpp b/src/gui/components/atcstationcomponent.cpp index 683aac071b..d90e54ef72 100644 --- a/src/gui/components/atcstationcomponent.cpp +++ b/src/gui/components/atcstationcomponent.cpp @@ -450,7 +450,8 @@ namespace swift::gui::components m_splitterSizes = ui->sp_AtcSplitter->sizes(); if (m_splitterSizes.size() > 1) { - int min, max; + int min {}; + int max {}; ui->sp_AtcSplitter->getRange(1, &min, &max); QList newSizes; newSizes.push_back(qMax(0, m_splitterSizes.first() + m_splitterSizes.last() - min)); diff --git a/src/gui/components/cockpittranspondermodeledscomponent.cpp b/src/gui/components/cockpittranspondermodeledscomponent.cpp index 45a4d9e7ad..726f04a6c6 100644 --- a/src/gui/components/cockpittranspondermodeledscomponent.cpp +++ b/src/gui/components/cockpittranspondermodeledscomponent.cpp @@ -48,7 +48,7 @@ namespace swift::gui::components QWidget *w = qobject_cast(QObject::sender()); if (!w) { return; } if (!sGui || sGui->isShuttingDown() || !sGui->getIContextOwnAircraft()) { return; } - CTransponder::TransponderMode mode; + CTransponder::TransponderMode mode {}; if (m_ledStandby.data() == w) { mode = CTransponder::StateStandby; } else if (m_ledIdent.data() == w) { mode = CTransponder::StateIdent; } else if (m_ledModes.data() == w) { mode = CTransponder::ModeC; } diff --git a/src/gui/components/dbautosimulatorstashingcomponent.cpp b/src/gui/components/dbautosimulatorstashingcomponent.cpp index e52f4b67f1..7261c31879 100644 --- a/src/gui/components/dbautosimulatorstashingcomponent.cpp +++ b/src/gui/components/dbautosimulatorstashingcomponent.cpp @@ -129,7 +129,7 @@ namespace swift::gui::components int maxObjectsStashed = -1; if (!ui->le_MaxModelsStashed->text().isEmpty()) { - bool ok; + bool ok {}; ui->le_MaxModelsStashed->text().toInt(&ok); if (!ok) { maxObjectsStashed = 100; } } diff --git a/src/gui/components/dbmappingcomponent.cpp b/src/gui/components/dbmappingcomponent.cpp index 8f8732bda6..86dda8af1d 100644 --- a/src/gui/components/dbmappingcomponent.cpp +++ b/src/gui/components/dbmappingcomponent.cpp @@ -467,7 +467,7 @@ namespace swift::gui::components int currentSize = ui->sp_MappingComponent->sizes().last(); // current size if (h2 <= currentSize) { return; } - int h1; + int h1 {}; if (h * 0.90 > h2) { // enough space to display as whole diff --git a/src/gui/components/hotkeydialog.cpp b/src/gui/components/hotkeydialog.cpp index 54fb0abf0f..cc6d85ff0b 100644 --- a/src/gui/components/hotkeydialog.cpp +++ b/src/gui/components/hotkeydialog.cpp @@ -328,7 +328,7 @@ namespace swift::gui::components void CHotkeyDialog::clearAdvancedFrame() { QLayout *layout = ui->qf_Advanced->layout(); - QLayoutItem *child; + QLayoutItem *child {}; while ((child = layout->takeAt(0)) != nullptr) { diff --git a/src/gui/components/rawfsdmessagescomponent.cpp b/src/gui/components/rawfsdmessagescomponent.cpp index 81fdbe9d46..c51dd9a8bd 100644 --- a/src/gui/components/rawfsdmessagescomponent.cpp +++ b/src/gui/components/rawfsdmessagescomponent.cpp @@ -87,7 +87,7 @@ namespace swift::gui::components void CRawFsdMessagesComponent::enableDisableRawFsdMessages() { //! \fixme KB 2019-03 hardcoded style sheet - bool enable; + bool enable {}; if (ui->pb_EnableDisable->text() == "Enable") { enable = true; diff --git a/src/gui/components/settingstextmessagestyle.cpp b/src/gui/components/settingstextmessagestyle.cpp index 948fa593ea..1c34fd1193 100644 --- a/src/gui/components/settingstextmessagestyle.cpp +++ b/src/gui/components/settingstextmessagestyle.cpp @@ -117,7 +117,7 @@ namespace swift::gui::components const QStringList matches = match.capturedTexts(); if (matches.size() != 2) { return false; } - bool ok; + bool ok {}; int ptSize = matches.last().toInt(&ok); if (!ok) { return false; } if (increase) diff --git a/src/gui/components/textmessagecomponent.cpp b/src/gui/components/textmessagecomponent.cpp index a30f5f7af4..37b2a3fc30 100644 --- a/src/gui/components/textmessagecomponent.cpp +++ b/src/gui/components/textmessagecomponent.cpp @@ -484,7 +484,10 @@ namespace swift::gui::components auto *layout = new QVBoxLayout(newTabWidget); auto *textEdit = new CTextMessageTextEdit(newTabWidget); textEdit->setObjectName("tep_" + tabName); - int marginLeft, marginRight, marginTop, marginBottom; + int marginLeft {}; + int marginRight {}; + int marginTop {}; + int marginBottom {}; ui->tb_TextMessagesAll->layout()->getContentsMargins(&marginLeft, &marginTop, &marginRight, &marginBottom); newTabWidget->layout()->setContentsMargins(marginLeft, marginTop, marginRight, 2); layout->addWidget(textEdit); @@ -773,7 +776,7 @@ namespace swift::gui::components else { // not a standard channel - bool isNumber; + bool isNumber {}; const QString selectedTabText = firstPartOfTabText(ui->tw_TextMessages->tabText(index).trimmed()); const double frequency = selectedTabText.toDouble(&isNumber); if (isNumber) diff --git a/src/gui/editors/aircrafticaoform.cpp b/src/gui/editors/aircrafticaoform.cpp index fbef4b9c8f..2d2e57ef36 100644 --- a/src/gui/editors/aircrafticaoform.cpp +++ b/src/gui/editors/aircrafticaoform.cpp @@ -124,7 +124,7 @@ namespace swift::gui::editors const QString family(ui->le_Family->text().trimmed().toUpper()); const QString wtc(ui->cb_Wtc->currentText().left(1)); const QString combined(ui->combined_TypeSelector->getCombinedType()); - bool ok; + bool ok {}; int rank = ui->cb_Rank->currentText().toInt(&ok); if (!ok) { rank = 10; } bool legacy = ui->cb_Legacy->isChecked(); diff --git a/src/gui/editors/airlineicaoform.cpp b/src/gui/editors/airlineicaoform.cpp index e4aa5887da..6119593dc7 100644 --- a/src/gui/editors/airlineicaoform.cpp +++ b/src/gui/editors/airlineicaoform.cpp @@ -89,7 +89,7 @@ namespace swift::gui::editors const QString id = ui->le_Id->text(); if (sGui && !sGui->isShuttingDown() && sGui->hasWebDataServices()) { - bool ok; + bool ok {}; const int dbKey = id.toInt(&ok); if (ok) { code = sGui->getWebDataServices()->getAirlineIcaoCodeForDbKey(dbKey); } } @@ -188,7 +188,7 @@ namespace swift::gui::editors { if (!sGui || sGui->isShuttingDown() || !sGui->hasWebDataServices()) { return; } - bool ok; + bool ok {}; const int id = ui->le_Id->text().toInt(&ok); const CAirlineIcaoCode icao = sGui->getWebDataServices()->getAirlineIcaoCodeForDbKey(id); if (ok && !icao.isLoadedFromDb()) diff --git a/src/gui/editors/coordinateform.cpp b/src/gui/editors/coordinateform.cpp index 0780b77f12..dd2951c137 100644 --- a/src/gui/editors/coordinateform.cpp +++ b/src/gui/editors/coordinateform.cpp @@ -214,7 +214,7 @@ namespace swift::gui::editors void CCoordinateForm::latCombinedEntered() { - bool ok; + bool ok {}; int deg = ui->le_LatDeg->text().trimmed().toInt(&ok); if (!ok) return; @@ -246,7 +246,7 @@ namespace swift::gui::editors void CCoordinateForm::lngCombinedEntered() { - bool ok; + bool ok {}; int deg = ui->le_LngDeg->text().trimmed().toInt(&ok); if (!ok) return; diff --git a/src/gui/editors/liveryform.cpp b/src/gui/editors/liveryform.cpp index a26aebada6..8c988f54e8 100644 --- a/src/gui/editors/liveryform.cpp +++ b/src/gui/editors/liveryform.cpp @@ -68,7 +68,7 @@ namespace swift::gui::editors const QString id = ui->le_Id->text(); if (!id.isEmpty() && sGui && !sGui->isShuttingDown() && sGui->hasWebDataServices()) { - bool ok; + bool ok {}; const int dbKey = id.toInt(&ok); if (ok) { livery = sGui->getWebDataServices()->getLiveryForDbKey(dbKey); } } diff --git a/src/gui/editors/modelmappingform.cpp b/src/gui/editors/modelmappingform.cpp index e519c25c32..bef9cfb047 100644 --- a/src/gui/editors/modelmappingform.cpp +++ b/src/gui/editors/modelmappingform.cpp @@ -112,7 +112,7 @@ namespace swift::gui::editors // without unit we assume ft if (isDigitsOnlyString(v)) { - bool ok; + bool ok {}; const double cgv = v.toDouble(&ok); if (!ok) { return CLength::null(); } return { cgv, CLengthUnit::ft() }; diff --git a/src/gui/editors/pbhsform.cpp b/src/gui/editors/pbhsform.cpp index 1631ae7a88..bb5154c4ae 100644 --- a/src/gui/editors/pbhsform.cpp +++ b/src/gui/editors/pbhsform.cpp @@ -49,7 +49,7 @@ namespace swift::gui::editors double CPbhsForm::getBankAngleDegrees() const { const QString v(ui->le_Bank->text().replace(',', '.')); - bool ok; + bool ok {}; double vd = v.toDouble(&ok); if (!ok) { vd = 0.0; } return CAngle::normalizeDegrees180(vd, RoundDigits); @@ -67,7 +67,7 @@ namespace swift::gui::editors double CPbhsForm::getPitchAngleDegrees() const { const QString v(ui->le_Pitch->text().replace(',', '.')); - bool ok; + bool ok {}; double vd = v.toDouble(&ok); if (!ok) { vd = 0.0; } return CAngle::normalizeDegrees180(vd, RoundDigits); @@ -87,7 +87,7 @@ namespace swift::gui::editors double CPbhsForm::getHeadingAngleDegrees() const { const QString v(ui->le_Heading->text().replace(',', '.')); - bool ok; + bool ok {}; double vd = v.toDouble(&ok); if (!ok) { vd = 0.0; } return CAngle::normalizeDegrees180(vd, RoundDigits); diff --git a/src/gui/editors/situationform.cpp b/src/gui/editors/situationform.cpp index faf27c8ac4..15b740a282 100644 --- a/src/gui/editors/situationform.cpp +++ b/src/gui/editors/situationform.cpp @@ -83,7 +83,7 @@ namespace swift::gui::editors double CSituationForm::getBankAngleDegrees() const { const QString v(ui->le_Bank->text().replace(',', '.')); - bool ok; + bool ok {}; double vd = v.toDouble(&ok); if (!ok) { vd = 0.0; } return CAngle::normalizeDegrees180(vd, RoundDigits); @@ -94,7 +94,7 @@ namespace swift::gui::editors double CSituationForm::getPitchAngleDegrees() const { const QString v(ui->le_Pitch->text().replace(',', '.')); - bool ok; + bool ok {}; double vd = v.toDouble(&ok); if (!ok) { vd = 0.0; } return CAngle::normalizeDegrees180(vd, RoundDigits); @@ -105,7 +105,7 @@ namespace swift::gui::editors double CSituationForm::getHeadingAngleDegrees() const { const QString v(ui->le_Heading->text().replace(',', '.')); - bool ok; + bool ok {}; double vd = v.toDouble(&ok); if (!ok) { vd = 0.0; } return CAngle::normalizeDegrees180(vd, RoundDigits); @@ -114,7 +114,7 @@ namespace swift::gui::editors double CSituationForm::getBarometricPressureMslMillibar() const { const QString v(ui->le_Pressure->text().replace(',', '.')); - bool ok; + bool ok {}; double vd = v.toDouble(&ok); if (!ok) { vd = CAltitude::standardISASeaLevelPressure().value(CPressureUnit::mbar()); } return vd; diff --git a/src/gui/models/listmodelbasenontemplate.cpp b/src/gui/models/listmodelbasenontemplate.cpp index d216ae8ce8..759d1b19e0 100644 --- a/src/gui/models/listmodelbasenontemplate.cpp +++ b/src/gui/models/listmodelbasenontemplate.cpp @@ -158,7 +158,7 @@ namespace swift::gui::models } CListModelBaseNonTemplate::CListModelBaseNonTemplate(const QString &translationContext, QObject *parent) - : QStandardItemModel(parent), m_columns(translationContext), m_sortColumn(-1), m_sortOrder(Qt::AscendingOrder) + : QStandardItemModel(parent), m_columns(translationContext) { // non unique default name, set translation context as default this->setObjectName(translationContext); diff --git a/src/gui/models/listmodelbasenontemplate.h b/src/gui/models/listmodelbasenontemplate.h index 157f100479..bad04c70ab 100644 --- a/src/gui/models/listmodelbasenontemplate.h +++ b/src/gui/models/listmodelbasenontemplate.h @@ -180,9 +180,9 @@ namespace swift::gui::models CListModelBaseNonTemplate(const QString &translationContext, QObject *parent = nullptr); CColumns m_columns; //!< columns metadata - int m_sortColumn; //!< currently sorted column + int m_sortColumn { -1 }; //!< currently sorted column bool m_modelDestroyed = false; //!< \todo rudimentary workaround for T579, can be removed - Qt::SortOrder m_sortOrder; //!< sort order (asc/desc) + Qt::SortOrder m_sortOrder { Qt::AscendingOrder }; //!< sort order (asc/desc) Qt::DropActions m_dropActions = Qt::IgnoreAction; //!< drop actions swift::misc::CPropertyIndexList m_sortTieBreakers; //!< how column values are sorted if equal, if no value is given this is random diff --git a/src/misc/aviation/aircrafticaocode.cpp b/src/misc/aviation/aircrafticaocode.cpp index 9a7abbaa63..3dab3aa503 100644 --- a/src/misc/aviation/aircrafticaocode.cpp +++ b/src/misc/aviation/aircrafticaocode.cpp @@ -376,7 +376,7 @@ namespace swift::misc::aviation if (m_combinedType.length() < 2) { return -1; } const QString c(m_combinedType.mid(1, 1)); if (c == "-") { return -1; } - bool ok; + bool ok {}; int ec = c.toInt(&ok); if (ok && ec >= 0 && ec < 10) { return ec; } return -1; diff --git a/src/misc/aviation/altitude.cpp b/src/misc/aviation/altitude.cpp index cfde64d8bb..b4d3fdc484 100644 --- a/src/misc/aviation/altitude.cpp +++ b/src/misc/aviation/altitude.cpp @@ -234,7 +234,7 @@ namespace swift::misc::aviation return false; } - bool ok; + bool ok {}; if (v.startsWith("F", Qt::CaseInsensitive)) { this->setUnit(CLengthUnit::ft()); diff --git a/src/misc/aviation/callsign.cpp b/src/misc/aviation/callsign.cpp index 55354cf353..7a5f162289 100644 --- a/src/misc/aviation/callsign.cpp +++ b/src/misc/aviation/callsign.cpp @@ -286,7 +286,7 @@ namespace swift::misc::aviation int CCallsign::getFlightNumberInt() const { if (this->isAtcCallsign()) { return -1; } - bool ok; + bool ok {}; const int fn = this->getFlightNumber().toInt(&ok); return ok ? fn : -1; } diff --git a/src/misc/aviation/callsignobjectlist.h b/src/misc/aviation/callsignobjectlist.h index 01cafb1b09..11768a3274 100644 --- a/src/misc/aviation/callsignobjectlist.h +++ b/src/misc/aviation/callsignobjectlist.h @@ -204,7 +204,7 @@ namespace swift::misc::aviation //! Incremental update or add object int incrementalUpdateOrAdd(const OBJ &objectBeforeChanges, const CPropertyIndexVariantMap &changedValues) { - int c; + int c {}; const CCallsign cs = objectBeforeChanges.getCallsign(); if (this->containsCallsign(cs)) { diff --git a/src/misc/aviation/comsystem.cpp b/src/misc/aviation/comsystem.cpp index 70a92ec68d..7740f4cb46 100644 --- a/src/misc/aviation/comsystem.cpp +++ b/src/misc/aviation/comsystem.cpp @@ -212,7 +212,7 @@ namespace swift::misc::aviation comFreq.parseFromString(input, sep); if (comFreq.isNull()) { - bool ok; + bool ok {}; const double f = CPqString::parseNumber(input, ok, sep); if (ok) { comFreq = CFrequency(f, f > 999 ? CFrequencyUnit::kHz() : CFrequencyUnit::MHz()); } else { comFreq = CFrequency::null(); } diff --git a/src/misc/aviation/flightplan.cpp b/src/misc/aviation/flightplan.cpp index 95673dd376..e1313e1918 100644 --- a/src/misc/aviation/flightplan.cpp +++ b/src/misc/aviation/flightplan.cpp @@ -444,7 +444,7 @@ namespace swift::misc::aviation const QDomNodeList generalList = doc.elementsByTagName("general"); if (!generalList.isEmpty()) { - bool ok; + bool ok {}; const QDomNode general = generalList.at(0); QString route = general.firstChildElement("route").text(); fp.setRoute(route.remove("DCT").simplified().trimmed()); @@ -470,7 +470,7 @@ namespace swift::misc::aviation const QDomNodeList timeList = doc.elementsByTagName("times"); if (!timeList.isEmpty()) { - bool ok; + bool ok {}; const QDomNode times = timeList.at(0); const QString enroute = times.firstChildElement("est_time_enroute").text(); const int enrouteSecs = enroute.toInt(&ok); diff --git a/src/misc/aviation/selcal.cpp b/src/misc/aviation/selcal.cpp index 5421069e3a..7fc00fff46 100644 --- a/src/misc/aviation/selcal.cpp +++ b/src/misc/aviation/selcal.cpp @@ -54,7 +54,10 @@ namespace swift::misc::aviation bool CSelcal::isValidCode(const QString &code) { if (code.length() != 4) return false; - int p1, p2, p3, p4; + int p1 {}; + int p2 {}; + int p3 {}; + int p4 {}; QString codeUpper = code.toUpper(); if ((p1 = CSelcal::validCharacters().indexOf(codeUpper.at(0))) < 0) return false; if ((p2 = CSelcal::validCharacters().indexOf(codeUpper.at(1))) < 0) return false; diff --git a/src/misc/aviation/transponder.cpp b/src/misc/aviation/transponder.cpp index 326b97bfc6..485a03c263 100644 --- a/src/misc/aviation/transponder.cpp +++ b/src/misc/aviation/transponder.cpp @@ -120,7 +120,7 @@ namespace swift::misc::aviation { if (CTransponder::isValidTransponderCode(transponderCode)) { - bool ok; + bool ok {}; this->setTransponderCode(transponderCode.toInt(&ok)); } else { Q_ASSERT_X(false, "CTransponder::setTransponderCode", "illegal transponder value"); } @@ -129,7 +129,7 @@ namespace swift::misc::aviation bool CTransponder::isValidTransponderCode(const QString &transponderCode) { if (transponderCode.isEmpty() || transponderCode.length() > 4) return false; - bool number; + bool number {}; int tc = transponderCode.toInt(&number); if (!number) return false; if (tc < 0 || tc > 7777) return false; diff --git a/src/misc/db/datastore.cpp b/src/misc/db/datastore.cpp index c43359e776..f55816a3ba 100644 --- a/src/misc/db/datastore.cpp +++ b/src/misc/db/datastore.cpp @@ -41,7 +41,7 @@ namespace swift::misc::db void IDatastoreObjectWithIntegerKey::setDbKey(const QString &key) { - bool ok; + bool ok {}; const int k = key.toInt(&ok); m_dbKey = ok ? k : -1; } @@ -65,7 +65,7 @@ namespace swift::misc::db int IDatastoreObjectWithIntegerKey::stringToDbKey(const QString &candidate) { if (candidate.isEmpty()) { return invalidDbKey(); } - bool ok; + bool ok {}; int k = candidate.toInt(&ok); return ok ? k : invalidDbKey(); } diff --git a/src/misc/dbus.h b/src/misc/dbus.h index 5282d7198b..d08ec1c547 100644 --- a/src/misc/dbus.h +++ b/src/misc/dbus.h @@ -40,7 +40,7 @@ QDBusArgument &operator<<(QDBusArgument &arg, const E &value) template , int> = 0> const QDBusArgument &operator>>(const QDBusArgument &arg, E &value) { - int temp; + int temp {}; arg.beginStructure(); arg >> temp; arg.endStructure(); diff --git a/src/misc/dbusserver.cpp b/src/misc/dbusserver.cpp index 232d0df96e..4cc4197110 100644 --- a/src/misc/dbusserver.cpp +++ b/src/misc/dbusserver.cpp @@ -139,7 +139,7 @@ namespace swift::misc else if (part.contains("port=", Qt::CaseInsensitive)) { const QString p = part.mid(part.lastIndexOf("=") + 1).trimmed(); - bool ok; + bool ok {}; port = p.toInt(&ok); if (!ok) { port = -1; } } @@ -158,7 +158,7 @@ namespace swift::misc bool CDBusServer::dBusAddressToHostAndPort(const QString &dbusAddress, QString &o_host, QString &o_port) { - int port; + int port {}; const bool s = dBusAddressToHostAndPort(dbusAddress, o_host, port); o_port = QString::number(port); return s; diff --git a/src/misc/geo/earthangle.cpp b/src/misc/geo/earthangle.cpp index 3a2075029e..4aae364c99 100644 --- a/src/misc/geo/earthangle.cpp +++ b/src/misc/geo/earthangle.cpp @@ -75,7 +75,7 @@ namespace swift::misc::geo } // number only -> parsed as degrees - bool isDouble; + bool isDouble {}; const double valueDegrees = wgs.toDouble(&isDouble); if (isDouble) { @@ -93,7 +93,7 @@ namespace swift::misc::geo while (i.hasNext() && c < 3) { const QRegularExpressionMatch match = i.next(); - bool ok; + bool ok {}; if (match.hasMatch()) { const QString cap = match.captured(0); diff --git a/src/misc/loghandler.cpp b/src/misc/loghandler.cpp index fc1f33b12e..b10ea06be2 100644 --- a/src/misc/loghandler.cpp +++ b/src/misc/loghandler.cpp @@ -206,7 +206,7 @@ namespace swift::misc if (isFallThroughEnabled(handlers)) { Q_ASSERT_X(m_oldHandler, Q_FUNC_INFO, "Handler must be installed"); - QtMsgType type; + QtMsgType type {}; QString category; QString message; statusMessage.toQtLogTriple(&type, &category, &message); diff --git a/src/misc/logpattern.cpp b/src/misc/logpattern.cpp index 490244c07f..7f1fce766b 100644 --- a/src/misc/logpattern.cpp +++ b/src/misc/logpattern.cpp @@ -363,7 +363,7 @@ namespace swift::misc void CLogPattern::unmarshallFromDbus(const QDBusArgument &argument) { - quint8 severities; + quint8 severities {}; QStringList strings; argument >> severities >> m_strategy >> strings; m_strings = QSet(strings.begin(), strings.end()); @@ -385,7 +385,7 @@ namespace swift::misc void CLogPattern::unmarshalFromDataStream(QDataStream &stream) { - quint8 severities; + quint8 severities {}; QStringList strings; stream >> severities >> m_strategy >> strings; m_strings = QSet(strings.begin(), strings.end()); diff --git a/src/misc/math/mathutils.cpp b/src/misc/math/mathutils.cpp index 823ae395e3..c2679cde78 100644 --- a/src/misc/math/mathutils.cpp +++ b/src/misc/math/mathutils.cpp @@ -18,8 +18,8 @@ namespace swift::misc::math double CMathUtils::round(double value, int digits) { // gosh, is there no Qt method for this??? It's year 2013 - double fractpart, intpart; - fractpart = modf(value, &intpart); + double intpart {}; + double fractpart = modf(value, &intpart); if (epsilonZeroLimits(fractpart)) { return value; } // do not mess any "integers" to the worse const double m = pow(10.0, digits); const qint64 ri = qRound64(value * m); // do not loose any range here @@ -30,8 +30,8 @@ namespace swift::misc::math double CMathUtils::roundEpsilon(double value, double epsilon) { if (epsilonZeroLimits(epsilon)) { return value; } // avoid division by 0 - double fractpart, intpart; - fractpart = modf(value, &intpart); + double intpart {}; + double fractpart = modf(value, &intpart); if (epsilonZeroLimits(fractpart)) { return value; } // do not mess any "integers" to the worse const double roundValue = value / epsilon; const qint64 ri = qRound64(roundValue); @@ -98,7 +98,7 @@ namespace swift::misc::math QString CMathUtils::fractionalPartAsString(double value, int width) { - double intpart; + double intpart {}; const double fractpart = modf(value, &intpart); const int prec = width >= 0 ? width + 1 : 10; const QString f = QString::number(fractpart, 'f', prec); // avoid scientific notation diff --git a/src/misc/math/mathutils.h b/src/misc/math/mathutils.h index 8659d7b09d..eb0317fc00 100644 --- a/src/misc/math/mathutils.h +++ b/src/misc/math/mathutils.h @@ -57,7 +57,7 @@ namespace swift::misc::math //! Fractional part of value static inline double fract(double value) { - double unused; + double unused {}; return modf(value, &unused); } diff --git a/src/misc/network/networkutils.cpp b/src/misc/network/networkutils.cpp index 697652521c..7d16bcb906 100644 --- a/src/misc/network/networkutils.cpp +++ b/src/misc/network/networkutils.cpp @@ -135,7 +135,7 @@ namespace swift::misc::network bool CNetworkUtils::isValidPort(const QString &port) { - bool success; + bool success {}; int p = port.toInt(&success); if (!success) return false; return (p >= 1 && p <= 65535); diff --git a/src/misc/network/urlloglist.cpp b/src/misc/network/urlloglist.cpp index 6e543b54dd..eaa7fe3495 100644 --- a/src/misc/network/urlloglist.cpp +++ b/src/misc/network/urlloglist.cpp @@ -80,7 +80,7 @@ namespace swift::misc::network bool CUrlLogList::markAsReceived(const QNetworkReply *nwReply, bool success) { Q_ASSERT_X(nwReply, Q_FUNC_INFO, "missing reply"); - bool ok; + bool ok {}; const int id = nwReply->property(CUrlLog::propertyNameId()).toInt(&ok); return (ok && id >= 0) ? this->markAsReceived(id, success) : false; } diff --git a/src/misc/pq/pqstring.cpp b/src/misc/pq/pqstring.cpp index 1094ec6318..6f4cecff6c 100644 --- a/src/misc/pq/pqstring.cpp +++ b/src/misc/pq/pqstring.cpp @@ -43,7 +43,7 @@ namespace swift::misc::physical_quantities unit = unit.trimmed(); // trim after replace, not before if (unit.isEmpty() || number.isEmpty()) { return v; } - bool success; + bool success {}; const double numberD = parseNumber(number, success, mode); if (!success) { return v; } diff --git a/src/misc/pq/time.cpp b/src/misc/pq/time.cpp index bb9b34ed32..3a0d482305 100644 --- a/src/misc/pq/time.cpp +++ b/src/misc/pq/time.cpp @@ -69,7 +69,7 @@ namespace swift::misc::physical_quantities const QString hStr = hhmm.left(2); const QString mStr = hhmm.right(2); - bool ok; + bool ok {}; const int h = hStr.toInt(&ok); if (!ok || h < 0 || h > 23) { return false; } diff --git a/src/misc/propertyindex.cpp b/src/misc/propertyindex.cpp index 27f969dc32..9aec4809ec 100644 --- a/src/misc/propertyindex.cpp +++ b/src/misc/propertyindex.cpp @@ -58,7 +58,7 @@ namespace swift::misc for (const auto &index : QStringView { indexes }.split(';')) { if (index.isEmpty()) { continue; } - bool ok; + bool ok {}; int i = index.toInt(&ok); Q_ASSERT(ok); Q_ASSERT(i >= static_cast(CPropertyIndexRef::GlobalIndexCValueObject)); diff --git a/src/misc/simulation/simulationenvironmentprovider.cpp b/src/misc/simulation/simulationenvironmentprovider.cpp index 371260d91c..4c9da9f69b 100644 --- a/src/misc/simulation/simulationenvironmentprovider.cpp +++ b/src/misc/simulation/simulationenvironmentprovider.cpp @@ -310,7 +310,7 @@ namespace swift::misc::simulation int ISimulationEnvironmentProvider::cleanUpElevations(const ICoordinateGeodetic &referenceCoordinate, int maxNumber) { - int currentMax; + int currentMax {}; CCoordinateGeodeticList coordinates(this->getAllElevationCoordinates(currentMax)); if (maxNumber < 0) { maxNumber = currentMax; } const int size = coordinates.size(); @@ -390,8 +390,8 @@ namespace swift::misc::simulation const int m = foundMissed.second; const double hitRatioPercent = 100.0 * static_cast(f) / static_cast(f + m); - int elvGnd; - int elv; + int elvGnd {}; + int elv {}; { QReadLocker l(&m_lockElvCoordinates); elvGnd = m_elvCoordinatesGnd.sizeInt(); diff --git a/src/misc/timestampbased.h b/src/misc/timestampbased.h index 97ef2b6fb5..f261bb16cb 100644 --- a/src/misc/timestampbased.h +++ b/src/misc/timestampbased.h @@ -239,7 +239,7 @@ namespace swift::misc static bool canHandleIndex(CPropertyIndexRef index); //! Constructor - ITimestampWithOffsetBased() : ITimestampBased() {} + ITimestampWithOffsetBased() = default; //! Constructor ITimestampWithOffsetBased(qint64 msSincePoch) : ITimestampBased(msSincePoch) {} diff --git a/src/misc/variant.cpp b/src/misc/variant.cpp index 4b32e2964a..db97238280 100644 --- a/src/misc/variant.cpp +++ b/src/misc/variant.cpp @@ -543,7 +543,7 @@ namespace swift::misc else if (QMetaType(localUserType).flags() & QMetaType::IsEnumeration) { arg.beginStructure(); - int i; + int i {}; arg >> i; arg.endStructure(); diff --git a/src/misc/worker.h b/src/misc/worker.h index b1dd784770..5a7eec67ed 100644 --- a/src/misc/worker.h +++ b/src/misc/worker.h @@ -224,6 +224,7 @@ namespace swift::misc template static CWorker *fromTask(QObject *owner, const QString &name, F &&task) { + // NOLINTNEXTLINE(cppcoreguidelines-init-variables) int typeId = qMetaTypeId(task)())>>(); return fromTaskImpl(owner, name, typeId, [task = std::forward(task)]() mutable { if constexpr (std::is_void_v) diff --git a/src/plugins/simulator/flightgear/fgswiftbusserviceproxy.cpp b/src/plugins/simulator/flightgear/fgswiftbusserviceproxy.cpp index d03049f3cc..dd991a105d 100644 --- a/src/plugins/simulator/flightgear/fgswiftbusserviceproxy.cpp +++ b/src/plugins/simulator/flightgear/fgswiftbusserviceproxy.cpp @@ -21,7 +21,7 @@ namespace swift::simplugin::flightgear InterfaceName(), connection, this); if (!dummy) { - bool s; + bool s {}; s = connection.connect( QString(), "/fgswiftbus/service", "org.swift_project.fgswiftbus.service", "aircraftModelChanged", this, SIGNAL(aircraftModelChanged(QString, QString, QString, QString, QString, QString, QString))); diff --git a/src/plugins/simulator/flightgear/fgswiftbustrafficproxy.cpp b/src/plugins/simulator/flightgear/fgswiftbustrafficproxy.cpp index d47054f5c3..85f07d8268 100644 --- a/src/plugins/simulator/flightgear/fgswiftbustrafficproxy.cpp +++ b/src/plugins/simulator/flightgear/fgswiftbustrafficproxy.cpp @@ -21,7 +21,7 @@ namespace swift::simplugin::flightgear connection, this); if (!dummy) { - bool s; + bool s {}; s = connection.connect(QString(), "/fgswiftbus/traffic", "org.swift_project.fgswiftbus.traffic", "simFrame", this, SIGNAL(simFrame())); Q_ASSERT(s); diff --git a/src/plugins/simulator/xplane/simulatorxplane.cpp b/src/plugins/simulator/xplane/simulatorxplane.cpp index b8076c7d71..760391c77a 100644 --- a/src/plugins/simulator/xplane/simulatorxplane.cpp +++ b/src/plugins/simulator/xplane/simulatorxplane.cpp @@ -1133,7 +1133,7 @@ namespace swift::simplugin::xplane void CSimulatorXPlane::onXSwiftBusSettingsChanged() { - bool ok; + bool ok {}; const CXSwiftBusSettings xPlaneSide = this->receiveXSwiftBusSettings(ok); if (ok) { diff --git a/src/plugins/simulator/xplane/xswiftbusserviceproxy.cpp b/src/plugins/simulator/xplane/xswiftbusserviceproxy.cpp index d47d4253dd..3e17f5bbfe 100644 --- a/src/plugins/simulator/xplane/xswiftbusserviceproxy.cpp +++ b/src/plugins/simulator/xplane/xswiftbusserviceproxy.cpp @@ -21,7 +21,7 @@ namespace swift::simplugin::xplane InterfaceName(), connection, this); if (!dummy) { - bool s; + bool s {}; s = connection.connect( QString(), "/xswiftbus/service", "org.swift_project.xswiftbus.service", "aircraftModelChanged", this, SIGNAL(aircraftModelChanged(QString, QString, QString, QString, QString, QString, QString))); diff --git a/src/plugins/simulator/xplane/xswiftbustrafficproxy.cpp b/src/plugins/simulator/xplane/xswiftbustrafficproxy.cpp index fc82aea424..fcf9140a57 100644 --- a/src/plugins/simulator/xplane/xswiftbustrafficproxy.cpp +++ b/src/plugins/simulator/xplane/xswiftbustrafficproxy.cpp @@ -32,7 +32,7 @@ namespace swift::simplugin::xplane connection, this); if (!dummy) { - bool s; + bool s {}; s = connection.connect(QString(), "/xswiftbus/traffic", "org.swift_project.xswiftbus.traffic", "simFrame", this, SIGNAL(simFrame())); Q_ASSERT(s); diff --git a/src/plugins/simulator/xplaneconfig/simulatorxplaneconfigwindow.cpp b/src/plugins/simulator/xplaneconfig/simulatorxplaneconfigwindow.cpp index 91b3dc01dc..83a27e0caf 100644 --- a/src/plugins/simulator/xplaneconfig/simulatorxplaneconfigwindow.cpp +++ b/src/plugins/simulator/xplaneconfig/simulatorxplaneconfigwindow.cpp @@ -147,7 +147,7 @@ namespace swift::simplugin::xplane int CSimulatorXPlaneConfigWindow::marginToInt(const QString &text, int defaultValue) { if (text.isEmpty()) { return defaultValue; } - bool ok; + bool ok {}; const int v = text.toInt(&ok); return ok ? v : defaultValue; } diff --git a/src/sound/codecs/opusdecoder.cpp b/src/sound/codecs/opusdecoder.cpp index d72b21acfc..749a6822d3 100644 --- a/src/sound/codecs/opusdecoder.cpp +++ b/src/sound/codecs/opusdecoder.cpp @@ -7,7 +7,7 @@ namespace swift::sound::codecs { COpusDecoder::COpusDecoder(int sampleRate, int channels) : m_channels(channels) { - int error; + int error {}; m_opusDecoder = opus_decoder_create(sampleRate, channels, &error); } diff --git a/src/sound/codecs/opusencoder.cpp b/src/sound/codecs/opusencoder.cpp index 45c93946e3..08308ce256 100644 --- a/src/sound/codecs/opusencoder.cpp +++ b/src/sound/codecs/opusencoder.cpp @@ -7,7 +7,7 @@ namespace swift::sound::codecs { COpusEncoder::COpusEncoder(int sampleRate, int channels, int application) { - int error; + int error {}; opusEncoder = opus_encoder_create(sampleRate, channels, application, &error); } diff --git a/src/sound/wav/wavfile.cpp b/src/sound/wav/wavfile.cpp index 19624d8643..aa4297e3e3 100644 --- a/src/sound/wav/wavfile.cpp +++ b/src/sound/wav/wavfile.cpp @@ -52,7 +52,7 @@ namespace swift::sound::wav WAVEHeader wave; //!< WAVE header }; - CWavFile::CWavFile(QObject *parent) : QFile(parent), m_headerLength(0) {} + CWavFile::CWavFile(QObject *parent) : QFile(parent) {} bool CWavFile::open(const QString &fileName) { @@ -82,7 +82,7 @@ namespace swift::sound::wav if (qFromLittleEndian(header.wave.descriptor.size) > sizeof(WAVEHeader)) { // Extended data available - quint16 extraFormatBytes; + quint16 extraFormatBytes {}; if (peek((char *)&extraFormatBytes, sizeof(quint16)) != sizeof(quint16)) return false; const qint64 throwAwayBytes = sizeof(quint16) + qFromLittleEndian(extraFormatBytes); if (read(throwAwayBytes).size() != throwAwayBytes) return false; diff --git a/src/sound/wav/wavfile.h b/src/sound/wav/wavfile.h index 024d481d61..db91632707 100644 --- a/src/sound/wav/wavfile.h +++ b/src/sound/wav/wavfile.h @@ -38,7 +38,7 @@ namespace swift::sound::wav bool readHeader(); QAudioFormat m_fileFormat; - qint64 m_headerLength; + qint64 m_headerLength { 0 }; QByteArray m_audioData; }; } // namespace swift::sound::wav From 469d9b842114c885d21d9473ea8933f62371c996 Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Sat, 25 Oct 2025 22:21:29 +0200 Subject: [PATCH 16/21] refactor: Fix readability-static-accessed-through-instance warnings --- .clang-tidy | 1 + src/core/application.cpp | 4 ++-- src/core/context/contextownaircraftimpl.cpp | 4 ++-- src/core/db/databaseutils.cpp | 8 ++++---- src/gui/components/audionotificationcomponent.cpp | 2 +- .../copymodelsfromotherswiftversionscomponent.cpp | 2 +- src/gui/components/dbloadoverviewcomponent.cpp | 2 +- src/gui/components/firstmodelsetcomponent.cpp | 2 +- src/gui/components/infobarstatuscomponent.cpp | 4 ++-- src/gui/components/settingshotkeycomponent.cpp | 2 +- .../components/settingssimulatorbasicscomponent.cpp | 6 +++--- src/gui/components/settingssimulatorcomponent.cpp | 11 ++++++----- src/gui/components/updateinfocomponent.cpp | 2 +- src/gui/editors/aircraftpartsform.cpp | 2 +- src/gui/guiapplication.cpp | 2 +- src/gui/led.cpp | 4 ++-- src/gui/textmessagetextedit.cpp | 3 +-- src/misc/applicationinfo.cpp | 2 +- src/misc/aviation/aircrafticaocode.cpp | 2 +- src/misc/aviation/flightplan.cpp | 7 +++---- src/misc/datacache.cpp | 2 +- src/misc/dbusserver.cpp | 4 ++-- src/misc/simulation/aircraftmodel.cpp | 4 ++++ src/plugins/simulator/emulated/simulatoremulated.cpp | 2 +- .../simulator/flightgear/simulatorflightgear.cpp | 12 ++++++------ .../simulator/plugincommon/simulatorplugincommon.cpp | 2 +- src/plugins/simulator/xplane/simulatorxplane.cpp | 12 ++++++------ src/swiftlauncher/swiftlauncher.cpp | 4 ++-- 28 files changed, 59 insertions(+), 55 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index e7c970cae4..075b1d3a48 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -46,6 +46,7 @@ Checks: > readability-use-anyofallof, readability-redundant-member-init, cppcoreguidelines-init-variables, + readability-static-accessed-through-instance, CheckOptions: - key: readability-identifier-naming.ClassCase diff --git a/src/core/application.cpp b/src/core/application.cpp index bbd0ab7b4f..9961515569 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -838,7 +838,7 @@ namespace swift::core { const CStatusMessage m = this->supportsContexts() ? this->getIContextApplication()->saveSettings() : CSettingsCache::instance()->saveToStore(); - CLogMessage(this).preformatted(m); + CLogMessage::preformatted(m); } // from here on we really rip apart the application object @@ -870,7 +870,7 @@ namespace swift::core // clean up all in "deferred delete state" qApp->sendPostedEvents(nullptr, QEvent::DeferredDelete); - sApp->processEventsFor(500); + processEventsFor(500); // completed m_shutdown = true; diff --git a/src/core/context/contextownaircraftimpl.cpp b/src/core/context/contextownaircraftimpl.cpp index a00a74c4b9..4dff422820 100644 --- a/src/core/context/contextownaircraftimpl.cpp +++ b/src/core/context/contextownaircraftimpl.cpp @@ -142,7 +142,7 @@ namespace swift::core::context ownAircraft.setPilot(m_currentNetworkServer.get().getUser()); // If we already have a model from somehwere, keep it, otherwise init default - ownAircraft.setModel(this->reverseLookupModel(ownAircraft.getModel())); + ownAircraft.setModel(reverseLookupModel(ownAircraft.getModel())); if (!ownAircraft.getAircraftIcaoCode().hasValidDesignator()) { ownAircraft.setModel(getDefaultOwnAircraftModel()); @@ -205,7 +205,7 @@ namespace swift::core::context bool CContextOwnAircraft::updateOwnModel(const CAircraftModel &model, const CIdentifier &identifier) { - CAircraftModel updateModel(this->reverseLookupModel(model)); + CAircraftModel updateModel(reverseLookupModel(model)); { QWriteLocker l(&m_lockAircraft); const bool changed = (m_ownAircraft.getModel() != updateModel); diff --git a/src/core/db/databaseutils.cpp b/src/core/db/databaseutils.cpp index a1c06c2628..cf53239cdd 100644 --- a/src/core/db/databaseutils.cpp +++ b/src/core/db/databaseutils.cpp @@ -179,7 +179,7 @@ namespace swift::core::db if (processEvents && c % 125 == 0) { if (!sApp || sApp->isShuttingDown()) { return models; } - sApp->processEventsFor(25); + CApplication::processEventsFor(25); } const QString ms(model.getModelString()); @@ -222,7 +222,7 @@ namespace swift::core::db if (processEvents && c % 125 == 0) { if (!sApp || sApp->isShuttingDown()) { return models; } - sApp->processEventsFor(25); + CApplication::processEventsFor(25); } const QString ms(model.getModelString()); @@ -268,7 +268,7 @@ namespace swift::core::db if (modified || model.hasValidDbKey()) { c++; - if (processEvents && c % 125 == 0) { sApp->processEventsFor(25); } + if (processEvents && c % 125 == 0) { CApplication::processEventsFor(25); } } } CLogMessage(static_cast(nullptr)).info(u"Consolidated %1 models in %2ms") @@ -374,7 +374,7 @@ namespace swift::core::db const int percentage = c * 100 / maxModelsCount; progressIndicator->updateProgressIndicatorAndProcessEvents(percentage); } - else { sApp->processEventsFor(10); } + else { CApplication::processEventsFor(10); } } // values to be skipped diff --git a/src/gui/components/audionotificationcomponent.cpp b/src/gui/components/audionotificationcomponent.cpp index 933797b423..12ae5867a1 100644 --- a/src/gui/components/audionotificationcomponent.cpp +++ b/src/gui/components/audionotificationcomponent.cpp @@ -199,7 +199,7 @@ namespace swift::gui::components ui->cb_SetupAudioNotificationLogoff->isChecked()); const CStatusMessage msg = m_audioSettings.set(as); - CLogMessage(this).preformatted(msg); + CLogMessage::preformatted(msg); const auto *sender = qobject_cast(QObject::sender()); if (checked && sGui && sGui->getCContextAudioBase() && sender) diff --git a/src/gui/components/copymodelsfromotherswiftversionscomponent.cpp b/src/gui/components/copymodelsfromotherswiftversionscomponent.cpp index 5397096481..f624688411 100644 --- a/src/gui/components/copymodelsfromotherswiftversionscomponent.cpp +++ b/src/gui/components/copymodelsfromotherswiftversionscomponent.cpp @@ -175,7 +175,7 @@ namespace swift::gui::components if (ui->cb_Silent->isChecked()) { // allow UI updates - sApp->processEventsFor(50); + CApplication::processEventsFor(50); return true; } const QMessageBox::StandardButton reply = QMessageBox::question( diff --git a/src/gui/components/dbloadoverviewcomponent.cpp b/src/gui/components/dbloadoverviewcomponent.cpp index eb935263bb..948f99cd56 100644 --- a/src/gui/components/dbloadoverviewcomponent.cpp +++ b/src/gui/components/dbloadoverviewcomponent.cpp @@ -31,7 +31,7 @@ namespace swift::gui::components //! \fixme KB 201709 It is hard to judge if it is a good idea to trigger cache admit in a UI component // althought admit happens in background, this component might trigger cache reads not needed (though it is not // very likely) - this->admitCaches(); + admitCaches(); ui->lbl_DatabaseUrl->setTextFormat(Qt::RichText); ui->lbl_DatabaseUrl->setTextInteractionFlags(Qt::TextBrowserInteraction); diff --git a/src/gui/components/firstmodelsetcomponent.cpp b/src/gui/components/firstmodelsetcomponent.cpp index 49c54b5378..38b358d884 100644 --- a/src/gui/components/firstmodelsetcomponent.cpp +++ b/src/gui/components/firstmodelsetcomponent.cpp @@ -298,7 +298,7 @@ namespace swift::gui::components QWidget *CFirstModelSetComponent::mainWindow() { - QWidget *pw = sGui->mainApplicationWidget(); + QWidget *pw = CGuiApplication::mainApplicationWidget(); return pw ? pw : this; } diff --git a/src/gui/components/infobarstatuscomponent.cpp b/src/gui/components/infobarstatuscomponent.cpp index 411b8127ec..1aaa281d00 100644 --- a/src/gui/components/infobarstatuscomponent.cpp +++ b/src/gui/components/infobarstatuscomponent.cpp @@ -250,8 +250,8 @@ namespace swift::gui::components void CInfoBarStatusComponent::updateSpacing() { - if (!sGui || sGui->isShuttingDown() || !sGui->mainApplicationWidget()) { return; } - const int w = sGui->mainApplicationWidget()->width(); + if (!sGui || sGui->isShuttingDown() || !CGuiApplication::mainApplicationWidget()) { return; } + const int w = CGuiApplication::mainApplicationWidget()->width(); const int s = (w >= 400) ? 6 : 2; this->setSpacing(s); } diff --git a/src/gui/components/settingshotkeycomponent.cpp b/src/gui/components/settingshotkeycomponent.cpp index 63aaf04946..4ef9627ca2 100644 --- a/src/gui/components/settingshotkeycomponent.cpp +++ b/src/gui/components/settingshotkeycomponent.cpp @@ -56,7 +56,7 @@ namespace swift::gui::components void CSettingsHotkeyComponent::saveSettings() { const CStatusMessage msg = m_actionHotkeys.save(); - CLogMessage(this).preformatted(msg); + CLogMessage::preformatted(msg); } void CSettingsHotkeyComponent::registerDummyPttEntry() diff --git a/src/gui/components/settingssimulatorbasicscomponent.cpp b/src/gui/components/settingssimulatorbasicscomponent.cpp index da0967f0a6..50b0ac80a4 100644 --- a/src/gui/components/settingssimulatorbasicscomponent.cpp +++ b/src/gui/components/settingssimulatorbasicscomponent.cpp @@ -166,8 +166,8 @@ namespace swift::gui::components // override if values are not empty const CSpecializedSimulatorSettings ss = m_settings.getSpecializedSettings(simulator); - const QString sd = CFileUtils::fixWindowsUncPath( - CFileUtils::normalizeFilePathToQtStandard(ss.defaultSimulatorDirectory(simulator))); + const QString sd = CFileUtils::fixWindowsUncPath(CFileUtils::normalizeFilePathToQtStandard( + CSpecializedSimulatorSettings::defaultSimulatorDirectory(simulator))); if (!sd.isEmpty()) { ui->le_SimulatorDirectory->setText(sd); @@ -181,7 +181,7 @@ namespace swift::gui::components m_unsavedChanges = true; } - const QStringList excludes(ss.defaultModelExcludeDirectoryPatterns(simulator)); + const QStringList excludes(CSpecializedSimulatorSettings::defaultModelExcludeDirectoryPatterns(simulator)); if (!excludes.isEmpty()) { this->displayExcludeDirectoryPatterns(excludes); diff --git a/src/gui/components/settingssimulatorcomponent.cpp b/src/gui/components/settingssimulatorcomponent.cpp index c2f4c8c24b..cbb65bcf31 100644 --- a/src/gui/components/settingssimulatorcomponent.cpp +++ b/src/gui/components/settingssimulatorcomponent.cpp @@ -222,8 +222,9 @@ namespace swift::gui::components // get initial aircraft to render CInterpolationAndRenderingSetupGlobal setup = sGui->getIContextSimulator()->getInterpolationAndRenderingSetupGlobal(); - const int noRequested = - ui->le_MaxAircraft->text().isEmpty() ? setup.InfiniteAircraft() : ui->le_MaxAircraft->text().toInt(); + const int noRequested = ui->le_MaxAircraft->text().isEmpty() ? + CInterpolationAndRenderingSetupGlobal::InfiniteAircraft() : + ui->le_MaxAircraft->text().toInt(); const int oldValue = setup.getMaxRenderedAircraft(); if (oldValue == noRequested) { return; } @@ -301,7 +302,7 @@ namespace swift::gui::components bool ok = false; CSimulatorSettings settings = CSettingsSimulatorComponent::getSimulatorSettings(ok); if (!ok || !settings.setComIntegrated(ui->cb_ComSync->isChecked())) { return; } - this->setSimulatorSettings(settings); + setSimulatorSettings(settings); } void CSettingsSimulatorComponent::onApplyCGSource() @@ -310,7 +311,7 @@ namespace swift::gui::components const CSimulatorSettings::CGSource source = ui->comp_CGSourceSelector->getValue(); CSimulatorSettings settings = CSettingsSimulatorComponent::getSimulatorSettings(ok); if (!ok || !settings.setCGSource(source)) { return; } - this->setSimulatorSettings(settings); + setSimulatorSettings(settings); } void CSettingsSimulatorComponent::onApplyRecordGnd() @@ -332,7 +333,7 @@ namespace swift::gui::components const bool c1 = settings.setRecordOwnAircraftGnd(ui->cb_RecordOwnGndPositions->isChecked()); const bool c2 = settings.setRecordedGndRadius(radius); if (!c1 && !c2) { return; } - this->setSimulatorSettings(settings); + setSimulatorSettings(settings); } void CSettingsSimulatorComponent::onReload() { this->setGuiValues(); } diff --git a/src/gui/components/updateinfocomponent.cpp b/src/gui/components/updateinfocomponent.cpp index 02f89df923..eadf9d80a9 100644 --- a/src/gui/components/updateinfocomponent.cpp +++ b/src/gui/components/updateinfocomponent.cpp @@ -198,7 +198,7 @@ namespace swift::gui::components const QString platform = this->getSelectedOrDefaultPlatform().getPlatformName(); const QStringList settings({ channel, platform }); const CStatusMessage m = m_updateSettings.setAndSave(settings); - if (m.isFailure()) { CLogMessage(this).preformatted(m); } + if (m.isFailure()) { CLogMessage::preformatted(m); } } void CUpdateInfoComponent::channelChanged() { this->uiSelectionChanged(); } diff --git a/src/gui/editors/aircraftpartsform.cpp b/src/gui/editors/aircraftpartsform.cpp index 889d90a8f4..f2d98a2317 100644 --- a/src/gui/editors/aircraftpartsform.cpp +++ b/src/gui/editors/aircraftpartsform.cpp @@ -75,7 +75,7 @@ namespace swift::gui::editors } catch (const CJsonException &ex) { - CLogMessage(this).preformatted(CStatusMessage::fromJsonException(ex, this, "Parse error")); + CLogMessage::preformatted(CStatusMessage::fromJsonException(ex, this, "Parse error")); return parts; } return parts; diff --git a/src/gui/guiapplication.cpp b/src/gui/guiapplication.cpp index cf971de04f..077840b262 100644 --- a/src/gui/guiapplication.cpp +++ b/src/gui/guiapplication.cpp @@ -364,7 +364,7 @@ namespace swift::gui CLogSubscriber logSub(this, [&](const CStatusMessage &message) { // handles an error in restoreGeometry/State const int ret = - QMessageBox::critical(sGui->mainApplicationWidget(), sGui->getApplicationNameAndVersion(), + QMessageBox::critical(mainApplicationWidget(), sGui->getApplicationNameAndVersion(), QStringLiteral("Restoring the window state/geometry failed!\n" "You need to reset the window size (command -%1).\n\n" "Original msg: %2\n\n" diff --git a/src/gui/led.cpp b/src/gui/led.cpp index 3a0186f8be..7229d00310 100644 --- a/src/gui/led.cpp +++ b/src/gui/led.cpp @@ -229,7 +229,7 @@ namespace swift::gui if (resetTimeMs > 0) { QPointer myself(this); - m_resetTimer.singleShot(resetTimeMs, this, [=] { + QTimer::singleShot(resetTimeMs, this, [=] { if (!myself) { return; } this->resetState(); }); @@ -252,7 +252,7 @@ namespace swift::gui void CLedWidget::setTriState(int resetTimeMs) { - if (resetTimeMs > 0) { m_resetTimer.singleShot(resetTimeMs, this, &CLedWidget::resetState); } + if (resetTimeMs > 0) { QTimer::singleShot(resetTimeMs, this, &CLedWidget::resetState); } else { m_resetTimer.stop(); diff --git a/src/gui/textmessagetextedit.cpp b/src/gui/textmessagetextedit.cpp index bf0ed57492..b0bd975bd1 100644 --- a/src/gui/textmessagetextedit.cpp +++ b/src/gui/textmessagetextedit.cpp @@ -71,8 +71,7 @@ namespace swift::gui void CTextMessageTextEdit::redrawHtml() { - const QString html( - this->toHtml(m_latestFirst ? m_messages.reversed() : m_messages, m_withSender, m_withRecipient)); + const QString html(toHtml(m_latestFirst ? m_messages.reversed() : m_messages, m_withSender, m_withRecipient)); m_textDocument.setHtml(html); this->moveCursor(m_latestFirst ? QTextCursor::Start : QTextCursor::End); } diff --git a/src/misc/applicationinfo.cpp b/src/misc/applicationinfo.cpp index ee71700f99..732daf110f 100644 --- a/src/misc/applicationinfo.cpp +++ b/src/misc/applicationinfo.cpp @@ -206,7 +206,7 @@ namespace swift::misc CApplicationInfo::Application CApplicationInfo::guessApplication() { - const QString a(QCoreApplication::instance()->applicationName().toLower()); + const QString a(QCoreApplication::applicationName().toLower()); if (a.contains("test")) { return CApplicationInfo::UnitTest; } // names like testcore if (a.contains("sample")) { return CApplicationInfo::Sample; } if (a.contains("core")) { return CApplicationInfo::PilotClientCore; } diff --git a/src/misc/aviation/aircrafticaocode.cpp b/src/misc/aviation/aircrafticaocode.cpp index 3dab3aa503..db377f065d 100644 --- a/src/misc/aviation/aircrafticaocode.cpp +++ b/src/misc/aviation/aircrafticaocode.cpp @@ -122,7 +122,7 @@ namespace swift::misc::aviation { // actually we would expect all DB data to be valid, however right now // we only check special cases - if (this->getDesignator() == this->getUnassignedDesignator()) { return msg; } // DB ZZZZ + if (this->getDesignator() == getUnassignedDesignator()) { return msg; } // DB ZZZZ } if (!hasKnownDesignator()) diff --git a/src/misc/aviation/flightplan.cpp b/src/misc/aviation/flightplan.cpp index e1313e1918..fe48feda10 100644 --- a/src/misc/aviation/flightplan.cpp +++ b/src/misc/aviation/flightplan.cpp @@ -128,13 +128,12 @@ namespace swift::misc::aviation m_isParsed = true; if (m_remarks.isEmpty()) { return; } const QString remarks = m_remarks.toUpper(); - const QString callsign = - CCallsign::unifyCallsign(this->getRemark(remarks, "REG/")); // registration is a callsign + const QString callsign = CCallsign::unifyCallsign(getRemark(remarks, "REG/")); // registration is a callsign if (CCallsign::isValidAircraftCallsign(callsign)) { m_registration = CCallsign(callsign, CCallsign::Aircraft); } m_voiceCapabilities = m_voiceCapabilities.isUnknown() ? CVoiceCapabilities(m_remarks) : m_voiceCapabilities; m_flightOperator = - this->getRemark(remarks, "OPR/"); // operator, e.g. British airways, sometimes people use ICAO code here - m_selcalCode = CSelcal(this->getRemark(remarks, "SEL/")); + getRemark(remarks, "OPR/"); // operator, e.g. British airways, sometimes people use ICAO code here + m_selcalCode = CSelcal(getRemark(remarks, "SEL/")); m_radioTelephony = getRemark(remarks, "CALLSIGN/"); // used similar to radio telephony if (m_radioTelephony.isEmpty()) { m_radioTelephony = getRemark(remarks, "RT/"); } if (!m_flightOperator.isEmpty() && CAirlineIcaoCode::isValidAirlineDesignator(m_flightOperator)) diff --git a/src/misc/datacache.cpp b/src/misc/datacache.cpp index 6167ba02c0..36fbe0c6de 100644 --- a/src/misc/datacache.cpp +++ b/src/misc/datacache.cpp @@ -262,7 +262,7 @@ namespace swift::misc m_revisionFileName(revisionFileName) {} - const QString &CDataCacheSerializer::persistentStore() const { return m_cache->persistentStore(); } + const QString &CDataCacheSerializer::persistentStore() const { return CDataCache::persistentStore(); } void CDataCacheSerializer::saveToStore(const swift::misc::CVariantMap &values, const swift::misc::CValueCachePacket &baseline) diff --git a/src/misc/dbusserver.cpp b/src/misc/dbusserver.cpp index 4cc4197110..496b3b505b 100644 --- a/src/misc/dbusserver.cpp +++ b/src/misc/dbusserver.cpp @@ -211,12 +211,12 @@ namespace swift::misc if (ok) { CLogMessage(this).info(u"Adding '%1' to the new connection '%2'") - << key << this->getDBusInterfaceFromClassInfo(i.value()); + << key << getDBusInterfaceFromClassInfo(i.value()); } else { CLogMessage(this).info(u"Adding '%1' failed, connection '%2', error '%3'") - << key << this->getDBusInterfaceFromClassInfo(i.value()) << connection.lastError().message(); + << key << getDBusInterfaceFromClassInfo(i.value()) << connection.lastError().message(); success = false; } } diff --git a/src/misc/simulation/aircraftmodel.cpp b/src/misc/simulation/aircraftmodel.cpp index eb23812d4d..78685515ef 100644 --- a/src/misc/simulation/aircraftmodel.cpp +++ b/src/misc/simulation/aircraftmodel.cpp @@ -132,6 +132,7 @@ namespace swift::misc::simulation QJsonObject CAircraftModel::toMemoizedJson(MemoHelper::CMemoizer &helper) const { QJsonObject json; + // NOLINTBEGIN(readability-static-accessed-through-instance) introspect().forEachMember([&, this](auto member) { if constexpr (!decltype(member)::has(MetaFlags())) { @@ -139,11 +140,13 @@ namespace swift::misc::simulation json << std::make_pair(CExplicitLatin1String(member.latin1Name()), std::cref(maybeMemo)); } }); + // NOLINTEND(readability-static-accessed-through-instance) return json; } void CAircraftModel::convertFromMemoizedJson(const QJsonObject &json, const MemoHelper::CUnmemoizer &helper) { + // NOLINTBEGIN(readability-static-accessed-through-instance) introspect().forEachMember([&, this](auto member) { if constexpr (!decltype(member)::has(MetaFlags())) { @@ -151,6 +154,7 @@ namespace swift::misc::simulation if (it != json.end()) { it.value() >> helper.maybeUnmemoize(member.in(*this)).get(); } } }); + // NOLINTEND(readability-static-accessed-through-instance) } QString CAircraftModel::asHtmlSummary(const QString &separator) const diff --git a/src/plugins/simulator/emulated/simulatoremulated.cpp b/src/plugins/simulator/emulated/simulatoremulated.cpp index b7aeedef1a..85c2cb4c91 100644 --- a/src/plugins/simulator/emulated/simulatoremulated.cpp +++ b/src/plugins/simulator/emulated/simulatoremulated.cpp @@ -38,7 +38,7 @@ namespace swift::simplugin::emulated this->onSettingsChanged(); // init from settings m_myAircraft = this->getOwnAircraft(); // sync with provider - m_monitorWidget = new CSimulatorEmulatedMonitorDialog(this, sGui->mainApplicationWidget()); + m_monitorWidget = new CSimulatorEmulatedMonitorDialog(this, CGuiApplication::mainApplicationWidget()); connect(qApp, &QApplication::aboutToQuit, this, &CSimulatorEmulated::closeMonitor); connect(sGui, &CGuiApplication::aboutToShutdown, this, &CSimulatorEmulated::closeMonitor, Qt::QueuedConnection); diff --git a/src/plugins/simulator/flightgear/simulatorflightgear.cpp b/src/plugins/simulator/flightgear/simulatorflightgear.cpp index 25d1b58b46..8f7f0e9e02 100644 --- a/src/plugins/simulator/flightgear/simulatorflightgear.cpp +++ b/src/plugins/simulator/flightgear/simulatorflightgear.cpp @@ -386,7 +386,7 @@ namespace swift::simplugin::flightgear if (!m_serviceProxy) { return; } CLogMessage(this).info(u"FG DBus service unregistered"); - if (m_dbusMode == P2P) { m_dBusConnection.disconnectFromPeer(m_dBusConnection.name()); } + if (m_dbusMode == P2P) { QDBusConnection::disconnectFromPeer(m_dBusConnection.name()); } m_dBusConnection = QDBusConnection { "default" }; if (m_watcher) { m_watcher->setConnection(m_dBusConnection); } delete m_serviceProxy; @@ -1043,11 +1043,11 @@ namespace swift::simplugin::flightgear m_conn = QDBusConnection::sessionBus(); if (!m_conn.isConnected()) { - m_conn.disconnectFromBus(m_conn.name()); + QDBusConnection::disconnectFromBus(m_conn.name()); return; } checkConnectionCommon(); - m_conn.disconnectFromBus(m_conn.name()); + QDBusConnection::disconnectFromBus(m_conn.name()); } void CSimulatorFlightgearListener::checkConnectionViaPeer(const QString &address) @@ -1056,11 +1056,11 @@ namespace swift::simplugin::flightgear if (!m_conn.isConnected()) { // This is required to cleanup the connection in QtDBus - m_conn.disconnectFromPeer(m_conn.name()); + QDBusConnection::disconnectFromPeer(m_conn.name()); return; } checkConnectionCommon(); - m_conn.disconnectFromPeer(m_conn.name()); + QDBusConnection::disconnectFromPeer(m_conn.name()); } void CSimulatorFlightgearListener::checkConnectionCommon() @@ -1103,7 +1103,7 @@ namespace swift::simplugin::flightgear void CSimulatorFlightgearListener::serviceRegistered(const QString &serviceName) { if (serviceName == fgswiftbusServiceName()) { emit simulatorStarted(getPluginInfo()); } - m_conn.disconnectFromBus(m_conn.name()); + QDBusConnection::disconnectFromBus(m_conn.name()); } void CSimulatorFlightgearListener::fgSwiftBusServerSettingChanged() diff --git a/src/plugins/simulator/plugincommon/simulatorplugincommon.cpp b/src/plugins/simulator/plugincommon/simulatorplugincommon.cpp index b4133006dd..29962751c3 100644 --- a/src/plugins/simulator/plugincommon/simulatorplugincommon.cpp +++ b/src/plugins/simulator/plugincommon/simulatorplugincommon.cpp @@ -44,7 +44,7 @@ namespace swift::simplugin::common { if (!m_interpolationDisplayDialog) { - QWidget *parentWidget = sGui ? sGui->mainApplicationWidget() : nullptr; + QWidget *parentWidget = sGui ? CGuiApplication::mainApplicationWidget() : nullptr; auto *dialog = new CInterpolationLogDisplayDialog(this, nullptr, parentWidget); m_interpolationDisplayDialog = dialog; m_interpolationDisplayDialog->setModal(false); diff --git a/src/plugins/simulator/xplane/simulatorxplane.cpp b/src/plugins/simulator/xplane/simulatorxplane.cpp index 760391c77a..3c6baf324f 100644 --- a/src/plugins/simulator/xplane/simulatorxplane.cpp +++ b/src/plugins/simulator/xplane/simulatorxplane.cpp @@ -542,7 +542,7 @@ namespace swift::simplugin::xplane if (!m_serviceProxy) { return; } CLogMessage(this).info(u"XPlane xSwiftBus service unregistered"); - if (m_dbusMode == P2P) { m_dBusConnection.disconnectFromPeer(m_dBusConnection.name()); } + if (m_dbusMode == P2P) { QDBusConnection::disconnectFromPeer(m_dBusConnection.name()); } m_dBusConnection = QDBusConnection { "default" }; if (m_watcher) { m_watcher->setConnection(m_dBusConnection); } delete m_serviceProxy; @@ -1373,11 +1373,11 @@ namespace swift::simplugin::xplane m_DBusConnection = QDBusConnection::sessionBus(); if (!m_DBusConnection.isConnected()) { - m_DBusConnection.disconnectFromBus(m_DBusConnection.name()); + QDBusConnection::disconnectFromBus(m_DBusConnection.name()); return; } checkConnectionCommon(); // bus - m_DBusConnection.disconnectFromBus(m_DBusConnection.name()); + QDBusConnection::disconnectFromBus(m_DBusConnection.name()); } void CSimulatorXPlaneListener::checkConnectionViaPeer(const QString &address) @@ -1386,11 +1386,11 @@ namespace swift::simplugin::xplane if (!m_DBusConnection.isConnected()) { // This is required to cleanup the connection in QtDBus - m_DBusConnection.disconnectFromPeer(m_DBusConnection.name()); + QDBusConnection::disconnectFromPeer(m_DBusConnection.name()); return; } checkConnectionCommon(); // peer - m_DBusConnection.disconnectFromPeer(m_DBusConnection.name()); + QDBusConnection::disconnectFromPeer(m_DBusConnection.name()); } void CSimulatorXPlaneListener::checkConnectionCommon() @@ -1441,7 +1441,7 @@ namespace swift::simplugin::xplane void CSimulatorXPlaneListener::serviceRegistered(const QString &serviceName) { if (serviceName == xswiftbusServiceName()) { emit simulatorStarted(getPluginInfo()); } - m_DBusConnection.disconnectFromBus(m_DBusConnection.name()); + QDBusConnection::disconnectFromBus(m_DBusConnection.name()); } void CSimulatorXPlaneListener::onXSwiftBusServerSettingChanged() diff --git a/src/swiftlauncher/swiftlauncher.cpp b/src/swiftlauncher/swiftlauncher.cpp index cd96c29a56..0ad7f71843 100644 --- a/src/swiftlauncher/swiftlauncher.cpp +++ b/src/swiftlauncher/swiftlauncher.cpp @@ -183,7 +183,7 @@ void CSwiftLauncher::clearWindowsRegistry() CSwiftLauncher::~CSwiftLauncher() = default; -QString CSwiftLauncher::getCmdLine() const { return this->toCmdLine(m_executable, m_executableArgs); } +QString CSwiftLauncher::getCmdLine() const { return toCmdLine(m_executable, m_executableArgs); } bool CSwiftLauncher::startDetached() { @@ -500,7 +500,7 @@ void CSwiftLauncher::checkRunningApplicationsAndCore() if (m_startMappingToolWaitCycles > 0) { m_startMappingToolWaitCycles--; } if (m_startGuiWaitCycles > 0) { m_startGuiWaitCycles--; } - const CApplicationInfoList runningApps = sGui->getRunningApplications(); + const CApplicationInfoList runningApps = CGuiApplication::getRunningApplications(); const bool foundLocalCore = runningApps.containsApplication(CApplicationInfo::PilotClientCore); const bool foundLocalMappingTool = runningApps.containsApplication(CApplicationInfo::MappingTool); const bool foundLocalPilotClientGui = runningApps.containsApplication(CApplicationInfo::PilotClientGui); From 7579ce8ba42e40df6d57d0f4c7f3fc1f31c8cd52 Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Sat, 25 Oct 2025 22:45:55 +0200 Subject: [PATCH 17/21] refactor: Fix readability-simplify-boolean-expr --- .clang-tidy | 1 + src/core/application.cpp | 4 +--- src/core/context/contextsimulator.cpp | 3 +-- src/core/fsd/servererror.cpp | 3 +-- src/gui/components/atcstationcomponent.cpp | 3 +-- src/gui/dockwidgetinfoarea.cpp | 6 +----- src/gui/infoarea.cpp | 2 +- src/gui/managedstatusbar.cpp | 2 +- src/gui/models/airlineicaofilter.cpp | 4 ++-- src/gui/models/listmodelbase.cpp | 2 +- src/gui/models/listmodelbasenontemplate.cpp | 2 +- src/gui/models/statusmessagefilter.cpp | 2 +- src/misc/aviation/airlineicaocode.cpp | 3 +-- src/misc/aviation/altitude.cpp | 2 +- src/misc/network/networkutils.cpp | 3 +-- src/misc/network/textmessage.cpp | 6 ++---- src/misc/simulation/fscommon/bcdconversions.cpp | 5 +---- src/misc/valuecache.cpp | 2 +- src/swiftlauncher/swiftlauncher.cpp | 4 ++-- 19 files changed, 22 insertions(+), 37 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 075b1d3a48..febf5ff1e4 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -47,6 +47,7 @@ Checks: > readability-redundant-member-init, cppcoreguidelines-init-variables, readability-static-accessed-through-instance, + readability-simplify-boolean-expr, CheckOptions: - key: readability-identifier-naming.ClassCase diff --git a/src/core/application.cpp b/src/core/application.cpp index 9961515569..f819c2d543 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -405,9 +405,7 @@ namespace swift::core if (CBuildConfig::isLocalDeveloperDebugBuild()) { return true; } const CDistribution d(this->getOwnDistribution()); - if (d.isRestricted() && this->isSet(m_cmdDevelopment)) { return true; } - - return false; + return d.isRestricted() && this->isSet(m_cmdDevelopment); } CStatusMessage CApplication::initLocalSettings() diff --git a/src/core/context/contextsimulator.cpp b/src/core/context/contextsimulator.cpp index 6c5ac459a4..8c3b678967 100644 --- a/src/core/context/contextsimulator.cpp +++ b/src/core/context/contextsimulator.cpp @@ -53,7 +53,6 @@ namespace swift::core::context bool IContextSimulator::isSimulatorSimulating() const { - if (!isSimulatorAvailable() || !getSimulatorStatus().testFlag(ISimulator::Simulating)) { return false; } - return true; + return isSimulatorAvailable() && getSimulatorStatus().testFlag(ISimulator::Simulating); } } // namespace swift::core::context diff --git a/src/core/fsd/servererror.cpp b/src/core/fsd/servererror.cpp index 20ea3d9da0..02838aa699 100644 --- a/src/core/fsd/servererror.cpp +++ b/src/core/fsd/servererror.cpp @@ -26,8 +26,7 @@ namespace swift::core::fsd ServerErrorCode::AuthTimeout, }; - if (fatalErrors.contains(m_errorNumber)) { return true; } - else { return false; } + return fatalErrors.contains(m_errorNumber); } QStringList ServerError::toTokens() const diff --git a/src/gui/components/atcstationcomponent.cpp b/src/gui/components/atcstationcomponent.cpp index d90e54ef72..cf18baaf85 100644 --- a/src/gui/components/atcstationcomponent.cpp +++ b/src/gui/components/atcstationcomponent.cpp @@ -419,8 +419,7 @@ namespace swift::gui::components bool CAtcStationComponent::canAccessContext() const { - if (!sGui || sGui->isShuttingDown() || !sGui->getIContextNetwork()) { return false; } - return true; + return sGui && !sGui->isShuttingDown() && sGui->getIContextNetwork(); } void CAtcStationComponent::clearOnlineViews() diff --git a/src/gui/dockwidgetinfoarea.cpp b/src/gui/dockwidgetinfoarea.cpp index 7e06e4b86a..8727724d37 100644 --- a/src/gui/dockwidgetinfoarea.cpp +++ b/src/gui/dockwidgetinfoarea.cpp @@ -48,11 +48,7 @@ namespace swift::gui if (!this->isVisible()) { return false; } // further checks - if (this->isFloating()) - { - if (this->isMinimized()) { return false; } - return true; - } + if (this->isFloating()) { return !this->isMinimized(); } else { return isSelectedDockWidget(); } } diff --git a/src/gui/infoarea.cpp b/src/gui/infoarea.cpp index c6343d41e3..bedf7ece76 100644 --- a/src/gui/infoarea.cpp +++ b/src/gui/infoarea.cpp @@ -543,7 +543,7 @@ namespace swift::gui { if (!sGui || sGui->isShuttingDown()) { return; } this->setTabPosition(Qt::LeftDockWidgetArea, QTabWidget::East); - const bool init = m_tabBar ? false : true; + const bool init = m_tabBar == nullptr; for (int i = 0; i < m_dockWidgetInfoAreas.size(); i++) { diff --git a/src/gui/managedstatusbar.cpp b/src/gui/managedstatusbar.cpp index 6737319fea..449750d079 100644 --- a/src/gui/managedstatusbar.cpp +++ b/src/gui/managedstatusbar.cpp @@ -40,7 +40,7 @@ namespace swift::gui void CManagedStatusBar::initStatusBar(QStatusBar *statusBar) { if (m_statusBar) { return; } - m_ownedStatusBar = statusBar ? false : true; + m_ownedStatusBar = statusBar == nullptr; m_statusBar = statusBar ? statusBar : new QStatusBar(); if (m_statusBar->objectName().isEmpty()) { m_statusBar->setObjectName("sb_ManagedStatusBar"); } diff --git a/src/gui/models/airlineicaofilter.cpp b/src/gui/models/airlineicaofilter.cpp index 0996114d4f..11ce149f5a 100644 --- a/src/gui/models/airlineicaofilter.cpp +++ b/src/gui/models/airlineicaofilter.cpp @@ -14,8 +14,8 @@ namespace swift::gui::models : m_id(id), m_vDesignator(vDesignator.trimmed().toUpper()), m_name(name.trimmed()), m_countryIso(countryIso.trimmed().toUpper()), m_real(isReal), m_va(isVa) { - this->m_valid = !(m_id < 0 && this->m_countryIso.isEmpty() && this->m_vDesignator.isEmpty() && - this->m_name.isEmpty() && !this->m_va && !this->m_real); + this->m_valid = m_id >= 0 || !this->m_countryIso.isEmpty() || !this->m_vDesignator.isEmpty() || + !this->m_name.isEmpty() || this->m_va || this->m_real; } CAirlineIcaoCodeList CAirlineIcaoFilter::filter(const CAirlineIcaoCodeList &inContainer) const diff --git a/src/gui/models/listmodelbase.cpp b/src/gui/models/listmodelbase.cpp index 84e047d6be..cb76269138 100644 --- a/src/gui/models/listmodelbase.cpp +++ b/src/gui/models/listmodelbase.cpp @@ -112,7 +112,7 @@ namespace swift::gui::models bool CListModelBase::setData(const QModelIndex &index, const QVariant &value, int role) { auto dataRole = static_cast(role); - if (!(dataRole == Qt::UserRole || dataRole == Qt::EditRole)) { return false; } + if (dataRole != Qt::UserRole && dataRole != Qt::EditRole) { return false; } // check / init if (!this->isValidIndex(index)) { return false; } diff --git a/src/gui/models/listmodelbasenontemplate.cpp b/src/gui/models/listmodelbasenontemplate.cpp index 759d1b19e0..530007df01 100644 --- a/src/gui/models/listmodelbasenontemplate.cpp +++ b/src/gui/models/listmodelbasenontemplate.cpp @@ -94,7 +94,7 @@ namespace swift::gui::models bool CListModelBaseNonTemplate::hasValidSortColumn() const { - if (!(m_sortColumn >= 0 && m_sortColumn < m_columns.size())) { return false; } + if (m_sortColumn < 0 || m_sortColumn >= m_columns.size()) { return false; } return m_columns.isSortable(m_sortColumn); } diff --git a/src/gui/models/statusmessagefilter.cpp b/src/gui/models/statusmessagefilter.cpp index 0048af5c69..e452a036ff 100644 --- a/src/gui/models/statusmessagefilter.cpp +++ b/src/gui/models/statusmessagefilter.cpp @@ -24,7 +24,7 @@ namespace swift::gui::models CStatusMessageList outContainer; for (const CStatusMessage &msg : inContainer) { - if (!(m_severity == CStatusMessage::SeverityInfo || m_severity == CStatusMessage::SeverityDebug)) + if (m_severity != CStatusMessage::SeverityInfo && m_severity != CStatusMessage::SeverityDebug) { if (!msg.isSeverityHigherOrEqual(this->m_severity)) { continue; } } diff --git a/src/misc/aviation/airlineicaocode.cpp b/src/misc/aviation/airlineicaocode.cpp index 4262df24df..0adfbc7f85 100644 --- a/src/misc/aviation/airlineicaocode.cpp +++ b/src/misc/aviation/airlineicaocode.cpp @@ -280,8 +280,7 @@ namespace swift::misc::aviation // allow 2 chars for special codes like "VV" if (airline.length() < 2 || airline.length() > 5) { return false; } const auto chars = makeRange(airline.begin(), airline.end()); - if (chars.containsBy([](QChar c) { return !c.isUpper() && !c.isDigit(); })) { return false; } - return true; + return !chars.containsBy([](QChar c) { return !c.isUpper() && !c.isDigit(); }); } bool CAirlineIcaoCode::isValidIataCode(const QString &iataCode) diff --git a/src/misc/aviation/altitude.cpp b/src/misc/aviation/altitude.cpp index b4d3fdc484..6708356309 100644 --- a/src/misc/aviation/altitude.cpp +++ b/src/misc/aviation/altitude.cpp @@ -294,7 +294,7 @@ namespace swift::misc::aviation if (msgs) { msgs->push_back(CStatusMessage(this).validationError(u"Altitude NULL value")); } return false; } - if (!(this->getReferenceDatum() == FlightLevel || this->getReferenceDatum() == MeanSeaLevel)) + if (this->getReferenceDatum() != FlightLevel && this->getReferenceDatum() != MeanSeaLevel) { if (msgs) { msgs->push_back(CStatusMessage(this).validationError(u"Altitude, must be FL or MSL")); } return false; diff --git a/src/misc/network/networkutils.cpp b/src/misc/network/networkutils.cpp index 7d16bcb906..1698336b9e 100644 --- a/src/misc/network/networkutils.cpp +++ b/src/misc/network/networkutils.cpp @@ -265,8 +265,7 @@ namespace swift::misc::network bool CNetworkUtils::looksLikePhpErrorMessage(const QString &errorMessage) { if (errorMessage.length() < 50) { return false; } - if (errorMessage.contains("xdebug", Qt::CaseInsensitive)) { return true; } - return false; + return errorMessage.contains("xdebug", Qt::CaseInsensitive); } const QString &CNetworkUtils::networkOperationToString(QNetworkAccessManager::Operation operation) diff --git a/src/misc/network/textmessage.cpp b/src/misc/network/textmessage.cpp index e906c6366b..c8310cdf8d 100644 --- a/src/misc/network/textmessage.cpp +++ b/src/misc/network/textmessage.cpp @@ -113,13 +113,11 @@ namespace swift::misc::network if (this->getSenderCallsign() != textMessage.getSenderCallsign()) { return false; } if (this->isRadioMessage() && textMessage.isRadioMessage()) { - if (this->getFrequency() != textMessage.getFrequency()) { return false; } - return true; + return this->getFrequency() == textMessage.getFrequency(); } else if (this->isPrivateMessage() && textMessage.isPrivateMessage()) { - if (this->getRecipientCallsign() != textMessage.getRecipientCallsign()) { return false; } - return true; + return this->getRecipientCallsign() == textMessage.getRecipientCallsign(); } return false; } diff --git a/src/misc/simulation/fscommon/bcdconversions.cpp b/src/misc/simulation/fscommon/bcdconversions.cpp index ca701f0388..7fbc9d4d01 100644 --- a/src/misc/simulation/fscommon/bcdconversions.cpp +++ b/src/misc/simulation/fscommon/bcdconversions.cpp @@ -32,10 +32,7 @@ namespace swift::misc::simulation::fscommon quint32 remainder = 0, quotient = 0, result = 0; remainder = num % divider; quotient = num / divider; - if (!(quotient == 0 && remainder == 0)) - { - result += hornerScheme(quotient, divider, factor) * factor + remainder; - } + if (quotient != 0 || remainder != 0) { result += hornerScheme(quotient, divider, factor) * factor + remainder; } return result; } } // namespace swift::misc::simulation::fscommon diff --git a/src/misc/valuecache.cpp b/src/misc/valuecache.cpp index 744ec116c9..a0c09e3d48 100644 --- a/src/misc/valuecache.cpp +++ b/src/misc/valuecache.cpp @@ -390,7 +390,7 @@ namespace swift::misc auto object = json.object(); json.setObject(it->mergeToMemoizedJson(object)); - if (!(file.seek(0) && file.resize(0) && file.write(json.toJson()) > 0 && file.checkedClose())) + if (!file.seek(0) || !file.resize(0) || file.write(json.toJson()) <= 0 || !file.checkedClose()) { return CStatusMessage(this).error(u"Failed to write to %1: %2") << file.fileName() << file.errorString(); diff --git a/src/swiftlauncher/swiftlauncher.cpp b/src/swiftlauncher/swiftlauncher.cpp index 0ad7f71843..d9da57abea 100644 --- a/src/swiftlauncher/swiftlauncher.cpp +++ b/src/swiftlauncher/swiftlauncher.cpp @@ -371,8 +371,8 @@ void CSwiftLauncher::setDefaults() ui->rb_WindowNormal->setChecked(!setup.useFramelessWindow()); const CLauncherSetup::CoreMode mode = setup.getCoreMode(); - ui->rb_SwiftStandalone->setChecked(mode == CLauncherSetup::Standalone ? true : false); - ui->rb_SwiftDistributed->setChecked(mode == CLauncherSetup::Distributed ? true : false); + ui->rb_SwiftStandalone->setChecked(mode == CLauncherSetup::Standalone); + ui->rb_SwiftDistributed->setChecked(mode == CLauncherSetup::Distributed); const CLauncherSetup::AudioMode audio = setup.getAudioMode(); ui->cb_DisableCoreAudio->setChecked(audio.testFlag(CLauncherSetup::AudioDisableDistributedCoreAudio)); From 707eaf049567eb67a7abd4e39056fad7afb0983d Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Sat, 25 Oct 2025 23:04:01 +0200 Subject: [PATCH 18/21] refactor: Fix readability-use-concise-preprocessor-directives --- .clang-tidy | 1 + src/core/swiftcoreexport.h | 2 +- src/gui/swiftguiexport.h | 2 +- src/input/joystick.cpp | 4 ++-- src/input/keyboard.cpp | 4 ++-- src/input/swiftinputexport.h | 2 +- src/misc/atomicfile.cpp | 8 ++++---- src/misc/cputime.cpp | 4 ++-- src/misc/processinfo.cpp | 4 ++-- src/misc/simulation/xplane/xplaneutil.cpp | 6 +++--- src/misc/stacktrace.cpp | 6 +++--- src/misc/swiftmiscexport.h | 2 +- src/misc/verify.cpp | 8 ++++---- .../simulator/plugincommon/simulatorplugincommonexport.h | 2 +- src/sound/swiftsoundexport.h | 2 +- src/swiftguistandard/swiftguistd.cpp | 4 ++-- 16 files changed, 31 insertions(+), 30 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index febf5ff1e4..4870e6c38d 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -48,6 +48,7 @@ Checks: > cppcoreguidelines-init-variables, readability-static-accessed-through-instance, readability-simplify-boolean-expr, + readability-use-concise-preprocessor-directives, CheckOptions: - key: readability-identifier-naming.ClassCase diff --git a/src/core/swiftcoreexport.h b/src/core/swiftcoreexport.h index 6a9204fd06..99ca1bd085 100644 --- a/src/core/swiftcoreexport.h +++ b/src/core/swiftcoreexport.h @@ -14,7 +14,7 @@ */ #ifndef WITH_STATIC -# if defined(BUILD_SWIFT_CORE_LIB) +# ifdef BUILD_SWIFT_CORE_LIB # define SWIFT_CORE_EXPORT Q_DECL_EXPORT # else # define SWIFT_CORE_EXPORT Q_DECL_IMPORT diff --git a/src/gui/swiftguiexport.h b/src/gui/swiftguiexport.h index d4b612ae2f..0bb5b234dd 100644 --- a/src/gui/swiftguiexport.h +++ b/src/gui/swiftguiexport.h @@ -13,7 +13,7 @@ * Export a class or function from the library */ #ifndef WITH_STATIC -# if defined(BUILD_SWIFT_GUI_LIB) +# ifdef BUILD_SWIFT_GUI_LIB # define SWIFT_GUI_EXPORT Q_DECL_EXPORT # else # define SWIFT_GUI_EXPORT Q_DECL_IMPORT diff --git a/src/input/joystick.cpp b/src/input/joystick.cpp index 4bc0dc1b79..cd0a7cf0ec 100644 --- a/src/input/joystick.cpp +++ b/src/input/joystick.cpp @@ -3,7 +3,7 @@ #include "joystick.h" -#if defined(Q_OS_WIN) +#ifdef Q_OS_WIN # include "win/joystickwindows.h" #elif defined(Q_OS_LINUX) # include "linux/joysticklinux.h" @@ -20,7 +20,7 @@ namespace swift::input std::unique_ptr IJoystick::create(QObject *parent) { -#if defined(Q_OS_WIN) +#ifdef Q_OS_WIN std::unique_ptr ptr(new CJoystickWindows(parent)); #elif defined(Q_OS_LINUX) std::unique_ptr ptr(new CJoystickLinux(parent)); diff --git a/src/input/keyboard.cpp b/src/input/keyboard.cpp index b634bac42e..09e0a147d0 100644 --- a/src/input/keyboard.cpp +++ b/src/input/keyboard.cpp @@ -3,7 +3,7 @@ #include "keyboard.h" -#if defined(Q_OS_WIN) +#ifdef Q_OS_WIN # include "win/keyboardwindows.h" #elif defined(Q_OS_LINUX) # include "linux/keyboardlinux.h" @@ -19,7 +19,7 @@ namespace swift::input std::unique_ptr IKeyboard::create(QObject *parent) { -#if defined(Q_OS_WIN) +#ifdef Q_OS_WIN std::unique_ptr ptr(new CKeyboardWindows(parent)); #elif defined(Q_OS_LINUX) std::unique_ptr ptr(new CKeyboardLinux(parent)); diff --git a/src/input/swiftinputexport.h b/src/input/swiftinputexport.h index f00a10e43a..9cae8e84dc 100644 --- a/src/input/swiftinputexport.h +++ b/src/input/swiftinputexport.h @@ -14,7 +14,7 @@ */ #ifndef WITH_STATIC -# if defined(BUILD_SWIFT_INPUT_LIB) +# ifdef BUILD_SWIFT_INPUT_LIB # define SWIFT_INPUT_EXPORT Q_DECL_EXPORT # else # define SWIFT_INPUT_EXPORT Q_DECL_IMPORT diff --git a/src/misc/atomicfile.cpp b/src/misc/atomicfile.cpp index b03fe578d9..daa58665fa 100644 --- a/src/misc/atomicfile.cpp +++ b/src/misc/atomicfile.cpp @@ -12,7 +12,7 @@ #include "misc/algorithm.h" -#if defined(Q_OS_POSIX) +#ifdef Q_OS_POSIX # include # include #elif defined(Q_OS_WIN32) @@ -29,7 +29,7 @@ namespace swift::misc { bool ok = true; { -#if defined(Q_OS_WIN32) +#ifdef Q_OS_WIN32 QNtfsPermissionCheckGuard permissionGuard; #endif if ((mode & CAtomicFile::ReadOnly) && !fileInfo.isReadable()) { ok = false; } @@ -71,7 +71,7 @@ namespace swift::misc { if (!isOpen()) { return; } -#if defined(Q_OS_WIN32) +#ifdef Q_OS_WIN32 FlushFileBuffers(reinterpret_cast(_get_osfhandle(handle()))); #endif @@ -118,7 +118,7 @@ namespace swift::misc 36, QChar('0')); } -#if defined(Q_OS_POSIX) +#ifdef Q_OS_POSIX void CAtomicFile::replaceOriginal() { auto result = ::rename(qPrintable(fileName()), qPrintable(m_originalFilename)); diff --git a/src/misc/cputime.cpp b/src/misc/cputime.cpp index 7f61796d80..486ea651ba 100644 --- a/src/misc/cputime.cpp +++ b/src/misc/cputime.cpp @@ -5,7 +5,7 @@ #include -#if defined(Q_OS_WIN32) +#ifdef Q_OS_WIN32 # include #elif defined(Q_OS_UNIX) # include @@ -14,7 +14,7 @@ namespace swift::misc { -#if defined(Q_OS_WIN32) +#ifdef Q_OS_WIN32 static int getCpuTimeMs(const FILETIME &kernelTime, const FILETIME &userTime) { diff --git a/src/misc/processinfo.cpp b/src/misc/processinfo.cpp index 75af0599b8..39b7ae25de 100644 --- a/src/misc/processinfo.cpp +++ b/src/misc/processinfo.cpp @@ -8,7 +8,7 @@ #include #include -#if defined(Q_OS_MACOS) +#ifdef Q_OS_MACOS # include #elif defined(Q_OS_WIN) # ifndef NOMINMAX @@ -30,7 +30,7 @@ namespace swift::misc return QStringLiteral("{ %1, %2 }").arg(QString::number(m_pid), m_name); } -#if defined(Q_OS_LINUX) +#ifdef Q_OS_LINUX QString CProcessInfo::processNameFromId(qint64 pid) { QString path = QFileInfo(QStringLiteral("/proc/%1/exe").arg(pid)).symLinkTarget(); diff --git a/src/misc/simulation/xplane/xplaneutil.cpp b/src/misc/simulation/xplane/xplaneutil.cpp index 07f2efc3cd..66d2832b4b 100644 --- a/src/misc/simulation/xplane/xplaneutil.cpp +++ b/src/misc/simulation/xplane/xplaneutil.cpp @@ -15,7 +15,7 @@ #include "misc/fileutils.h" #include "misc/swiftdirectories.h" -#if defined(Q_OS_WIN) +#ifdef Q_OS_WIN # include #endif @@ -47,7 +47,7 @@ namespace swift::misc::simulation::xplane return lastLine; } -#if defined(Q_OS_WIN) +#ifdef Q_OS_WIN QString getWindowsLocalAppDataPath() { QString result; @@ -85,7 +85,7 @@ namespace swift::misc::simulation::xplane { //! \fixme KB 8/17 we could also use the runtime CBuildConfig decision here, which looks nicer (I personally //! always try to avoid ifdef) -#if defined(Q_OS_WIN) +#ifdef Q_OS_WIN return CFileUtils::appendFilePathsAndFixUnc(getWindowsLocalAppDataPath(), xplaneInstallFile); #elif defined(Q_OS_LINUX) static const QString xp(".x-plane"); diff --git a/src/misc/stacktrace.cpp b/src/misc/stacktrace.cpp index 818b2c82bc..6622a47030 100644 --- a/src/misc/stacktrace.cpp +++ b/src/misc/stacktrace.cpp @@ -12,7 +12,7 @@ #include #include -#if defined(Q_CC_MSVC) +#ifdef Q_CC_MSVC # include # pragma warning(push) @@ -33,13 +33,13 @@ namespace swift::misc { -#if defined(QT_DEBUG) +#ifdef QT_DEBUG QStringList getStackTrace() { return getStackTraceAlways(); } #else QStringList getStackTrace() { return { "No stack trace with release build" }; } #endif -#if defined(Q_OS_WIN32) +#ifdef Q_OS_WIN32 QStringList getStackTraceAlways() { static QMutex mutex; diff --git a/src/misc/swiftmiscexport.h b/src/misc/swiftmiscexport.h index 680a0ee237..bd7515ad96 100644 --- a/src/misc/swiftmiscexport.h +++ b/src/misc/swiftmiscexport.h @@ -13,7 +13,7 @@ * Export a class or function from the library */ #ifndef WITH_STATIC -# if defined(BUILD_SWIFT_MISC_LIB) +# ifdef BUILD_SWIFT_MISC_LIB # define SWIFT_MISC_EXPORT Q_DECL_EXPORT # else # define SWIFT_MISC_EXPORT Q_DECL_IMPORT diff --git a/src/misc/verify.cpp b/src/misc/verify.cpp index cae3498c54..3a5de9760c 100644 --- a/src/misc/verify.cpp +++ b/src/misc/verify.cpp @@ -13,12 +13,12 @@ # include "crashpad/client/simulate_crash.h" #endif -#if defined(Q_CC_MSVC) +#ifdef Q_CC_MSVC # include # include #endif -#if defined(Q_CC_CLANG) +#ifdef Q_CC_CLANG # if __has_builtin(__builtin_debugtrap) # define SWIFT_BUILTIN_DEBUGTRAP __builtin_debugtrap # elif __has_builtin(__builtin_debugger) @@ -39,8 +39,8 @@ namespace swift::misc::private_ns Q_UNUSED(message) Q_UNUSED(audit) -#if defined(QT_DEBUG) -# if defined(Q_CC_MSVC) +#ifdef QT_DEBUG +# ifdef Q_CC_MSVC if (!audit || IsDebuggerPresent()) { __debugbreak(); diff --git a/src/plugins/simulator/plugincommon/simulatorplugincommonexport.h b/src/plugins/simulator/plugincommon/simulatorplugincommonexport.h index ea7bb5fdf4..a827226ac0 100644 --- a/src/plugins/simulator/plugincommon/simulatorplugincommonexport.h +++ b/src/plugins/simulator/plugincommon/simulatorplugincommonexport.h @@ -14,7 +14,7 @@ */ #ifndef WITH_STATIC -# if defined(BUILD_SIMULATORPLUGINCOMMON_LIB) +# ifdef BUILD_SIMULATORPLUGINCOMMON_LIB # define SIMULATORPLUGINCOMMON_EXPORT Q_DECL_EXPORT # else # define SIMULATORPLUGINCOMMON_EXPORT Q_DECL_IMPORT diff --git a/src/sound/swiftsoundexport.h b/src/sound/swiftsoundexport.h index 02a8b9a161..3426bec9ea 100644 --- a/src/sound/swiftsoundexport.h +++ b/src/sound/swiftsoundexport.h @@ -14,7 +14,7 @@ */ #ifndef WITH_STATIC -# if defined(BUILD_SWIFT_SOUND_LIB) +# ifdef BUILD_SWIFT_SOUND_LIB # define SWIFT_SOUND_EXPORT Q_DECL_EXPORT # else # define SWIFT_SOUND_EXPORT Q_DECL_IMPORT diff --git a/src/swiftguistandard/swiftguistd.cpp b/src/swiftguistandard/swiftguistd.cpp index ff4442190f..95b5b960bd 100644 --- a/src/swiftguistandard/swiftguistd.cpp +++ b/src/swiftguistandard/swiftguistd.cpp @@ -26,7 +26,7 @@ #include "misc/logmessage.h" #include "misc/threadutils.h" -#if defined(Q_OS_MACOS) +#ifdef Q_OS_MACOS # include "input/macos/macosinpututils.h" #endif @@ -422,7 +422,7 @@ void SwiftGuiStd::verifyPrerequisites() } else { msgs.push_back(sGui->getIContextSimulator()->verifyPrerequisites()); } -#if defined(Q_OS_MACOS) +#ifdef Q_OS_MACOS if (!swift::input::CMacOSInputUtils::hasAccess()) { // A log message about missing permissions is already emitted when initializing the keyboard. From d23b684b99d8a237b82854237e97c4068713fb92 Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Sat, 1 Nov 2025 00:53:14 +0100 Subject: [PATCH 19/21] fix: Supress false positives --- src/misc/aviation/altitude.cpp | 2 +- src/misc/aviation/selcal.cpp | 2 +- src/misc/simulation/fscommon/bcdconversions.h | 2 +- src/misc/simulation/interpolation/interpolationsetupprovider.h | 2 +- src/misc/variant.cpp | 3 +-- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/misc/aviation/altitude.cpp b/src/misc/aviation/altitude.cpp index 6708356309..eb8377080d 100644 --- a/src/misc/aviation/altitude.cpp +++ b/src/misc/aviation/altitude.cpp @@ -216,7 +216,7 @@ namespace swift::misc::aviation // in same step get numeric value only bool beforeDigit = true; QString numericPart; - for (int i = 0; i < v.length(); i++) + for (int i = 0; i < v.length(); i++) // NOLINT { const QChar c = v[i]; if (c.isDigit()) diff --git a/src/misc/aviation/selcal.cpp b/src/misc/aviation/selcal.cpp index 7fc00fff46..d2f9bdaab8 100644 --- a/src/misc/aviation/selcal.cpp +++ b/src/misc/aviation/selcal.cpp @@ -39,7 +39,7 @@ namespace swift::misc::aviation QList f; if (!CSelcal::isValidCode(m_code)) return f; f.reserve(m_code.length()); - for (int pos = 0; pos < m_code.length(); pos++) { f.append(CSelcal::audioFrequencyEquivalent(m_code.at(pos))); } + for (const QChar c : m_code) { f.append(CSelcal::audioFrequencyEquivalent(c)); } return f; } diff --git a/src/misc/simulation/fscommon/bcdconversions.h b/src/misc/simulation/fscommon/bcdconversions.h index ccbd8e31dd..fc017ec7e5 100644 --- a/src/misc/simulation/fscommon/bcdconversions.h +++ b/src/misc/simulation/fscommon/bcdconversions.h @@ -40,7 +40,7 @@ namespace swift::misc private: //! Constructor, only static methods - CBcdConversions() {} + CBcdConversions() {} // NOLINT(modernize-use-equals-default) //! Horner scheme static quint32 hornerScheme(quint32 num, quint32 divider, quint32 factor); diff --git a/src/misc/simulation/interpolation/interpolationsetupprovider.h b/src/misc/simulation/interpolation/interpolationsetupprovider.h index 1abd8f665a..3425e792ff 100644 --- a/src/misc/simulation/interpolation/interpolationsetupprovider.h +++ b/src/misc/simulation/interpolation/interpolationsetupprovider.h @@ -118,7 +118,7 @@ namespace swift::misc::simulation protected: //! Default constructor - CInterpolationSetupAware() {} + CInterpolationSetupAware() {} // NOLINT(modernize-use-equals-default) //! Constructor CInterpolationSetupAware(IInterpolationSetupProvider *setupProvider) : IProviderAware(setupProvider) {} diff --git a/src/misc/variant.cpp b/src/misc/variant.cpp index db97238280..c9edd4c48f 100644 --- a/src/misc/variant.cpp +++ b/src/misc/variant.cpp @@ -498,8 +498,7 @@ namespace swift::misc bool CVariant::isA(int metaTypeId) const { if (metaTypeId == QMetaType::UnknownType) { return false; } - if (metaTypeId == getMetaTypeId()) { return true; } - return false; + return metaTypeId == getMetaTypeId(); } bool CVariant::matches(const CVariant &value) const From 1bf664f241fd00769d13aafc392d18b504428008 Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Sat, 1 Nov 2025 11:59:23 +0100 Subject: [PATCH 20/21] build: Fix build on Windows --- src/misc/datacache.cpp | 2 ++ src/misc/datacache.h | 2 +- src/misc/simulation/settings/xswiftbussettingsqtfree.h | 1 + src/plugins/simulator/flightgear/flightgearmpaircraft.h | 2 +- src/xswiftbus/dbusconnection.h | 5 +++++ src/xswiftbus/dbusserver.h | 4 ++++ 6 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/misc/datacache.cpp b/src/misc/datacache.cpp index 36fbe0c6de..036d314bb0 100644 --- a/src/misc/datacache.cpp +++ b/src/misc/datacache.cpp @@ -351,6 +351,8 @@ namespace swift::misc : m_basename(basename), m_session(std::make_unique(m_basename + "/.session")) {} + CDataCacheRevision::~CDataCacheRevision() = default; // Explicitly in cpp file + CDataCacheRevision::LockGuard CDataCacheRevision::beginUpdate(const QMap ×tamps, bool updateUuid, bool pinsOnly) { diff --git a/src/misc/datacache.h b/src/misc/datacache.h index ccb823ca71..3e8ae03aec 100644 --- a/src/misc/datacache.h +++ b/src/misc/datacache.h @@ -83,7 +83,7 @@ namespace swift::misc CDataCacheRevision(const QString &basename); //! Destructor. - ~CDataCacheRevision() = default; + ~CDataCacheRevision(); //! @{ //! Non-copyable. diff --git a/src/misc/simulation/settings/xswiftbussettingsqtfree.h b/src/misc/simulation/settings/xswiftbussettingsqtfree.h index 14838b5d96..43b1bf537a 100644 --- a/src/misc/simulation/settings/xswiftbussettingsqtfree.h +++ b/src/misc/simulation/settings/xswiftbussettingsqtfree.h @@ -4,6 +4,7 @@ #ifndef SWIFT_MISC_SIMULATION_SETTINGS_CXSWIFTBUSSETTINGSQTFREE_H #define SWIFT_MISC_SIMULATION_SETTINGS_CXSWIFTBUSSETTINGSQTFREE_H +#include #include #include diff --git a/src/plugins/simulator/flightgear/flightgearmpaircraft.h b/src/plugins/simulator/flightgear/flightgearmpaircraft.h index 1f71a1a38e..21cf5bb497 100644 --- a/src/plugins/simulator/flightgear/flightgearmpaircraft.h +++ b/src/plugins/simulator/flightgear/flightgearmpaircraft.h @@ -23,7 +23,7 @@ namespace swift::simplugin::flightgear { public: //! Constructor - CFlightgearMPAircraft(); + CFlightgearMPAircraft() = default; //! Constructor providing initial situation/parts CFlightgearMPAircraft(const swift::misc::simulation::CSimulatedAircraft &aircraft, diff --git a/src/xswiftbus/dbusconnection.h b/src/xswiftbus/dbusconnection.h index f8812ae596..5669bd8680 100644 --- a/src/xswiftbus/dbusconnection.h +++ b/src/xswiftbus/dbusconnection.h @@ -4,6 +4,11 @@ #ifndef SWIFT_SIM_XSWIFTBUS_DBUSCONNECTION_H #define SWIFT_SIM_XSWIFTBUS_DBUSCONNECTION_H +#ifndef NOMINMAX +// windows.h min/max might be imported via dbus.h +# define NOMINMAX +#endif + #include #include diff --git a/src/xswiftbus/dbusserver.h b/src/xswiftbus/dbusserver.h index 04dcae7ff5..7711d0047d 100644 --- a/src/xswiftbus/dbusserver.h +++ b/src/xswiftbus/dbusserver.h @@ -4,6 +4,10 @@ #ifndef SWIFT_SIM_XSWIFTBUS_DBUSSERVER_H #define SWIFT_SIM_XSWIFTBUS_DBUSSERVER_H +#ifndef NOMINMAX +# define NOMINMAX +#endif + #include #include From 0d7981789e6c92243e29656e7d6092c2cdbd1f0d Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Sat, 1 Nov 2025 13:50:14 +0100 Subject: [PATCH 21/21] fix: Avoid implicit conversion --- src/gui/models/columnformatters.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/models/columnformatters.cpp b/src/gui/models/columnformatters.cpp index c0b282a453..8c341e2f22 100644 --- a/src/gui/models/columnformatters.cpp +++ b/src/gui/models/columnformatters.cpp @@ -185,7 +185,7 @@ namespace swift::gui::models CVariant CValueObjectFormatter::decorationRole(const CVariant &valueObject) const { - return { valueObject.toPixmap() }; + return { QVariant(valueObject.toPixmap()) }; } CDateTimeFormatter::CDateTimeFormatter(const QString &formatString, int alignment, bool i18n)