Distributor filter improvements

* if all or none simulator is selected do not filter
* also select if there is no (NULL) simulator
This commit is contained in:
Klaus Basan
2020-03-27 15:05:26 +01:00
committed by Mat Sutcliffe
parent 00b2034b2d
commit 1642502aae
4 changed files with 24 additions and 4 deletions

View File

@@ -144,15 +144,21 @@ namespace BlackMisc
return (m_simulator & otherInfo.m_simulator) > 0;
}
bool CSimulatorInfo::matchesAnyOrNone(const CSimulatorInfo &otherInfo) const
{
if (this->isNoSimulator()) { return true; }
return this->matchesAny(otherInfo);
}
int CSimulatorInfo::comparePropertyByIndex(const CPropertyIndex &index, const CSimulatorInfo &compareValue) const
{
Q_UNUSED(index);
Q_UNUSED(index)
return Compare::compare(m_simulator, compareValue.m_simulator);
}
QString CSimulatorInfo::convertToQString(bool i18n) const
{
Q_UNUSED(i18n);
Q_UNUSED(i18n)
const Simulator s = getSimulator();
const QString str =
(s.testFlag(FSX) ? QStringLiteral("FSX ") : QString()) %

View File

@@ -132,6 +132,10 @@ namespace BlackMisc
//! Matches any simulator
bool matchesAny(const CSimulatorInfo &otherInfo) const;
//! Matches any simulator or None (NULL)
//! \remark for cases where no specified sim. also matches
bool matchesAnyOrNone(const CSimulatorInfo &otherInfo) const;
//! Simulator
Simulator getSimulator() const { return static_cast<Simulator>(m_simulator); }