mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 18:25:37 +08:00
Minor fixes: Formatting, string generation
This commit is contained in:
committed by
Mathew Sutcliffe
parent
7e95d4a550
commit
5f18707c9c
@@ -17,7 +17,6 @@ namespace BlackMisc
|
||||
{
|
||||
namespace Aviation
|
||||
{
|
||||
|
||||
CAircraftEngine::CAircraftEngine(int number, bool on) : m_number(number), m_on(on)
|
||||
{
|
||||
Q_ASSERT_X(number > 0, "CAircraftEngine", "Engine number have to be > 1");
|
||||
@@ -32,11 +31,8 @@ namespace BlackMisc
|
||||
QString CAircraftEngine::convertToQString(bool i18n) const
|
||||
{
|
||||
Q_UNUSED(i18n);
|
||||
QString s = QString::number(m_number);
|
||||
s += " ";
|
||||
s += BlackMisc::boolToOnOff(m_on);
|
||||
return s;
|
||||
static const QString s("%1 on: %2");
|
||||
return s.arg(m_number).arg(BlackMisc::boolToOnOff(m_on));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -18,21 +18,21 @@ namespace BlackMisc
|
||||
{
|
||||
namespace Aviation
|
||||
{
|
||||
|
||||
QString CHeading::convertToQString(bool i18n) const
|
||||
{
|
||||
QString s = CAngle::convertToQString(i18n).append(" ");
|
||||
static const QString s("%1 %2");
|
||||
if (i18n)
|
||||
{
|
||||
return s.append(this->isMagneticHeading() ?
|
||||
QCoreApplication::translate("Aviation", "magnetic") :
|
||||
QCoreApplication::translate("Aviation", "true"));
|
||||
return s.arg(CAngle::convertToQString(i18n),
|
||||
this->isMagneticHeading() ?
|
||||
QCoreApplication::translate("Aviation", "magnetic") :
|
||||
QCoreApplication::translate("Aviation", "true"));
|
||||
}
|
||||
else
|
||||
{
|
||||
return s.append(this->isMagneticHeading() ? "magnetic" : "true");
|
||||
return s.arg(CAngle::convertToQString(i18n),
|
||||
this->isMagneticHeading() ? "magnetic" : "true");
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -35,19 +35,18 @@ namespace BlackMisc
|
||||
QString CFsdSetup::convertToQString(bool i18n) const
|
||||
{
|
||||
Q_UNUSED(i18n);
|
||||
QString s("Codec: ");
|
||||
s.append(" ").append(this->m_textCodec);
|
||||
s.append(" details:").append(sendReceiveDetailsToString(this->getSendReceiveDetails()));
|
||||
static const QString s("Codec: '%1' details: '%2'");
|
||||
s.arg(this->getTextCodec(), CFsdSetup::sendReceiveDetailsToString(this->getSendReceiveDetails()));
|
||||
return s;
|
||||
}
|
||||
|
||||
QString CFsdSetup::sendReceiveDetailsToString(SendReceiveDetails details)
|
||||
{
|
||||
QString ds("Send parts; %1 interim: %2 Receive parts: %3 interim: %4");
|
||||
return ds.arg(boolToYesNo(details.testFlag(SendAircraftParts))).
|
||||
arg(boolToYesNo(details.testFlag(SendIterimPositions))).
|
||||
arg(boolToYesNo(details.testFlag(ReceiveAircraftParts))).
|
||||
arg(boolToYesNo(details.testFlag(ReceiveInterimPositions)));
|
||||
static const QString ds("Send parts; %1 interim: %2 Receive parts: %3 interim: %4");
|
||||
return ds.arg(boolToYesNo(details.testFlag(SendAircraftParts)),
|
||||
boolToYesNo(details.testFlag(SendIterimPositions)),
|
||||
boolToYesNo(details.testFlag(ReceiveAircraftParts)),
|
||||
boolToYesNo(details.testFlag(ReceiveInterimPositions)));
|
||||
}
|
||||
|
||||
void CFsdSetup::setSendReceiveDetails(bool partsSend, bool partsReceive, bool interimSend, bool interimReceive)
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace BlackMisc
|
||||
if (IDatastoreObjectWithStringKey::canHandleIndex(index)) { return IDatastoreObjectWithStringKey::propertyByIndex(index); }
|
||||
if (IOrderable::canHandleIndex(index)) { return IOrderable::propertyByIndex(index); }
|
||||
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexAlias1: return CVariant::from(this->m_alias1);
|
||||
@@ -76,7 +76,7 @@ namespace BlackMisc
|
||||
if (IDatastoreObjectWithStringKey::canHandleIndex(index)) { IDatastoreObjectWithStringKey::setPropertyByIndex(index, variant); return; }
|
||||
if (IOrderable::canHandleIndex(index)) { IOrderable::setPropertyByIndex(index, variant); return; }
|
||||
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexAlias1:
|
||||
@@ -101,7 +101,8 @@ namespace BlackMisc
|
||||
{
|
||||
if (IDatastoreObjectWithStringKey::canHandleIndex(index)) { return IDatastoreObjectWithStringKey::comparePropertyByIndex(index, compareValue); }
|
||||
if (IOrderable::canHandleIndex(index)) { return IOrderable::comparePropertyByIndex(index, compareValue); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
|
||||
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexAlias1: return this->m_alias1.compare(compareValue.m_alias1, Qt::CaseInsensitive);
|
||||
@@ -118,7 +119,7 @@ namespace BlackMisc
|
||||
QString CDistributor::convertToQString(bool i18n) const
|
||||
{
|
||||
Q_UNUSED(i18n);
|
||||
QString s = QString("Id: %1").arg(m_dbKey);
|
||||
QString s = QString("Id: '%1'").arg(m_dbKey);
|
||||
if (this->hasAlias1()) { s.append(" ").append(m_alias1); }
|
||||
if (this->hasAlias2()) { s.append(" ").append(m_alias2); }
|
||||
return s;
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
#ifndef BLACKMISC_SIMULATION_DISTRIBUTORLIST_H
|
||||
#define BLACKMISC_SIMULATION_DISTRIBUTORLIST_H
|
||||
|
||||
#include "blackmisc/db/datastoreobjectlist.h"
|
||||
#include "blackmisc/simulation/distributor.h"
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
#include "blackmisc/collection.h"
|
||||
#include "blackmisc/db/datastoreobjectlist.h"
|
||||
#include "blackmisc/orderablelist.h"
|
||||
#include "blackmisc/sequence.h"
|
||||
#include "blackmisc/simulation/distributor.h"
|
||||
#include "blackmisc/variant.h"
|
||||
|
||||
#include <QMetaType>
|
||||
|
||||
Reference in New Issue
Block a user