mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
Ref T215, utility functions
* CServer * ICAO List
This commit is contained in:
@@ -152,6 +152,11 @@ namespace BlackMisc
|
||||
return m_timestampMSecsSinceEpoch >= 0;
|
||||
}
|
||||
|
||||
bool CServer::isNull() const
|
||||
{
|
||||
return this->hasUnspecifiedServerType() && !this->hasName() && m_port < 0;
|
||||
}
|
||||
|
||||
CStatusMessageList CServer::validate() const
|
||||
{
|
||||
static const CLogCategoryList cats(CLogCategoryList(this).join({ CLogCategory::validation()}));
|
||||
|
||||
@@ -101,6 +101,9 @@ namespace BlackMisc
|
||||
//! Get name
|
||||
const QString &getName() const { return m_name; }
|
||||
|
||||
//! Has name?
|
||||
bool hasName() const { return !m_name.isEmpty(); }
|
||||
|
||||
//! Set name
|
||||
void setName(const QString &name) { m_name = name.trimmed(); }
|
||||
|
||||
@@ -176,6 +179,9 @@ namespace BlackMisc
|
||||
//! Is connected?
|
||||
bool isConnected() const;
|
||||
|
||||
//! NULL?
|
||||
bool isNull() const;
|
||||
|
||||
//! Validate, provide details about issues
|
||||
CStatusMessageList validate() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user