mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
Formatting
This commit is contained in:
committed by
Mathew Sutcliffe
parent
eab22e86b0
commit
a22cd134f8
@@ -227,6 +227,5 @@ namespace BlackMisc
|
||||
template class BLACKMISC_EXPORT_DEFINE_TEMPLATE IDatastoreObjectList<BlackMisc::CCountry, BlackMisc::CCountryList, QString>;
|
||||
template class BLACKMISC_EXPORT_DEFINE_TEMPLATE IDatastoreObjectList<BlackMisc::Aviation::CAirport, BlackMisc::Aviation::CAirportList, int>;
|
||||
//! \endcond
|
||||
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -82,14 +82,13 @@ namespace BlackMisc
|
||||
extern template class BLACKMISC_EXPORT_DECLARE_TEMPLATE IDatastoreObjectList<BlackMisc::Aviation::CLivery, BlackMisc::Aviation::CLiveryList, int>;
|
||||
extern template class BLACKMISC_EXPORT_DECLARE_TEMPLATE IDatastoreObjectList<BlackMisc::Aviation::CAircraftIcaoCode, BlackMisc::Aviation::CAircraftIcaoCodeList, int>;
|
||||
extern template class BLACKMISC_EXPORT_DECLARE_TEMPLATE IDatastoreObjectList<BlackMisc::Aviation::CAirlineIcaoCode, BlackMisc::Aviation::CAirlineIcaoCodeList, int>;
|
||||
extern template class BLACKMISC_EXPORT_DECLARE_TEMPLATE IDatastoreObjectList<BlackMisc::Aviation::CAirport, BlackMisc::Aviation::CAirportList, int>;
|
||||
extern template class BLACKMISC_EXPORT_DECLARE_TEMPLATE IDatastoreObjectList<BlackMisc::Db::CDbInfo, BlackMisc::Db::CDbInfoList, int>;
|
||||
extern template class BLACKMISC_EXPORT_DECLARE_TEMPLATE IDatastoreObjectList<BlackMisc::Db::CDistribution, BlackMisc::Db::CDistributionList, int>;
|
||||
extern template class BLACKMISC_EXPORT_DECLARE_TEMPLATE IDatastoreObjectList<BlackMisc::Simulation::CAircraftModel, BlackMisc::Simulation::CAircraftModelList, int>;
|
||||
extern template class BLACKMISC_EXPORT_DECLARE_TEMPLATE IDatastoreObjectList<BlackMisc::Simulation::CDistributor, BlackMisc::Simulation::CDistributorList, QString>;
|
||||
extern template class BLACKMISC_EXPORT_DECLARE_TEMPLATE IDatastoreObjectList<BlackMisc::CCountry, BlackMisc::CCountryList, QString>;
|
||||
extern template class BLACKMISC_EXPORT_DECLARE_TEMPLATE IDatastoreObjectList<BlackMisc::Aviation::CAirport, BlackMisc::Aviation::CAirportList, int>;
|
||||
//! \endcond
|
||||
|
||||
} // ns
|
||||
} //ns
|
||||
|
||||
|
||||
@@ -7,23 +7,15 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "blackmisc/network/clientlist.h"
|
||||
#include "blackmisc/metaclassprivate.h"
|
||||
|
||||
#include <QString>
|
||||
#include <tuple>
|
||||
|
||||
using namespace BlackMisc::Aviation;
|
||||
#include "clientlist.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Network
|
||||
{
|
||||
|
||||
CClientList::CClientList() { }
|
||||
|
||||
CClientList::CClientList(const CSequence &other) : CSequence<CClient>(other)
|
||||
{ }
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include "blackmisc/network/client.h"
|
||||
#include "blackmisc/sequence.h"
|
||||
#include "blackmisc/variant.h"
|
||||
|
||||
#include <QMetaType>
|
||||
|
||||
namespace BlackMisc
|
||||
@@ -39,7 +38,6 @@ namespace BlackMisc
|
||||
|
||||
//! Construct from a base class object.
|
||||
CClientList(const CSequence &other);
|
||||
|
||||
};
|
||||
} //namespace
|
||||
} // namespace
|
||||
|
||||
@@ -58,7 +58,6 @@ namespace BlackMisc
|
||||
//! From our database JSON format
|
||||
static CRoleList fromDatabaseJson(const QJsonArray &array);
|
||||
};
|
||||
|
||||
} //namespace
|
||||
} // namespace
|
||||
|
||||
|
||||
@@ -234,48 +234,32 @@ namespace BlackMisc
|
||||
return q;
|
||||
}
|
||||
|
||||
CVariant CUrl::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
CVariant CUrl::propertyByIndex(const CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexHost:
|
||||
return CVariant::fromValue(this->m_host);
|
||||
case IndexPort:
|
||||
return CVariant::fromValue(this->m_port);
|
||||
case IndexScheme:
|
||||
return CVariant::fromValue(this->m_scheme);
|
||||
case IndexPath:
|
||||
return CVariant::fromValue(this->m_path);
|
||||
default:
|
||||
return CValueObject::propertyByIndex(index);
|
||||
case IndexHost: return CVariant::fromValue(this->m_host);
|
||||
case IndexPort: return CVariant::fromValue(this->m_port);
|
||||
case IndexScheme: return CVariant::fromValue(this->m_scheme);
|
||||
case IndexPath: return CVariant::fromValue(this->m_path);
|
||||
default: return CValueObject::propertyByIndex(index);
|
||||
}
|
||||
}
|
||||
|
||||
void CUrl::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
|
||||
{
|
||||
if (index.isMyself()) { (*this) = variant.to<CUrl>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexHost:
|
||||
this->setHost(variant.value<QString>());
|
||||
break;
|
||||
case IndexPort:
|
||||
this->setPort(variant.value<qint32>());
|
||||
break;
|
||||
case IndexPath:
|
||||
this->setPath(variant.value<QString>());
|
||||
break;
|
||||
case IndexScheme:
|
||||
this->setScheme(variant.value<QString>());
|
||||
break;
|
||||
default:
|
||||
CValueObject::setPropertyByIndex(index, variant);
|
||||
break;
|
||||
case IndexHost: this->setHost(variant.value<QString>()); break;
|
||||
case IndexPort: this->setPort(variant.value<qint32>()); break;
|
||||
case IndexPath: this->setPath(variant.value<QString>()); break;
|
||||
case IndexScheme: this->setScheme(variant.value<QString>()); break;
|
||||
default: CValueObject::setPropertyByIndex(index, variant); break;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISC_NETWORK_NETWORKLOCATION_H
|
||||
#define BLACKMISC_NETWORK_NETWORKLOCATION_H
|
||||
#ifndef BLACKMISC_NETWORK_URL_H
|
||||
#define BLACKMISC_NETWORK_URL_H
|
||||
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
#include "blackmisc/metaclass.h"
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISC_NETWORK_NETWORKLOCATIONLIST_H
|
||||
#define BLACKMISC_NETWORK_NETWORKLOCATIONLIST_H
|
||||
#ifndef BLACKMISC_NETWORK_URLLIST_H
|
||||
#define BLACKMISC_NETWORK_URLLIST_H
|
||||
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
#include "blackmisc/collection.h"
|
||||
@@ -26,7 +26,7 @@ namespace BlackMisc
|
||||
{
|
||||
namespace Network
|
||||
{
|
||||
//! Value object encapsulating a list of servers.
|
||||
//! Value object encapsulating a list of URLs.
|
||||
class BLACKMISC_EXPORT CUrlList :
|
||||
public CSequence<CUrl>,
|
||||
public BlackMisc::Mixin::MetaType<CUrlList>
|
||||
|
||||
@@ -174,7 +174,7 @@ namespace BlackMisc
|
||||
bool ITimestampBased::canHandleIndex(const CPropertyIndex &index)
|
||||
{
|
||||
if (index.isEmpty()) { return false; }
|
||||
int i = index.frontCasted<int>();
|
||||
const int i = index.frontCasted<int>();
|
||||
return (i >= static_cast<int>(IndexUtcTimestamp)) && (i <= static_cast<int>(IndexMSecsSinceEpoch));
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ namespace BlackMisc
|
||||
{
|
||||
if (!index.isEmpty())
|
||||
{
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexUtcTimestamp:
|
||||
@@ -212,7 +212,7 @@ namespace BlackMisc
|
||||
{
|
||||
if (!index.isEmpty())
|
||||
{
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexUtcTimestamp:
|
||||
|
||||
Reference in New Issue
Block a user