mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
Formatting
This commit is contained in:
committed by
Mathew Sutcliffe
parent
eab22e86b0
commit
a22cd134f8
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user