mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
refs #873, allow null for lights
This commit is contained in:
committed by
Mathew Sutcliffe
parent
34f3de0dfb
commit
36fb62a6fe
@@ -10,6 +10,7 @@
|
||||
#include "blackmisc/aviation/aircraftlights.h"
|
||||
#include "blackmisc/stringutils.h"
|
||||
#include "blackmisc/variant.h"
|
||||
#include <QStringBuilder>
|
||||
|
||||
using namespace BlackMisc;
|
||||
|
||||
@@ -18,6 +19,11 @@ namespace BlackMisc
|
||||
namespace Aviation
|
||||
{
|
||||
|
||||
CAircraftLights::CAircraftLights(std::nullptr_t null) : m_isNull(true)
|
||||
{
|
||||
Q_UNUSED(null);
|
||||
}
|
||||
|
||||
CAircraftLights::CAircraftLights(bool strobeOn, bool landingOn, bool taxiOn, bool beaconOn, bool navOn, bool logoOn)
|
||||
: m_strobeOn(strobeOn), m_landingOn(landingOn), m_taxiOn(taxiOn), m_beaconOn(beaconOn), m_navOn(navOn), m_logoOn(logoOn)
|
||||
{ }
|
||||
@@ -34,19 +40,12 @@ namespace BlackMisc
|
||||
|
||||
QString CAircraftLights::convertToQString(bool /** i18n */) const
|
||||
{
|
||||
QString s;
|
||||
s += " strobe: ";
|
||||
s += boolToYesNo(m_strobeOn);
|
||||
s += " landing: ";
|
||||
s += boolToYesNo(m_landingOn);
|
||||
s += " taxi: ";
|
||||
s += boolToYesNo(m_taxiOn);
|
||||
s += " beacon: ";
|
||||
s += boolToYesNo(m_beaconOn);
|
||||
s += " nav: ";
|
||||
s += boolToYesNo(m_navOn);
|
||||
s += " logo: ";
|
||||
s += boolToYesNo(m_logoOn);
|
||||
const QString s = QLatin1Literal("strobe: ") % boolToYesNo(m_strobeOn) %
|
||||
QLatin1Literal(" landing: ") % boolToYesNo(m_landingOn) %
|
||||
QLatin1Literal(" taxi: ") % boolToYesNo(m_taxiOn) %
|
||||
QLatin1Literal(" beacon: ") % boolToYesNo(m_beaconOn) %
|
||||
QLatin1Literal(" nav: ") % boolToYesNo(m_navOn) %
|
||||
QLatin1Literal(" logo: ") % boolToYesNo(m_logoOn);
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user