mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-08-06 17:53:23 +08:00
refactor: Fix clang-tidy warnings
This commit is contained in:
@@ -50,7 +50,7 @@ namespace swift::core
|
||||
//! @}
|
||||
|
||||
//! Destructor
|
||||
virtual ~CActionBind();
|
||||
~CActionBind() override;
|
||||
|
||||
//! Unbind from swift::core::CInputManager
|
||||
void unbind();
|
||||
|
||||
@@ -78,39 +78,36 @@ namespace swift::core
|
||||
//! @{
|
||||
//! Members not implenented or fully implenented by CRemoteAircraftProvider
|
||||
//! \ingroup remoteaircraftprovider
|
||||
virtual QObject *asQObject() override { return this; }
|
||||
virtual swift::misc::simulation::CAirspaceAircraftSnapshot getLatestAirspaceAircraftSnapshot() const override;
|
||||
virtual bool updateFastPositionEnabled(const swift::misc::aviation::CCallsign &callsign,
|
||||
bool enableFastPositonUpdates) override;
|
||||
QObject *asQObject() override { return this; }
|
||||
misc::simulation::CAirspaceAircraftSnapshot getLatestAirspaceAircraftSnapshot() const override;
|
||||
bool updateFastPositionEnabled(const misc::aviation::CCallsign &callsign,
|
||||
bool enableFastPositonUpdates) override;
|
||||
//! @}
|
||||
|
||||
//! Returns the list of users we know about
|
||||
swift::misc::network::CUserList getUsers() const;
|
||||
misc::network::CUserList getUsers() const;
|
||||
|
||||
//! Returns a list of the users corresponding to the given callsigns
|
||||
swift::misc::network::CUserList
|
||||
getUsersForCallsigns(const swift::misc::aviation::CCallsignSet &callsigns) const;
|
||||
misc::network::CUserList getUsersForCallsigns(const misc::aviation::CCallsignSet &callsigns) const;
|
||||
|
||||
//! Returns the loaded flight plan for the given callsign
|
||||
//! \remarks only use this if a network loaded flight plan is directly needed
|
||||
//! \remarks pseudo synchronous, call the async functions and waits for result
|
||||
swift::misc::aviation::CFlightPlan loadFlightPlanFromNetwork(const swift::misc::aviation::CCallsign &callsign);
|
||||
misc::aviation::CFlightPlan loadFlightPlanFromNetwork(const misc::aviation::CCallsign &callsign);
|
||||
|
||||
//! Try to get flight plan remarks
|
||||
//! \remarks returns a value only if the flight plan is already cached or can be obtained from VATSIM reader
|
||||
//! \threadsafe
|
||||
swift::misc::aviation::CFlightPlanRemarks
|
||||
tryToGetFlightPlanRemarks(const swift::misc::aviation::CCallsign &callsign) const;
|
||||
misc::aviation::CFlightPlanRemarks tryToGetFlightPlanRemarks(const misc::aviation::CCallsign &callsign) const;
|
||||
|
||||
//! Returns the current online ATC stations
|
||||
swift::misc::aviation::CAtcStationList getAtcStationsOnline() const { return m_atcStationsOnline; }
|
||||
misc::aviation::CAtcStationList getAtcStationsOnline() const { return m_atcStationsOnline; }
|
||||
|
||||
//! Recalculate distance to own aircraft
|
||||
swift::misc::aviation::CAtcStationList getAtcStationsOnlineRecalculated();
|
||||
misc::aviation::CAtcStationList getAtcStationsOnlineRecalculated();
|
||||
|
||||
//! Returns the closest ATC station operating on the given frequency, if any
|
||||
swift::misc::aviation::CAtcStation
|
||||
getAtcStationForComUnit(const swift::misc::aviation::CComSystem &comSystem) const;
|
||||
misc::aviation::CAtcStation getAtcStationForComUnit(const misc::aviation::CComSystem &comSystem) const;
|
||||
|
||||
//! Clear the contents
|
||||
void clear();
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
namespace swift::core::application
|
||||
{
|
||||
//! User configured hotkeys
|
||||
struct TActionHotkeys : public swift::misc::TSettingTrait<swift::misc::input::CActionHotkeyList>
|
||||
struct TActionHotkeys : misc::TSettingTrait<misc::input::CActionHotkeyList>
|
||||
{
|
||||
//! \copydoc swift::misc::TSettingTrait::key
|
||||
static const char *key() { return "application/actionhotkeys"; }
|
||||
@@ -28,7 +28,7 @@ namespace swift::core::application
|
||||
}
|
||||
|
||||
//! \copydoc swift::misc::TSettingTrait::isValid
|
||||
static bool isValid(const swift::misc::input::CActionHotkeyList &value, QString &)
|
||||
static bool isValid(const misc::input::CActionHotkeyList &value, QString &)
|
||||
{
|
||||
for (const auto &actionHotkey : value)
|
||||
{
|
||||
@@ -43,7 +43,7 @@ namespace swift::core::application
|
||||
};
|
||||
|
||||
//! Selected simulator plugins
|
||||
struct TEnabledSimulators : public swift::misc::TSettingTrait<QStringList>
|
||||
struct TEnabledSimulators : misc::TSettingTrait<QStringList>
|
||||
{
|
||||
//! \copydoc swift::misc::TSettingTrait::key
|
||||
static const char *key() { return "application/enabledsimulators"; }
|
||||
@@ -59,8 +59,7 @@ namespace swift::core::application
|
||||
static const QStringList &defaultValue()
|
||||
{
|
||||
// All default simulators
|
||||
static const QStringList enabledSimulators(
|
||||
swift::misc::simulation::CSimulatorPluginInfo::guessDefaultPlugins());
|
||||
static const QStringList enabledSimulators(misc::simulation::CSimulatorPluginInfo::guessDefaultPlugins());
|
||||
return enabledSimulators;
|
||||
}
|
||||
|
||||
@@ -69,7 +68,7 @@ namespace swift::core::application
|
||||
{
|
||||
for (const QString &pluginIdentifier : pluginIdentifiers)
|
||||
{
|
||||
if (!swift::misc::simulation::CSimulatorPluginInfo::allIdentifiers().contains(pluginIdentifier))
|
||||
if (!misc::simulation::CSimulatorPluginInfo::allIdentifiers().contains(pluginIdentifier))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -79,7 +78,7 @@ namespace swift::core::application
|
||||
};
|
||||
|
||||
//! Uploading of crash dumps is enabled or disabled
|
||||
struct TCrashDumpUploadEnabled : public swift::misc::TSettingTrait<bool>
|
||||
struct TCrashDumpUploadEnabled : misc::TSettingTrait<bool>
|
||||
{
|
||||
//! \copydoc swift::misc::TSettingTrait::key
|
||||
static const char *key() { return "application/crashdumpuploadenabled"; }
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
namespace swift::core::application
|
||||
{
|
||||
//! Update info settings, QStringList with 2 values: channel/platform
|
||||
struct TUpdatePreferences : public swift::misc::TSettingTrait<QStringList>
|
||||
struct TUpdatePreferences : misc::TSettingTrait<QStringList>
|
||||
{
|
||||
//! \copydoc swift::misc::TSettingTrait::key
|
||||
static const char *key() { return "updatepreferences"; }
|
||||
@@ -27,7 +27,7 @@ namespace swift::core::application
|
||||
static const QStringList d =
|
||||
(sApp && !sApp->getUpdateInfo().isEmpty()) ?
|
||||
sApp->getUpdateInfo().anticipateMyDefaultChannelAndPlatform() : // from cached or loaded update info
|
||||
QStringList({ "STABLE", swift::misc::CPlatform::currentPlatform().getPlatformName() });
|
||||
QStringList({ "STABLE", misc::CPlatform::currentPlatform().getPlatformName() });
|
||||
return d;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
namespace swift::core::audio
|
||||
{
|
||||
//! Audio input device settings
|
||||
struct TInputDevice : public swift::misc::TSettingTrait<QString>
|
||||
struct TInputDevice : misc::TSettingTrait<QString>
|
||||
{
|
||||
//! \copydoc swift::misc::TSettingTrait::key
|
||||
static const char *key() { return "audio/%Application%/inputdevice"; }
|
||||
@@ -34,7 +34,7 @@ namespace swift::core::audio
|
||||
};
|
||||
|
||||
//! Audio input device settings
|
||||
struct TOutputDevice : public swift::misc::TSettingTrait<QString>
|
||||
struct TOutputDevice : misc::TSettingTrait<QString>
|
||||
{
|
||||
//! \copydoc swift::misc::TSettingTrait::key
|
||||
static const char *key() { return "audio/%Application%/outputdevice"; }
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace swift::core::context
|
||||
|
||||
public:
|
||||
//! Destructor
|
||||
virtual ~IContext() override {}
|
||||
~IContext() override = default;
|
||||
|
||||
//! Log categories
|
||||
static const QStringList &getLogCategories();
|
||||
@@ -144,7 +144,7 @@ namespace swift::core::context
|
||||
//! Empty context called
|
||||
void logEmptyContextWarning(const QString &functionName) const
|
||||
{
|
||||
swift::misc::CLogMessage(this, swift::misc::CLogCategories::contextSlot())
|
||||
misc::CLogMessage(this, swift::misc::CLogCategories::contextSlot())
|
||||
.warning(u"Empty context called, details: %1")
|
||||
<< functionName;
|
||||
}
|
||||
@@ -153,7 +153,7 @@ namespace swift::core::context
|
||||
virtual void onAboutToShutdown() {}
|
||||
|
||||
//! Standard message when status message is returned in empty context
|
||||
static const swift::misc::CStatusMessage &statusMessageEmptyContext();
|
||||
static const misc::CStatusMessage &statusMessageEmptyContext();
|
||||
|
||||
private:
|
||||
CCoreFacadeConfig::ContextMode m_mode; //!< How context is used
|
||||
|
||||
@@ -69,14 +69,14 @@ namespace swift::core
|
||||
}
|
||||
|
||||
//! \copydoc IContext::getPathAndContextId()
|
||||
virtual QString getPathAndContextId() const override { return this->buildPathAndContextId(ObjectPath()); }
|
||||
QString getPathAndContextId() const override { return this->buildPathAndContextId(ObjectPath()); }
|
||||
|
||||
//! Factory method
|
||||
static IContextApplication *create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode,
|
||||
swift::misc::CDBusServer *server, QDBusConnection &connection);
|
||||
|
||||
//! Destructor
|
||||
virtual ~IContextApplication() override {}
|
||||
~IContextApplication() override = default;
|
||||
|
||||
signals:
|
||||
//! A component changes
|
||||
@@ -99,56 +99,54 @@ namespace swift::core
|
||||
//! Ratify some settings changed by another process
|
||||
//! \note Not pure because it can be called from the base class constructor.
|
||||
//! \note This is the function which relays cache changes via DBus.
|
||||
virtual void changeSettings(const swift::misc::CValueCachePacket &settings,
|
||||
const swift::misc::CIdentifier &origin);
|
||||
virtual void changeSettings(const misc::CValueCachePacket &settings, const misc::CIdentifier &origin);
|
||||
|
||||
//! Get all settings currently in core settings cache
|
||||
virtual swift::misc::CValueCachePacket getAllSettings() const = 0;
|
||||
virtual misc::CValueCachePacket getAllSettings() const = 0;
|
||||
|
||||
//! Get keys of all unsaved settings currently in core settings cache
|
||||
virtual QStringList getUnsavedSettingsKeys() const = 0;
|
||||
|
||||
//! Get keys and descriptions of all unsaved settings currently in core settings cache
|
||||
virtual swift::core::context::CSettingsDictionary getUnsavedSettingsKeysDescribed() const = 0;
|
||||
virtual CSettingsDictionary getUnsavedSettingsKeysDescribed() const = 0;
|
||||
|
||||
//! Update local settings with settings from core
|
||||
virtual void synchronizeLocalSettings() = 0;
|
||||
|
||||
//! Save core settings to disk
|
||||
virtual swift::misc::CStatusMessage saveSettings(const QString &keyPrefix = {}) = 0;
|
||||
virtual misc::CStatusMessage saveSettings(const QString &keyPrefix = {}) = 0;
|
||||
|
||||
//! Save core settings to disk
|
||||
virtual swift::misc::CStatusMessage saveSettingsByKey(const QStringList &keys) = 0;
|
||||
virtual misc::CStatusMessage saveSettingsByKey(const QStringList &keys) = 0;
|
||||
|
||||
//! Load core settings from disk
|
||||
virtual swift::misc::CStatusMessage loadSettings() = 0;
|
||||
virtual misc::CStatusMessage loadSettings() = 0;
|
||||
|
||||
//! Register hotkey action implemented by another process
|
||||
//! \note Not pure because it can be called from the base class constructor.
|
||||
//! \note This is the function which relays action registrations via DBus
|
||||
virtual void registerHotkeyActions(const QStringList &actions, const swift::misc::CIdentifier &origin);
|
||||
virtual void registerHotkeyActions(const QStringList &actions, const misc::CIdentifier &origin);
|
||||
|
||||
//! Call a hotkey action on a remote process
|
||||
//! \note Not pure because it can be called from the base class constructor.
|
||||
//! \note This is the function which relays action calls via DBus
|
||||
virtual void callHotkeyActionRemotely(const QString &action, bool argument,
|
||||
const swift::misc::CIdentifier &origin);
|
||||
const misc::CIdentifier &origin);
|
||||
|
||||
//! Register application, can also be used for ping
|
||||
virtual swift::misc::CIdentifier registerApplication(const swift::misc::CIdentifier &application) = 0;
|
||||
virtual misc::CIdentifier registerApplication(const misc::CIdentifier &application) = 0;
|
||||
|
||||
//! Unregister application
|
||||
virtual void unregisterApplication(const swift::misc::CIdentifier &application) = 0;
|
||||
virtual void unregisterApplication(const misc::CIdentifier &application) = 0;
|
||||
|
||||
//! All registered applications
|
||||
virtual swift::misc::CIdentifierList getRegisteredApplications() const = 0;
|
||||
virtual misc::CIdentifierList getRegisteredApplications() const = 0;
|
||||
|
||||
//! Identifier of application, remote side if distributed
|
||||
virtual swift::misc::CIdentifier getApplicationIdentifier() const = 0;
|
||||
virtual misc::CIdentifier getApplicationIdentifier() const = 0;
|
||||
|
||||
//! Forward to facade
|
||||
virtual bool parseCommandLine(const QString &commandLine,
|
||||
const swift::misc::CIdentifier &originator) override;
|
||||
bool parseCommandLine(const QString &commandLine, const swift::misc::CIdentifier &originator) override;
|
||||
|
||||
protected:
|
||||
static constexpr int PingIdentifiersMs = 20000; //!< how often identifiers are pinged
|
||||
|
||||
@@ -33,38 +33,38 @@ namespace swift::core
|
||||
|
||||
public slots:
|
||||
//! \copydoc swift::core::context::CContextAudioBase::getRegisteredDevices
|
||||
virtual swift::misc::audio::CAudioDeviceInfoList getRegisteredDevices() const override;
|
||||
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;
|
||||
|
||||
protected:
|
||||
//! Constructor
|
||||
CContextAudio(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime);
|
||||
|
||||
//! Register myself in DBus
|
||||
CContextAudio *registerWithDBus(swift::misc::CDBusServer *server);
|
||||
CContextAudio *registerWithDBus(misc::CDBusServer *server);
|
||||
|
||||
private:
|
||||
swift::misc::audio::CAudioDeviceInfoList m_registeredDevices;
|
||||
QMap<swift::misc::CIdentifier, swift::misc::aviation::CCallsign> m_registeredCallsigns;
|
||||
misc::audio::CAudioDeviceInfoList m_registeredDevices;
|
||||
QMap<misc::CIdentifier, misc::aviation::CCallsign> m_registeredCallsigns;
|
||||
};
|
||||
} // namespace context
|
||||
} // namespace swift::core
|
||||
|
||||
@@ -65,23 +65,23 @@ namespace swift::core::context
|
||||
static const QString &ObjectPath();
|
||||
|
||||
//! \copydoc IContext::getPathAndContextId()
|
||||
virtual QString getPathAndContextId() const override { return this->buildPathAndContextId(ObjectPath()); }
|
||||
QString getPathAndContextId() const override { return this->buildPathAndContextId(ObjectPath()); }
|
||||
|
||||
//! Factory method
|
||||
static IContextSimulator *create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode,
|
||||
swift::misc::CDBusServer *server, QDBusConnection &connection);
|
||||
|
||||
//! Destructor
|
||||
virtual ~IContextSimulator() override {}
|
||||
~IContextSimulator() override {}
|
||||
|
||||
//! Get simulator status as enum
|
||||
//! \fixme To be removed with Qt 5.5 when getSimualtorStatus directly provides the enum
|
||||
swift::core::ISimulator::SimulatorStatus getSimulatorStatusEnum() const;
|
||||
ISimulator::SimulatorStatus getSimulatorStatusEnum() const;
|
||||
|
||||
// ---- some convenienc functions implemented on interface level
|
||||
|
||||
//! Current simulator
|
||||
swift::misc::simulation::CSimulatorInfo getSimulatorInfo() const;
|
||||
misc::simulation::CSimulatorInfo getSimulatorInfo() const;
|
||||
|
||||
signals:
|
||||
//! Simulator combined status
|
||||
|
||||
@@ -49,6 +49,7 @@ using namespace swift::misc::weather;
|
||||
using namespace swift::misc::simulation;
|
||||
using namespace swift::misc::simulation::settings;
|
||||
using namespace swift::misc::simulation::data;
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
namespace swift::core::context
|
||||
{
|
||||
@@ -71,7 +72,7 @@ namespace swift::core::context
|
||||
|
||||
// deferred init of last model set, if no other data are set in meantime
|
||||
const QPointer<CContextSimulator> myself(this);
|
||||
QTimer::singleShot(2500, this, [=] {
|
||||
QTimer::singleShot(2500ms, this, [=] {
|
||||
if (!myself) { return; }
|
||||
this->initByLastUsedModelSet();
|
||||
m_aircraftMatcher.setSetup(m_matchingSettings.get());
|
||||
|
||||
@@ -13,7 +13,6 @@ namespace swift::core
|
||||
//! Modes, how GUI can be started (core/GUI)
|
||||
struct CoreModes
|
||||
{
|
||||
public:
|
||||
//! Core runs how and where?
|
||||
enum CoreMode
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace swift::core
|
||||
{
|
||||
CInputManager::CInputManager(QObject *parent) : QObject(parent) { reloadHotkeySettings(); }
|
||||
|
||||
void CInputManager::registerAction(const QString &action, swift::misc::CIcons::IconIndex icon)
|
||||
void CInputManager::registerAction(const QString &action, CIcons::IconIndex icon)
|
||||
{
|
||||
if (!m_availableActions.contains(action))
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace swift::misc::aviation
|
||||
};
|
||||
|
||||
//! Default constructor.
|
||||
CAircraftCategory() {}
|
||||
CAircraftCategory() = default;
|
||||
|
||||
//! Constructor.
|
||||
CAircraftCategory(const QString &name, const QString &description, const QString &path, bool assignable);
|
||||
@@ -123,10 +123,10 @@ namespace swift::misc::aviation
|
||||
void setAssignable(bool assignable) { m_assignable = assignable; }
|
||||
|
||||
//! \copydoc swift::misc::mixin::Index::propertyByIndex
|
||||
QVariant propertyByIndex(swift::misc::CPropertyIndexRef index) const;
|
||||
QVariant propertyByIndex(CPropertyIndexRef index) const;
|
||||
|
||||
//! \copydoc swift::misc::mixin::Index::setPropertyByIndex
|
||||
void setPropertyByIndex(swift::misc::CPropertyIndexRef index, const QVariant &variant);
|
||||
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant);
|
||||
|
||||
//! \copydoc swift::misc::mixin::Index::comparePropertyByIndex
|
||||
int comparePropertyByIndex(CPropertyIndexRef index, const CAircraftCategory &compareValue) const;
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace swift::misc
|
||||
};
|
||||
|
||||
//! Constructor
|
||||
CCountry() {}
|
||||
CCountry() = default;
|
||||
|
||||
//! Constructor
|
||||
CCountry(const QString &iso, const QString &name);
|
||||
|
||||
@@ -27,8 +27,8 @@ namespace swift::misc
|
||||
//! \remark: I do not use CCollection as I want to sort per column
|
||||
class SWIFT_MISC_EXPORT CCountryList :
|
||||
public CSequence<CCountry>,
|
||||
public swift::misc::db::IDatastoreObjectList<CCountry, CCountryList, QString>,
|
||||
public swift::misc::mixin::MetaType<CCountryList>
|
||||
public db::IDatastoreObjectList<CCountry, CCountryList, QString>,
|
||||
public mixin::MetaType<CCountryList>
|
||||
{
|
||||
public:
|
||||
SWIFT_MISC_DECLARE_USING_MIXIN_METATYPE(CCountryList)
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace swift::misc::db
|
||||
//! \note requires distributions
|
||||
network::CRemoteFile asRemoteFile() const;
|
||||
|
||||
//! Newer tahn the current build
|
||||
//! Newer than the current build
|
||||
bool isNewerThanCurrentBuild() const;
|
||||
|
||||
//! \copydoc swift::misc::mixin::String::toQString
|
||||
@@ -158,7 +158,7 @@ namespace swift::misc::db
|
||||
//! Trim the 4th segment of a version string
|
||||
static QString trimVersionString(const QString &version);
|
||||
|
||||
//! Trim a strin representing 4th segment
|
||||
//! Trim a string representing 4th segment
|
||||
static QString trim4thSegment(const QString &seg);
|
||||
|
||||
SWIFT_METACLASS(
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace swift::misc
|
||||
}
|
||||
|
||||
//! Destructor
|
||||
virtual ~CDigestSignal() {}
|
||||
~CDigestSignal() override = default;
|
||||
|
||||
signals:
|
||||
//! Send digest signal
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace swift::misc
|
||||
};
|
||||
|
||||
//! Constructor
|
||||
CDirectories() {}
|
||||
CDirectories() = default;
|
||||
|
||||
//! Flight plan directory
|
||||
const QString &getFlightPlanDirectory() const { return m_dirFlightPlan; }
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace swift::misc
|
||||
CFileLogger(QObject *parent = nullptr);
|
||||
|
||||
//! Destructor.
|
||||
virtual ~CFileLogger();
|
||||
~CFileLogger() override;
|
||||
|
||||
//! Change the log pattern. Default is to log all messages.
|
||||
void changeLogPattern(const CLogPattern &pattern) { m_logPattern = pattern; }
|
||||
|
||||
@@ -48,6 +48,5 @@ namespace swift::misc
|
||||
} // namespace swift::misc
|
||||
|
||||
Q_DECLARE_METATYPE(swift::misc::CIdentifierList)
|
||||
// in set: Q_DECLARE_METATYPE(swift::misc::CCollection<swift::misc::CIdentifier>)
|
||||
|
||||
#endif // SWIFT_MISC_IDENTIFIERLIST_H
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace swift::misc
|
||||
CLogHandler();
|
||||
|
||||
//! \private Destructor.
|
||||
virtual ~CLogHandler();
|
||||
~CLogHandler() override;
|
||||
|
||||
//! Return pointer to the CLogHandler singleton.
|
||||
//! \warning This can not be called from within a plugin, because the returned instance will be wrong.
|
||||
@@ -150,7 +150,7 @@ namespace swift::misc
|
||||
*
|
||||
* When all slots are disconnected from this signal, the CLogPatternHandler could be deleted.
|
||||
*
|
||||
* Note that if a message matches more that one handler's pattern, then this signal will be emitted for all of
|
||||
* Note that if a message matches more than one handler's pattern, then this signal will be emitted for all of
|
||||
* those handlers, so if a slot is connected to all of them then it will be called multiple times. Use the
|
||||
* methods CStatusMessage::markAsHandledBy() and CStatusMessage::wasHandledBy() to detect this case in the slot
|
||||
* and avoid multiple handlings of the same message. Caveat: for this to work, the slot must take its argument
|
||||
@@ -180,7 +180,7 @@ namespace swift::misc
|
||||
|
||||
protected:
|
||||
//! \copydoc QObject::connectNotify
|
||||
virtual void connectNotify(const QMetaMethod &signal) override
|
||||
void connectNotify(const QMetaMethod &signal) override
|
||||
{
|
||||
if (signal == QMetaMethod::fromSignal(&CLogPatternHandler::messageLogged))
|
||||
{
|
||||
@@ -189,7 +189,7 @@ namespace swift::misc
|
||||
}
|
||||
|
||||
//! \copydoc QObject::disconnectNotify
|
||||
virtual void disconnectNotify(const QMetaMethod &signal) override
|
||||
void disconnectNotify(const QMetaMethod &signal) override
|
||||
{
|
||||
if (signal == QMetaMethod::fromSignal(&CLogPatternHandler::messageLogged))
|
||||
{
|
||||
|
||||
@@ -63,8 +63,8 @@ namespace swift::misc
|
||||
void elementsReplaced(const swift::misc::CStatusMessageList &msgs);
|
||||
|
||||
private:
|
||||
virtual void onElementAdded(const CStatusMessage &msg) override final;
|
||||
virtual void onElementsReplaced(const CStatusMessageList &msgs) override final;
|
||||
void onElementAdded(const CStatusMessage &msg) final;
|
||||
void onElementsReplaced(const CStatusMessageList &msgs) final;
|
||||
};
|
||||
} // namespace swift::misc
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace swift::misc
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
CObfuscation() {}
|
||||
CObfuscation() = default;
|
||||
|
||||
//! Decode string if it has the prefix, otherwise do nothing with it
|
||||
static QString decode(const QString &inString, bool trimmed = true);
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace swift::misc
|
||||
{
|
||||
public:
|
||||
//! Default constructor.
|
||||
Optional() noexcept {}
|
||||
Optional() noexcept = default;
|
||||
|
||||
//! Construct from a value.
|
||||
Optional(T value) noexcept(std::is_nothrow_move_constructible_v<T>)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace swift::misc::simulation::data
|
||||
{
|
||||
//! Last model used
|
||||
struct TLastModel : public swift::misc::TDataTrait<CAircraftModel>
|
||||
struct TLastModel : TDataTrait<CAircraftModel>
|
||||
{
|
||||
//! \copydoc swift::misc::TSettingTrait::key
|
||||
static const char *key() { return "lastaircraftmodel"; }
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace swift::misc::simulation::data
|
||||
|
||||
CSimulatorInfo IMultiSimulatorModelCaches::otherVersionSimulatorsWithFile(const CApplicationInfo &info) const
|
||||
{
|
||||
CSimulatorInfo sim = CSimulatorInfo(CSimulatorInfo::None);
|
||||
CSimulatorInfo sim(CSimulatorInfo::None);
|
||||
if (this->hasOtherVersionFile(info, CSimulatorInfo::fsx())) { sim.addSimulator(CSimulatorInfo::fsx()); }
|
||||
if (this->hasOtherVersionFile(info, CSimulatorInfo::p3d())) { sim.addSimulator(CSimulatorInfo::p3d()); }
|
||||
if (this->hasOtherVersionFile(info, CSimulatorInfo::fs9())) { sim.addSimulator(CSimulatorInfo::fs9()); }
|
||||
@@ -119,7 +119,7 @@ namespace swift::misc::simulation::data
|
||||
|
||||
CSimulatorInfo IMultiSimulatorModelCaches::getSimulatorForFilename(const QString &filename) const
|
||||
{
|
||||
if (filename.isEmpty()) { return CSimulatorInfo(); }
|
||||
if (filename.isEmpty()) { return {}; }
|
||||
CSimulatorInfo sims;
|
||||
const QString compareFileName(QFileInfo(filename).fileName());
|
||||
for (const CSimulatorInfo &singleSim : CSimulatorInfo::allSimulatorsSet())
|
||||
|
||||
@@ -179,11 +179,10 @@ namespace swift::misc::simulation::data
|
||||
|
||||
public:
|
||||
//! \copydoc IModelsForSimulatorSetable::setModelsForSimulator
|
||||
virtual void setModelsForSimulator(const CAircraftModelList &models, const CSimulatorInfo &simulator) override;
|
||||
void setModelsForSimulator(const CAircraftModelList &models, const CSimulatorInfo &simulator) override;
|
||||
|
||||
//! \copydoc IModelsForSimulatorUpdatable::updateModelsForSimulator
|
||||
virtual int updateModelsForSimulator(const CAircraftModelList &models,
|
||||
const CSimulatorInfo &simulator) override;
|
||||
int updateModelsForSimulator(const CAircraftModelList &models, const CSimulatorInfo &simulator) override;
|
||||
|
||||
//! Models for simulator
|
||||
//! \threadsafe
|
||||
@@ -306,6 +305,7 @@ namespace swift::misc::simulation::data
|
||||
//! Emit cacheChanged() utility function (allows breakpoint)
|
||||
void emitCacheChanged(const CSimulatorInfo &simulator);
|
||||
|
||||
private:
|
||||
//! @{
|
||||
//! Cache synchronized flag
|
||||
std::atomic_bool m_syncFsx { false };
|
||||
@@ -332,16 +332,15 @@ namespace swift::misc::simulation::data
|
||||
|
||||
//! \name Interface implementations
|
||||
//! @{
|
||||
virtual CAircraftModelList getCachedModels(const CSimulatorInfo &simulator) const override;
|
||||
virtual CStatusMessage setCachedModels(const CAircraftModelList &models,
|
||||
const CSimulatorInfo &simulator) override;
|
||||
virtual QDateTime getCacheTimestamp(const CSimulatorInfo &simulator) const override;
|
||||
virtual CStatusMessage setCacheTimestamp(const QDateTime &ts, const CSimulatorInfo &simulator) override;
|
||||
virtual void synchronizeCache(const CSimulatorInfo &simulator) override;
|
||||
virtual void admitCache(const CSimulatorInfo &simulator) override;
|
||||
virtual QString getFilename(const CSimulatorInfo &simulator) const override;
|
||||
virtual bool isSaved(const CSimulatorInfo &simulator) const override;
|
||||
virtual QString getDescription() const override { return "Model caches"; }
|
||||
CAircraftModelList getCachedModels(const CSimulatorInfo &simulator) const override;
|
||||
CStatusMessage setCachedModels(const CAircraftModelList &models, const CSimulatorInfo &simulator) override;
|
||||
QDateTime getCacheTimestamp(const CSimulatorInfo &simulator) const override;
|
||||
CStatusMessage setCacheTimestamp(const QDateTime &ts, const CSimulatorInfo &simulator) override;
|
||||
void synchronizeCache(const CSimulatorInfo &simulator) override;
|
||||
void admitCache(const CSimulatorInfo &simulator) override;
|
||||
QString getFilename(const CSimulatorInfo &simulator) const override;
|
||||
bool isSaved(const CSimulatorInfo &simulator) const override;
|
||||
QString getDescription() const override { return "Model caches"; }
|
||||
//! @}
|
||||
|
||||
private:
|
||||
@@ -375,16 +374,15 @@ namespace swift::misc::simulation::data
|
||||
|
||||
//! \name Interface implementations
|
||||
//! @{
|
||||
virtual CAircraftModelList getCachedModels(const CSimulatorInfo &simulator) const override;
|
||||
virtual CStatusMessage setCachedModels(const CAircraftModelList &models,
|
||||
const CSimulatorInfo &simulator) override;
|
||||
virtual QDateTime getCacheTimestamp(const CSimulatorInfo &simulator) const override;
|
||||
virtual CStatusMessage setCacheTimestamp(const QDateTime &ts, const CSimulatorInfo &simulator) override;
|
||||
virtual void synchronizeCache(const CSimulatorInfo &simulator) override;
|
||||
virtual void admitCache(const CSimulatorInfo &simulator) override;
|
||||
virtual QString getFilename(const CSimulatorInfo &simulator) const override;
|
||||
virtual bool isSaved(const CSimulatorInfo &simulator) const override;
|
||||
virtual QString getDescription() const override { return "Model sets"; }
|
||||
CAircraftModelList getCachedModels(const CSimulatorInfo &simulator) const override;
|
||||
CStatusMessage setCachedModels(const CAircraftModelList &models, const CSimulatorInfo &simulator) override;
|
||||
QDateTime getCacheTimestamp(const CSimulatorInfo &simulator) const override;
|
||||
CStatusMessage setCacheTimestamp(const QDateTime &ts, const CSimulatorInfo &simulator) override;
|
||||
void synchronizeCache(const CSimulatorInfo &simulator) override;
|
||||
void admitCache(const CSimulatorInfo &simulator) override;
|
||||
QString getFilename(const CSimulatorInfo &simulator) const override;
|
||||
bool isSaved(const CSimulatorInfo &simulator) const override;
|
||||
QString getDescription() const override { return "Model sets"; }
|
||||
//! @}
|
||||
|
||||
private:
|
||||
@@ -412,56 +410,49 @@ namespace swift::misc::simulation::data
|
||||
//! @{
|
||||
|
||||
//! \copydoc swift::misc::simulation::data::IMultiSimulatorModelCaches::getCachedModels
|
||||
virtual CAircraftModelList getCachedModels(const CSimulatorInfo &simulator) const override
|
||||
CAircraftModelList getCachedModels(const CSimulatorInfo &simulator) const override
|
||||
{
|
||||
return instanceCaches().getCachedModels(simulator);
|
||||
}
|
||||
|
||||
//! \copydoc swift::misc::simulation::data::IMultiSimulatorModelCaches::setCachedModels
|
||||
virtual CStatusMessage setCachedModels(const CAircraftModelList &models,
|
||||
const CSimulatorInfo &simulator) override
|
||||
CStatusMessage setCachedModels(const CAircraftModelList &models, const CSimulatorInfo &simulator) override
|
||||
{
|
||||
return instanceCaches().setCachedModels(models, simulator);
|
||||
}
|
||||
|
||||
//! \copydoc swift::misc::simulation::data::IMultiSimulatorModelCaches::getCacheTimestamp
|
||||
virtual QDateTime getCacheTimestamp(const CSimulatorInfo &simulator) const override
|
||||
QDateTime getCacheTimestamp(const CSimulatorInfo &simulator) const override
|
||||
{
|
||||
return instanceCaches().getCacheTimestamp(simulator);
|
||||
}
|
||||
|
||||
//! \copydoc swift::misc::simulation::data::IMultiSimulatorModelCaches::setCacheTimestamp
|
||||
virtual CStatusMessage setCacheTimestamp(const QDateTime &ts, const CSimulatorInfo &simulator) override
|
||||
CStatusMessage setCacheTimestamp(const QDateTime &ts, const CSimulatorInfo &simulator) override
|
||||
{
|
||||
return instanceCaches().setCacheTimestamp(ts, simulator);
|
||||
}
|
||||
|
||||
//! \copydoc swift::misc::simulation::data::IMultiSimulatorModelCaches::synchronizeCache
|
||||
virtual void synchronizeCache(const CSimulatorInfo &simulator) override
|
||||
void synchronizeCache(const CSimulatorInfo &simulator) override
|
||||
{
|
||||
return instanceCaches().synchronizeCache(simulator);
|
||||
}
|
||||
|
||||
//! \copydoc swift::misc::simulation::data::IMultiSimulatorModelCaches::admitCache
|
||||
virtual void admitCache(const CSimulatorInfo &simulator) override
|
||||
{
|
||||
return instanceCaches().admitCache(simulator);
|
||||
}
|
||||
void admitCache(const CSimulatorInfo &simulator) override { return instanceCaches().admitCache(simulator); }
|
||||
|
||||
//! \copydoc swift::misc::simulation::data::IMultiSimulatorModelCaches::getFilename
|
||||
virtual QString getFilename(const CSimulatorInfo &simulator) const override
|
||||
QString getFilename(const CSimulatorInfo &simulator) const override
|
||||
{
|
||||
return instanceCaches().getFilename(simulator);
|
||||
}
|
||||
|
||||
//! \copydoc swift::misc::simulation::data::IMultiSimulatorModelCaches::isSaved
|
||||
virtual bool isSaved(const CSimulatorInfo &simulator) const override
|
||||
{
|
||||
return instanceCaches().isSaved(simulator);
|
||||
}
|
||||
bool isSaved(const CSimulatorInfo &simulator) const override { return instanceCaches().isSaved(simulator); }
|
||||
|
||||
//! \copydoc swift::misc::simulation::data::IMultiSimulatorModelCaches::getDescription
|
||||
virtual QString getDescription() const override { return instanceCaches().getDescription(); }
|
||||
QString getDescription() const override { return instanceCaches().getDescription(); }
|
||||
//! @}
|
||||
|
||||
protected:
|
||||
@@ -584,13 +575,13 @@ namespace swift::misc::simulation::data
|
||||
//! @}
|
||||
|
||||
//! \copydoc IModelsForSimulatorSetable::setModelsForSimulator
|
||||
virtual void setModelsForSimulator(const CAircraftModelList &models, const CSimulatorInfo &simulator) override
|
||||
void setModelsForSimulator(const CAircraftModelList &models, const CSimulatorInfo &simulator) override
|
||||
{
|
||||
CCentralMultiSimulatorModelCachesProvider::modelCachesInstance().setModelsForSimulator(models, simulator);
|
||||
}
|
||||
|
||||
//! \copydoc IModelsForSimulatorUpdatable::updateModelsForSimulator
|
||||
virtual int updateModelsForSimulator(const CAircraftModelList &models, const CSimulatorInfo &simulator) override
|
||||
int updateModelsForSimulator(const CAircraftModelList &models, const CSimulatorInfo &simulator) override
|
||||
{
|
||||
return CCentralMultiSimulatorModelCachesProvider::modelCachesInstance().updateModelsForSimulator(models,
|
||||
simulator);
|
||||
@@ -692,14 +683,14 @@ namespace swift::misc::simulation::data
|
||||
//! @}
|
||||
|
||||
//! \copydoc IModelsForSimulatorSetable::setModelsForSimulator
|
||||
virtual void setModelsForSimulator(const CAircraftModelList &models, const CSimulatorInfo &simulator) override
|
||||
void setModelsForSimulator(const CAircraftModelList &models, const CSimulatorInfo &simulator) override
|
||||
{
|
||||
CCentralMultiSimulatorModelSetCachesProvider::modelCachesInstance().setModelsForSimulator(models,
|
||||
simulator);
|
||||
}
|
||||
|
||||
//! \copydoc IModelsForSimulatorUpdatable::updateModelsForSimulator
|
||||
virtual int updateModelsForSimulator(const CAircraftModelList &models, const CSimulatorInfo &simulator) override
|
||||
int updateModelsForSimulator(const CAircraftModelList &models, const CSimulatorInfo &simulator) override
|
||||
{
|
||||
return CCentralMultiSimulatorModelSetCachesProvider::modelCachesInstance().updateModelsForSimulator(
|
||||
models, simulator);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace swift::misc::simulation::flightgear
|
||||
{
|
||||
//! Flightgear aircraft model loader
|
||||
class CAircraftModelLoaderFlightgear : public simulation::IAircraftModelLoader
|
||||
class CAircraftModelLoaderFlightgear : public IAircraftModelLoader
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -20,25 +20,23 @@ namespace swift::misc::simulation::flightgear
|
||||
CAircraftModelLoaderFlightgear(QObject *parent = nullptr);
|
||||
|
||||
//! Virtual destructor
|
||||
virtual ~CAircraftModelLoaderFlightgear() override;
|
||||
~CAircraftModelLoaderFlightgear() override;
|
||||
|
||||
//! Parsed or injected models
|
||||
void updateInstalledModels(const CAircraftModelList &models);
|
||||
|
||||
//! \copydoc IAircraftModelLoader::isLoadingFinished
|
||||
virtual bool isLoadingFinished() const override;
|
||||
bool isLoadingFinished() const override;
|
||||
|
||||
protected:
|
||||
//! \copydoc 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:
|
||||
QString getModelString(const QString &filePath, bool ai);
|
||||
simulation::CAircraftModelList parseFlyableAirplanes(const QString &rootDirectory,
|
||||
const QStringList &excludeDirectories);
|
||||
simulation::CAircraftModelList parseAIAirplanes(const QString &rootDirectory,
|
||||
const QStringList &excludeDirectories);
|
||||
CAircraftModelList parseFlyableAirplanes(const QString &rootDirectory, const QStringList &excludeDirectories);
|
||||
CAircraftModelList parseAIAirplanes(const QString &rootDirectory, const QStringList &excludeDirectories);
|
||||
void addUniqueModel(const CAircraftModel &model, CAircraftModelList &models);
|
||||
QPointer<CWorker> m_parserWorker;
|
||||
CAircraftModelList performParsing(const QStringList &rootDirectories, const QStringList &excludeDirectories);
|
||||
|
||||
@@ -179,7 +179,7 @@ namespace swift::misc::simulation::fscommon
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
private:
|
||||
int m_index; //!< current index in given config
|
||||
int m_index {}; //!< current index in given config
|
||||
QString m_fileName; //!< file name of .cfg
|
||||
QString m_title; //!< Title in .cfg
|
||||
QString m_atcType; //!< ATC type
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace swift::misc
|
||||
CVPilotRulesReader(bool standardDirectory = true, QObject *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
virtual ~CVPilotRulesReader();
|
||||
~CVPilotRulesReader() override;
|
||||
|
||||
//! Files
|
||||
//! \threadsafe
|
||||
@@ -97,7 +97,7 @@ namespace swift::misc
|
||||
swift::misc::CWorker *readInBackground(bool convertToModels);
|
||||
|
||||
private slots:
|
||||
//! Asyncronous read finished
|
||||
//! Asynchronous read finished
|
||||
//! \threadsafe
|
||||
void ps_readInBackgroundFinished();
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace swift::misc
|
||||
using CSequence::CSequence;
|
||||
|
||||
//! Constructor
|
||||
CStatusMessageList() {}
|
||||
CStatusMessageList() = default;
|
||||
|
||||
//! Construct from a base class object.
|
||||
CStatusMessageList(const CSequence<CStatusMessage> &other);
|
||||
|
||||
@@ -159,7 +159,7 @@ namespace swift::misc
|
||||
//! Latest timestamp
|
||||
QDateTime latestTimestamp() const
|
||||
{
|
||||
if (this->container().isEmpty()) { return QDateTime(); }
|
||||
if (this->container().isEmpty()) { return {}; }
|
||||
return this->latestObject().getUtcTimestamp();
|
||||
}
|
||||
|
||||
|
||||
@@ -12,15 +12,13 @@ SWIFT_DEFINE_VALUEOBJECT_MIXINS(swift::misc::weather, CCloudLayer)
|
||||
namespace swift::misc::weather
|
||||
{
|
||||
|
||||
CCloudLayer::CCloudLayer(const swift::misc::aviation::CAltitude &base, const swift::misc::aviation::CAltitude &top,
|
||||
Coverage coverage)
|
||||
: m_base(base), m_top(top)
|
||||
CCloudLayer::CCloudLayer(const CAltitude &base, const CAltitude &top, Coverage coverage) : m_base(base), m_top(top)
|
||||
{
|
||||
setCoverage(coverage);
|
||||
}
|
||||
|
||||
CCloudLayer::CCloudLayer(const swift::misc::aviation::CAltitude &base, const swift::misc::aviation::CAltitude &top,
|
||||
double precipitationRate, Precipitation precipitation, Clouds clouds, Coverage coverage)
|
||||
CCloudLayer::CCloudLayer(const CAltitude &base, const CAltitude &top, double precipitationRate,
|
||||
Precipitation precipitation, Clouds clouds, Coverage coverage)
|
||||
: m_base(base), m_top(top), m_precipitationRate(precipitationRate), m_precipitation(precipitation),
|
||||
m_clouds(clouds)
|
||||
{
|
||||
@@ -38,11 +36,10 @@ namespace swift::misc::weather
|
||||
return None;
|
||||
}
|
||||
|
||||
QVariant CCloudLayer::propertyByIndex(swift::misc::CPropertyIndexRef index) const
|
||||
QVariant CCloudLayer::propertyByIndex(CPropertyIndexRef index) const
|
||||
{
|
||||
if (index.isMyself()) { return QVariant::fromValue(*this); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
switch (index.frontCasted<ColumnIndex>())
|
||||
{
|
||||
case IndexBase: return QVariant::fromValue(m_base);
|
||||
case IndexTop: return QVariant::fromValue(m_top);
|
||||
@@ -61,8 +58,7 @@ namespace swift::misc::weather
|
||||
(*this) = variant.value<CCloudLayer>();
|
||||
return;
|
||||
}
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
switch (index.frontCasted<ColumnIndex>())
|
||||
{
|
||||
case IndexBase: setBase(variant.value<CAltitude>()); break;
|
||||
case IndexTop: setTop(variant.value<CAltitude>()); break;
|
||||
|
||||
@@ -72,24 +72,23 @@ namespace swift::misc::weather
|
||||
CCloudLayer() = default;
|
||||
|
||||
//! Constructor
|
||||
CCloudLayer(const swift::misc::aviation::CAltitude &base, const swift::misc::aviation::CAltitude &top,
|
||||
Coverage coverage);
|
||||
CCloudLayer(const misc::aviation::CAltitude &base, const misc::aviation::CAltitude &top, Coverage coverage);
|
||||
|
||||
//! Constructor
|
||||
CCloudLayer(const swift::misc::aviation::CAltitude &base, const swift::misc::aviation::CAltitude &top,
|
||||
CCloudLayer(const misc::aviation::CAltitude &base, const misc::aviation::CAltitude &top,
|
||||
double precipitationRate, Precipitation precipitation, Clouds clouds, Coverage coverage);
|
||||
|
||||
//! Set base
|
||||
void setBase(const swift::misc::aviation::CAltitude &base) { m_base = base; }
|
||||
void setBase(const misc::aviation::CAltitude &base) { m_base = base; }
|
||||
|
||||
//! Get base
|
||||
swift::misc::aviation::CAltitude getBase() const { return m_base; }
|
||||
misc::aviation::CAltitude getBase() const { return m_base; }
|
||||
|
||||
//! Set layer top
|
||||
void setTop(const swift::misc::aviation::CAltitude &top) { m_top = top; }
|
||||
void setTop(const misc::aviation::CAltitude &top) { m_top = top; }
|
||||
|
||||
//! Get layer top
|
||||
swift::misc::aviation::CAltitude getTop() const { return m_top; }
|
||||
misc::aviation::CAltitude getTop() const { return m_top; }
|
||||
|
||||
//! Set precipitation rate in mm/h
|
||||
void setPrecipitationRate(double rate) { m_precipitationRate = rate; }
|
||||
@@ -131,12 +130,12 @@ namespace swift::misc::weather
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
private:
|
||||
swift::misc::aviation::CAltitude m_base;
|
||||
swift::misc::aviation::CAltitude m_top;
|
||||
aviation::CAltitude m_base;
|
||||
aviation::CAltitude m_top;
|
||||
double m_precipitationRate = 0; //!< Unit mm/h
|
||||
Precipitation m_precipitation = NoPrecipitation;
|
||||
Clouds m_clouds = NoClouds;
|
||||
int m_coveragePercent;
|
||||
int m_coveragePercent {};
|
||||
|
||||
SWIFT_METACLASS(
|
||||
CCloudLayer,
|
||||
|
||||
@@ -39,10 +39,10 @@ namespace swift::misc
|
||||
CCloudLayerList(const CSequence<CCloudLayer> &other);
|
||||
|
||||
//! Contains cloud layer with base?
|
||||
bool containsBase(const swift::misc::aviation::CAltitude &base) const;
|
||||
bool containsBase(const aviation::CAltitude &base) const;
|
||||
|
||||
//! Find cloud layer by base
|
||||
CCloudLayer findByBase(const swift::misc::aviation::CAltitude &base) const;
|
||||
CCloudLayer findByBase(const aviation::CAltitude &base) const;
|
||||
};
|
||||
|
||||
} // namespace weather
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace swift::misc::weather
|
||||
{
|
||||
public:
|
||||
//! Destructor
|
||||
virtual ~IMetarDecoderPart() {}
|
||||
virtual ~IMetarDecoderPart() = default;
|
||||
|
||||
//! Decoder type ("name")
|
||||
virtual QString getDecoderType() const = 0;
|
||||
@@ -98,7 +98,7 @@ namespace swift::misc::weather
|
||||
class CMetarDecoderReportType : public IMetarDecoderPart
|
||||
{
|
||||
public:
|
||||
virtual QString getDecoderType() const override { return "ReportType"; }
|
||||
QString getDecoderType() const override { return "ReportType"; }
|
||||
|
||||
protected:
|
||||
const QRegularExpression &getRegExp() const override
|
||||
@@ -116,7 +116,7 @@ namespace swift::misc::weather
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool isMandatory() const override { return false; }
|
||||
bool isMandatory() const override { return false; }
|
||||
|
||||
private:
|
||||
const QHash<QString, CMetar::ReportType> &getReportTypeHash() const
|
||||
@@ -130,7 +130,7 @@ namespace swift::misc::weather
|
||||
class CMetarDecoderAirport : public IMetarDecoderPart
|
||||
{
|
||||
public:
|
||||
virtual QString getDecoderType() const override { return "Airport"; }
|
||||
QString getDecoderType() const override { return "Airport"; }
|
||||
|
||||
protected:
|
||||
const QRegularExpression &getRegExp() const override
|
||||
@@ -147,13 +147,13 @@ namespace swift::misc::weather
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool isMandatory() const override { return true; }
|
||||
bool isMandatory() const override { return true; }
|
||||
};
|
||||
|
||||
class CMetarDecoderDayTime : public IMetarDecoderPart
|
||||
{
|
||||
public:
|
||||
virtual QString getDecoderType() const override { return "DayTime"; }
|
||||
QString getDecoderType() const override { return "DayTime"; }
|
||||
|
||||
protected:
|
||||
const QRegularExpression &getRegExp() const override
|
||||
@@ -179,13 +179,13 @@ namespace swift::misc::weather
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool isMandatory() const override { return true; }
|
||||
bool isMandatory() const override { return true; }
|
||||
};
|
||||
|
||||
class CMetarDecoderStatus : public IMetarDecoderPart
|
||||
{
|
||||
public:
|
||||
virtual QString getDecoderType() const override { return "Status"; }
|
||||
QString getDecoderType() const override { return "Status"; }
|
||||
|
||||
protected:
|
||||
// Possible matches:
|
||||
@@ -210,13 +210,13 @@ namespace swift::misc::weather
|
||||
else { return false; }
|
||||
}
|
||||
|
||||
virtual bool isMandatory() const override { return false; }
|
||||
bool isMandatory() const override { return false; }
|
||||
};
|
||||
|
||||
class CMetarDecoderWind : public IMetarDecoderPart
|
||||
{
|
||||
public:
|
||||
virtual QString getDecoderType() const override { return "Wind"; }
|
||||
QString getDecoderType() const override { return "Wind"; }
|
||||
|
||||
protected:
|
||||
const QHash<QString, CSpeedUnit> &getWindUnitHash() const
|
||||
@@ -271,7 +271,7 @@ namespace swift::misc::weather
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool isMandatory() const override { return false; }
|
||||
bool isMandatory() const override { return false; }
|
||||
|
||||
private:
|
||||
QString getRegExpImpl() const
|
||||
@@ -293,7 +293,7 @@ namespace swift::misc::weather
|
||||
class CMetarDecoderVariationsWindDirection : public IMetarDecoderPart
|
||||
{
|
||||
public:
|
||||
virtual QString getDecoderType() const override { return "WindDirection"; }
|
||||
QString getDecoderType() const override { return "WindDirection"; }
|
||||
|
||||
protected:
|
||||
const QRegularExpression &getRegExp() const override
|
||||
@@ -321,7 +321,7 @@ namespace swift::misc::weather
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool isMandatory() const override { return false; }
|
||||
bool isMandatory() const override { return false; }
|
||||
|
||||
private:
|
||||
QString getRegExpImpl() const
|
||||
@@ -339,7 +339,7 @@ namespace swift::misc::weather
|
||||
class CMetarDecoderVisibility : public IMetarDecoderPart
|
||||
{
|
||||
public:
|
||||
virtual QString getDecoderType() const override { return "Visibility"; }
|
||||
QString getDecoderType() const override { return "Visibility"; }
|
||||
|
||||
protected:
|
||||
const QHash<QString, QString> &getCardinalDirections() const
|
||||
@@ -406,7 +406,7 @@ namespace swift::misc::weather
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool isMandatory() const override { return false; }
|
||||
bool isMandatory() const override { return false; }
|
||||
|
||||
private:
|
||||
QString getRegExpImpl() const
|
||||
@@ -436,7 +436,7 @@ namespace swift::misc::weather
|
||||
class CMetarDecoderRunwayVisualRange : public IMetarDecoderPart
|
||||
{
|
||||
public:
|
||||
virtual QString getDecoderType() const override { return "RunwayVisualRange"; }
|
||||
QString getDecoderType() const override { return "RunwayVisualRange"; }
|
||||
|
||||
protected:
|
||||
const QRegularExpression &getRegExp() const override
|
||||
@@ -464,7 +464,7 @@ namespace swift::misc::weather
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool isMandatory() const override { return false; }
|
||||
bool isMandatory() const override { return false; }
|
||||
|
||||
private:
|
||||
QString getRegExpImpl() const
|
||||
@@ -493,7 +493,7 @@ namespace swift::misc::weather
|
||||
class CMetarDecoderPresentWeather : public IMetarDecoderPart
|
||||
{
|
||||
public:
|
||||
virtual QString getDecoderType() const override { return "PresentWeather"; }
|
||||
QString getDecoderType() const override { return "PresentWeather"; }
|
||||
|
||||
protected:
|
||||
const QHash<QString, CPresentWeather::Intensity> &getIntensityHash() const
|
||||
@@ -545,7 +545,7 @@ namespace swift::misc::weather
|
||||
return hash;
|
||||
}
|
||||
|
||||
virtual bool isRepeatable() const override { return true; }
|
||||
bool isRepeatable() const override { return true; }
|
||||
|
||||
const QRegularExpression &getRegExp() const override
|
||||
{
|
||||
@@ -575,7 +575,7 @@ namespace swift::misc::weather
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool isMandatory() const override { return false; }
|
||||
bool isMandatory() const override { return false; }
|
||||
|
||||
private:
|
||||
QString getRegExpImpl() const
|
||||
@@ -604,7 +604,7 @@ namespace swift::misc::weather
|
||||
class CMetarDecoderCloud : public IMetarDecoderPart
|
||||
{
|
||||
public:
|
||||
virtual QString getDecoderType() const override { return "Cloud"; }
|
||||
QString getDecoderType() const override { return "Cloud"; }
|
||||
|
||||
protected:
|
||||
const QStringList &getClearSkyTokens() const
|
||||
@@ -623,7 +623,7 @@ namespace swift::misc::weather
|
||||
return hash;
|
||||
}
|
||||
|
||||
virtual bool isRepeatable() const override { return true; }
|
||||
bool isRepeatable() const override { return true; }
|
||||
|
||||
const QRegularExpression &getRegExp() const override
|
||||
{
|
||||
@@ -660,7 +660,7 @@ namespace swift::misc::weather
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool isMandatory() const override { return false; }
|
||||
bool isMandatory() const override { return false; }
|
||||
|
||||
private:
|
||||
QString getRegExpImpl() const
|
||||
@@ -683,7 +683,7 @@ namespace swift::misc::weather
|
||||
class CMetarDecoderVerticalVisibility : public IMetarDecoderPart
|
||||
{
|
||||
public:
|
||||
virtual QString getDecoderType() const override { return "VerticalVisibility"; }
|
||||
QString getDecoderType() const override { return "VerticalVisibility"; }
|
||||
|
||||
protected:
|
||||
const QRegularExpression &getRegExp() const override
|
||||
@@ -698,7 +698,7 @@ namespace swift::misc::weather
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool isMandatory() const override { return false; }
|
||||
bool isMandatory() const override { return false; }
|
||||
|
||||
private:
|
||||
QString getRegExpImpl() const
|
||||
@@ -713,7 +713,7 @@ namespace swift::misc::weather
|
||||
class CMetarDecoderTemperature : public IMetarDecoderPart
|
||||
{
|
||||
public:
|
||||
virtual QString getDecoderType() const override { return "Temperature"; }
|
||||
QString getDecoderType() const override { return "Temperature"; }
|
||||
|
||||
protected:
|
||||
const QRegularExpression &getRegExp() const override
|
||||
@@ -756,7 +756,7 @@ namespace swift::misc::weather
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool isMandatory() const override { return false; }
|
||||
bool isMandatory() const override { return false; }
|
||||
|
||||
private:
|
||||
QString getRegExpImpl() const
|
||||
@@ -776,7 +776,7 @@ namespace swift::misc::weather
|
||||
class CMetarDecoderPressure : public IMetarDecoderPart
|
||||
{
|
||||
public:
|
||||
virtual QString getDecoderType() const override { return "Pressure"; }
|
||||
QString getDecoderType() const override { return "Pressure"; }
|
||||
|
||||
protected:
|
||||
const QHash<QString, CPressureUnit> &getPressureUnits() const
|
||||
@@ -822,7 +822,7 @@ namespace swift::misc::weather
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool isMandatory() const override { return false; }
|
||||
bool isMandatory() const override { return false; }
|
||||
|
||||
private:
|
||||
QString getRegExpImpl() const
|
||||
@@ -842,7 +842,7 @@ namespace swift::misc::weather
|
||||
class CMetarDecoderRecentWeather : public IMetarDecoderPart
|
||||
{
|
||||
public:
|
||||
virtual QString getDecoderType() const override { return "RecentWeather"; }
|
||||
QString getDecoderType() const override { return "RecentWeather"; }
|
||||
|
||||
protected:
|
||||
const QRegularExpression &getRegExp() const override
|
||||
@@ -857,7 +857,7 @@ namespace swift::misc::weather
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool isMandatory() const override { return false; }
|
||||
bool isMandatory() const override { return false; }
|
||||
|
||||
private:
|
||||
QString getRegExpImpl() const
|
||||
@@ -884,7 +884,7 @@ namespace swift::misc::weather
|
||||
class CMetarDecoderWindShear : public IMetarDecoderPart
|
||||
{
|
||||
public:
|
||||
virtual QString getDecoderType() const override { return "WindShear"; }
|
||||
QString getDecoderType() const override { return "WindShear"; }
|
||||
|
||||
protected:
|
||||
const QRegularExpression &getRegExp() const override
|
||||
@@ -906,7 +906,7 @@ namespace swift::misc::weather
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool isMandatory() const override { return false; }
|
||||
bool isMandatory() const override { return false; }
|
||||
|
||||
private:
|
||||
QString getRegExpImpl() const
|
||||
@@ -935,7 +935,7 @@ namespace swift::misc::weather
|
||||
{
|
||||
const QString type = decoder->getDecoderType();
|
||||
CLogMessage(this).debug() << "Invalid METAR:" << metarString << type;
|
||||
return CMetar();
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace swift::misc::weather
|
||||
CMetarDecoder();
|
||||
|
||||
//! Default destructor
|
||||
virtual ~CMetarDecoder() override;
|
||||
~CMetarDecoder() override;
|
||||
|
||||
//! Decode metar
|
||||
CMetar decode(const QString &metarString) const;
|
||||
|
||||
@@ -43,11 +43,11 @@ namespace swift::misc
|
||||
CRegularThread(QObject *parent = nullptr) : QThread(parent) {}
|
||||
|
||||
//! Destructor
|
||||
virtual ~CRegularThread() override;
|
||||
~CRegularThread() override;
|
||||
|
||||
protected:
|
||||
//! \copydoc QThread::run
|
||||
virtual void run() override;
|
||||
void run() override;
|
||||
|
||||
private:
|
||||
std::atomic<void *> m_handle { nullptr };
|
||||
@@ -148,7 +148,7 @@ namespace swift::misc
|
||||
CWorkerBase();
|
||||
|
||||
//! Destructor.
|
||||
virtual ~CWorkerBase() override;
|
||||
~CWorkerBase() override;
|
||||
|
||||
//! For the task to check whether it can finish early.
|
||||
//! \threadsafe
|
||||
@@ -289,11 +289,11 @@ namespace swift::misc
|
||||
//! Stops the thread the next time around its event loop.
|
||||
//! The thread and the worker will then be deleted.
|
||||
//! \threadsafe
|
||||
virtual void quit() noexcept final override;
|
||||
void quit() noexcept final;
|
||||
|
||||
//! Calls quit() and blocks until the thread is finished.
|
||||
//! \threadsafe Will deadlock if called by the worker thread.
|
||||
virtual void quitAndWait() noexcept final override;
|
||||
void quitAndWait() noexcept final;
|
||||
|
||||
//! Enabled (running)?
|
||||
//! \threadsafe
|
||||
|
||||
Reference in New Issue
Block a user