mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-28 20:25:34 +08:00
Formatting
This commit is contained in:
committed by
Mathew Sutcliffe
parent
ff0c37ff58
commit
cb024b0245
@@ -21,7 +21,6 @@ namespace BlackCore
|
|||||||
class IVoiceChannel;
|
class IVoiceChannel;
|
||||||
namespace Context
|
namespace Context
|
||||||
{
|
{
|
||||||
|
|
||||||
//! Audio context implementation
|
//! Audio context implementation
|
||||||
class BLACKCORE_EXPORT CContextAudioEmpty : public IContextAudio
|
class BLACKCORE_EXPORT CContextAudioEmpty : public IContextAudio
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ namespace BlackGui
|
|||||||
class CUserComponent;
|
class CUserComponent;
|
||||||
class CWeatherComponent;
|
class CWeatherComponent;
|
||||||
|
|
||||||
|
|
||||||
//! Main info area of pilot client
|
//! Main info area of pilot client
|
||||||
class BLACKGUI_EXPORT CMainInfoAreaComponent : public BlackGui::CInfoArea
|
class BLACKGUI_EXPORT CMainInfoAreaComponent : public BlackGui::CInfoArea
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -298,13 +298,13 @@ namespace BlackGui
|
|||||||
void CSettingsSimulatorComponent::ps_showPluginConfig(const QString &identifier)
|
void CSettingsSimulatorComponent::ps_showPluginConfig(const QString &identifier)
|
||||||
{
|
{
|
||||||
CSimulatorPluginInfoList simDrivers(getAvailablePlugins());
|
CSimulatorPluginInfoList simDrivers(getAvailablePlugins());
|
||||||
auto selected = std::find_if(simDrivers.begin(), simDrivers.end(),
|
const auto selected = std::find_if(simDrivers.begin(), simDrivers.end(),
|
||||||
[&identifier](const CSimulatorPluginInfo & info)
|
[&identifier](const CSimulatorPluginInfo & info)
|
||||||
{
|
{
|
||||||
return info.getIdentifier() == identifier;
|
return info.getIdentifier() == identifier;
|
||||||
});
|
});
|
||||||
|
|
||||||
QString configId = m_plugins->getPluginConfigId(selected->getIdentifier());
|
const QString configId = m_plugins->getPluginConfigId(selected->getIdentifier());
|
||||||
IPluginConfig *config = m_plugins->getPluginById<IPluginConfig>(configId);
|
IPluginConfig *config = m_plugins->getPluginById<IPluginConfig>(configId);
|
||||||
if (!config)
|
if (!config)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ namespace BlackGui
|
|||||||
explicit CSettingsSimulatorComponent(QWidget *parent = nullptr);
|
explicit CSettingsSimulatorComponent(QWidget *parent = nullptr);
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
~CSettingsSimulatorComponent();
|
virtual ~CSettingsSimulatorComponent();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
//! Driver plugin enabled/disabled
|
//! Driver plugin enabled/disabled
|
||||||
@@ -87,7 +87,6 @@ namespace BlackGui
|
|||||||
bool m_pluginLoaded = false; //!< plugin loaded
|
bool m_pluginLoaded = false; //!< plugin loaded
|
||||||
BlackCore::CPluginManagerSimulator* m_plugins = nullptr;
|
BlackCore::CPluginManagerSimulator* m_plugins = nullptr;
|
||||||
BlackMisc::CSetting<BlackCore::Application::TEnabledSimulators> m_enabledSimulators { this, &CSettingsSimulatorComponent::ps_reloadPluginConfig };
|
BlackMisc::CSetting<BlackCore::Application::TEnabledSimulators> m_enabledSimulators { this, &CSettingsSimulatorComponent::ps_reloadPluginConfig };
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ namespace BlackMisc
|
|||||||
result.m_severities.clear();
|
result.m_severities.clear();
|
||||||
switch (minimumSeverity)
|
switch (minimumSeverity)
|
||||||
{
|
{
|
||||||
// there are deliberately no break statements in this switch block
|
// there are deliberately no break statements in this switch block
|
||||||
default:
|
default:
|
||||||
case CStatusMessage::SeverityDebug: result.m_severities.insert(CStatusMessage::SeverityDebug);
|
case CStatusMessage::SeverityDebug: result.m_severities.insert(CStatusMessage::SeverityDebug);
|
||||||
case CStatusMessage::SeverityInfo: result.m_severities.insert(CStatusMessage::SeverityInfo);
|
case CStatusMessage::SeverityInfo: result.m_severities.insert(CStatusMessage::SeverityInfo);
|
||||||
@@ -191,18 +191,18 @@ namespace BlackMisc
|
|||||||
default:
|
default:
|
||||||
case Everything: return true;
|
case Everything: return true;
|
||||||
case ExactMatch: return message.getCategories().contains(getString());
|
case ExactMatch: return message.getCategories().contains(getString());
|
||||||
case AnyOf: return std::any_of(m_strings.begin(), m_strings.end(), [ & ](const QString &s) { return message.getCategories().contains(s); });
|
case AnyOf: return std::any_of(m_strings.begin(), m_strings.end(), [ & ](const QString & s) { return message.getCategories().contains(s); });
|
||||||
case AllOf: return std::all_of(m_strings.begin(), m_strings.end(), [ & ](const QString &s) { return message.getCategories().contains(s); });
|
case AllOf: return std::all_of(m_strings.begin(), m_strings.end(), [ & ](const QString & s) { return message.getCategories().contains(s); });
|
||||||
case StartsWith: return message.getCategories().containsBy([this](const CLogCategory &cat) { return cat.startsWith(getPrefix()); });
|
case StartsWith: return message.getCategories().containsBy([this](const CLogCategory & cat) { return cat.startsWith(getPrefix()); });
|
||||||
case EndsWith: return message.getCategories().containsBy([this](const CLogCategory &cat) { return cat.endsWith(getSuffix()); });
|
case EndsWith: return message.getCategories().containsBy([this](const CLogCategory & cat) { return cat.endsWith(getSuffix()); });
|
||||||
case Contains: return message.getCategories().containsBy([this](const CLogCategory &cat) { return cat.contains(getSubstring()); });
|
case Contains: return message.getCategories().containsBy([this](const CLogCategory & cat) { return cat.contains(getSubstring()); });
|
||||||
case Nothing: return message.getCategories().isEmpty();
|
case Nothing: return message.getCategories().isEmpty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CLogPattern::isProperSubsetOf(const CLogPattern &other) const
|
bool CLogPattern::isProperSubsetOf(const CLogPattern &other) const
|
||||||
{
|
{
|
||||||
if (! (checkInvariants() && other.checkInvariants()))
|
if (!(checkInvariants() && other.checkInvariants()))
|
||||||
{
|
{
|
||||||
Q_ASSERT(false);
|
Q_ASSERT(false);
|
||||||
return false;
|
return false;
|
||||||
@@ -264,20 +264,20 @@ namespace BlackMisc
|
|||||||
switch (other.m_strategy)
|
switch (other.m_strategy)
|
||||||
{
|
{
|
||||||
case AnyOf: return other.m_strings.contains(m_strings) && other.m_strings.size() > m_strings.size();
|
case AnyOf: return other.m_strings.contains(m_strings) && other.m_strings.size() > m_strings.size();
|
||||||
case StartsWith: return std::all_of(m_strings.begin(), m_strings.end(), [ & ](const QString &s) { return s.startsWith(other.getPrefix()); });
|
case StartsWith: return std::all_of(m_strings.begin(), m_strings.end(), [ & ](const QString & s) { return s.startsWith(other.getPrefix()); });
|
||||||
case EndsWith: return std::all_of(m_strings.begin(), m_strings.end(), [ & ](const QString &s) { return s.endsWith(other.getSuffix()); });
|
case EndsWith: return std::all_of(m_strings.begin(), m_strings.end(), [ & ](const QString & s) { return s.endsWith(other.getSuffix()); });
|
||||||
case Contains: return std::all_of(m_strings.begin(), m_strings.end(), [ & ](const QString &s) { return s.contains(other.getSubstring()); });
|
case Contains: return std::all_of(m_strings.begin(), m_strings.end(), [ & ](const QString & s) { return s.contains(other.getSubstring()); });
|
||||||
default: ;
|
default: ;
|
||||||
}
|
}
|
||||||
case AllOf:
|
case AllOf:
|
||||||
switch (other.m_strategy)
|
switch (other.m_strategy)
|
||||||
{
|
{
|
||||||
case ExactMatch: return m_strings.contains(other.getString());
|
case ExactMatch: return m_strings.contains(other.getString());
|
||||||
case AnyOf: return ! (m_strings & other.m_strings).isEmpty();
|
case AnyOf: return !(m_strings & other.m_strings).isEmpty();
|
||||||
case AllOf: return m_strings.contains(other.m_strings) && m_strings.size() > other.m_strings.size();
|
case AllOf: return m_strings.contains(other.m_strings) && m_strings.size() > other.m_strings.size();
|
||||||
case StartsWith: return std::any_of(m_strings.begin(), m_strings.end(), [ & ](const QString &s) { return s.startsWith(other.getPrefix()); });
|
case StartsWith: return std::any_of(m_strings.begin(), m_strings.end(), [ & ](const QString & s) { return s.startsWith(other.getPrefix()); });
|
||||||
case EndsWith: return std::any_of(m_strings.begin(), m_strings.end(), [ & ](const QString &s) { return s.endsWith(other.getSuffix()); });
|
case EndsWith: return std::any_of(m_strings.begin(), m_strings.end(), [ & ](const QString & s) { return s.endsWith(other.getSuffix()); });
|
||||||
case Contains: return std::any_of(m_strings.begin(), m_strings.end(), [ & ](const QString &s) { return s.contains(other.getSubstring()); });
|
case Contains: return std::any_of(m_strings.begin(), m_strings.end(), [ & ](const QString & s) { return s.contains(other.getSubstring()); });
|
||||||
default: ;
|
default: ;
|
||||||
}
|
}
|
||||||
case StartsWith:
|
case StartsWith:
|
||||||
|
|||||||
Reference in New Issue
Block a user