mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
refs #199, code formatting and Doxygen, icons, comments, typos
This commit is contained in:
@@ -62,13 +62,8 @@ namespace BlackCore
|
||||
//! Aircraft list has been changed
|
||||
void changedAircraftsInRange();
|
||||
|
||||
/*!
|
||||
* \brief Aircraft situation update
|
||||
* \param callsign
|
||||
* \param situation
|
||||
* \return
|
||||
*/
|
||||
void aircraftSituationUpdate(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CAircraftSituation &situation);
|
||||
//! Aircraft situation update
|
||||
void changedAircraftSituation(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CAircraftSituation &situation);
|
||||
|
||||
//! Terminated connection
|
||||
void connectionTerminated();
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace BlackCore
|
||||
bool CDBusServer::newConnection(const QDBusConnection &connection)
|
||||
{
|
||||
QMap<QString, QObject *>::ConstIterator i = m_objects.begin();
|
||||
QDBusConnection newConnection(connection);
|
||||
QDBusConnection newConnection(connection); // copy, because object will be registered on this connection
|
||||
m_DBusConnections.insert(newConnection.name(), newConnection);
|
||||
bool success = true;
|
||||
qDebug() << "New Connection from: " << newConnection.name();
|
||||
@@ -135,7 +135,6 @@ namespace BlackCore
|
||||
{
|
||||
Q_ASSERT_X(false, "CDBusServer::addObject", "Wrong server mode");
|
||||
}
|
||||
// Q_ASSERT_X(success, "CDBusServer::addObject", "Registration failed");
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -61,26 +61,24 @@ namespace BlackCore
|
||||
}
|
||||
|
||||
public:
|
||||
//! \brief Constructor
|
||||
//! Constructor
|
||||
CDBusServer(const QString &address, QObject *parent = nullptr);
|
||||
|
||||
//!! \brief Adds a QObject to be exposed to DBus
|
||||
//!! Adds a QObject to be exposed to DBus
|
||||
void addObject(const QString &name, QObject *object);
|
||||
|
||||
//! \brief Last error
|
||||
//! Last error
|
||||
QDBusError lastError() const;
|
||||
|
||||
//! \brief Connected?
|
||||
bool isConnected() const
|
||||
{
|
||||
return this->m_busServer.isConnected();
|
||||
}
|
||||
//! Connected?
|
||||
bool isConnected() const { return this->m_busServer.isConnected(); }
|
||||
|
||||
//! address
|
||||
QString address() const { return this->m_busServer.address(); }
|
||||
|
||||
//!
|
||||
|
||||
|
||||
//! \brief address
|
||||
QString address() const
|
||||
{
|
||||
return this->m_busServer.address();
|
||||
}
|
||||
|
||||
//! \brief Connection by name
|
||||
const QDBusConnection getDbusConnection(const QString &connectionName) const
|
||||
@@ -88,28 +86,29 @@ namespace BlackCore
|
||||
return this->m_DBusConnections.value(connectionName, CDBusServer::defaultConnection());
|
||||
}
|
||||
|
||||
//! \brief Get DBbus connections
|
||||
const QList<QDBusConnection> getDbusConnections() const
|
||||
//! Get DBus connections
|
||||
const QList<QDBusConnection> getDBusConnections() const
|
||||
{
|
||||
// http://stackoverflow.com/questions/1124340/any-ideas-why-qhash-and-qmap-return-const-t-instead-of-const-t
|
||||
return this->m_DBusConnections.values();
|
||||
}
|
||||
|
||||
//! \brief Default connection
|
||||
//! Default connection
|
||||
static const QDBusConnection &defaultConnection()
|
||||
{
|
||||
static QDBusConnection defaultConnection("default");
|
||||
return defaultConnection;
|
||||
}
|
||||
|
||||
//! \brief Denotes a session DBus server
|
||||
//! Denotes a session DBus server
|
||||
static const QString &sessionDBusServer()
|
||||
{
|
||||
static QString session("session");
|
||||
return session;
|
||||
}
|
||||
|
||||
//! \brief Denotes a session DBus server
|
||||
//! Denotes a session DBus server
|
||||
static const QString &systemDBusServer()
|
||||
{
|
||||
static QString system("system");
|
||||
|
||||
@@ -29,9 +29,7 @@ namespace BlackMisc
|
||||
TypeGui
|
||||
};
|
||||
|
||||
/*!
|
||||
* \brief Status severities
|
||||
*/
|
||||
//! Status severities
|
||||
enum StatusSeverity
|
||||
{
|
||||
SeverityInfo,
|
||||
@@ -39,9 +37,7 @@ namespace BlackMisc
|
||||
SeverityError
|
||||
};
|
||||
|
||||
/*!
|
||||
* \brief Properties by index
|
||||
*/
|
||||
//! Properties by index
|
||||
enum ColumnIndex
|
||||
{
|
||||
IndexType,
|
||||
@@ -60,46 +56,43 @@ namespace BlackMisc
|
||||
QDateTime m_timestamp;
|
||||
|
||||
public:
|
||||
//! \brief Constructor
|
||||
//! Constructor
|
||||
CStatusMessage() : m_type(TypeUnknown), m_severity(SeverityInfo) {}
|
||||
|
||||
//! \brief Constructor
|
||||
//! Constructor
|
||||
CStatusMessage(StatusType type, StatusSeverity severity, const char *message);
|
||||
|
||||
//! Constructor
|
||||
CStatusMessage(StatusType type, StatusSeverity severity, const QString &message);
|
||||
|
||||
//! \brief Status type
|
||||
StatusType getType() const
|
||||
{
|
||||
return this->m_type;
|
||||
}
|
||||
//! Status type
|
||||
StatusType getType() const { return this->m_type; }
|
||||
|
||||
//! \brief Status severity
|
||||
StatusSeverity getSeverity() const
|
||||
{
|
||||
return this->m_severity;
|
||||
}
|
||||
//! Status severity
|
||||
StatusSeverity getSeverity() const { return this->m_severity; }
|
||||
|
||||
//! \brief Message
|
||||
QString getMessage() const
|
||||
{
|
||||
return this->m_message;
|
||||
}
|
||||
//! Message
|
||||
QString getMessage() const { return this->m_message; }
|
||||
|
||||
//! Message empty
|
||||
bool isEmpty() const { return this->m_message.isEmpty(); }
|
||||
|
||||
//! \copydoc CValueObject::getValueHash()
|
||||
virtual uint getValueHash() const override;
|
||||
|
||||
//! \copydoc CValueObject::toQVariant()
|
||||
virtual QVariant toQVariant() const override
|
||||
{
|
||||
return QVariant::fromValue(*this);
|
||||
}
|
||||
virtual QVariant toQVariant() const override { return QVariant::fromValue(*this); }
|
||||
|
||||
//! \brief Type as string
|
||||
//! Type as string
|
||||
const QString &getTypeAsString() const;
|
||||
|
||||
//! \brief representing icon
|
||||
//! Severity
|
||||
void setSeverity(StatusSeverity severity) { this->m_severity = severity; }
|
||||
|
||||
//! Representing icon
|
||||
virtual const QPixmap &toIcon() const override { return CStatusMessage::convertToIcon(*this); }
|
||||
|
||||
//! \brief Type as string
|
||||
//! Type as string
|
||||
const QString &getSeverityAsString() const;
|
||||
|
||||
//! \copydoc CValueObject::propertyByIndex(int)
|
||||
@@ -111,22 +104,25 @@ namespace BlackMisc
|
||||
//! \copydoc CValueObject::propertyByIndexAsString
|
||||
virtual QString propertyByIndexAsString(int index, bool i18n) const override;
|
||||
|
||||
//! \brief Equal operator ==
|
||||
//! To HTML
|
||||
QString toHtml() const;
|
||||
|
||||
//! Equal operator ==
|
||||
bool operator ==(const CStatusMessage &other) const;
|
||||
|
||||
//! \brief Unequal operator !=
|
||||
//! Unequal operator !=
|
||||
bool operator !=(const CStatusMessage &other) const;
|
||||
|
||||
//! \brief Register metadata
|
||||
//! Register metadata
|
||||
static void registerMetadata();
|
||||
|
||||
//! \brief Validation error
|
||||
//! Validation error
|
||||
static CStatusMessage getValidationError(const QString &message);
|
||||
|
||||
//! \brief (Unspecific) Info message
|
||||
//! (Unspecific) Info message
|
||||
static CStatusMessage getInfoMessage(const QString &message, StatusType type = CStatusMessage::TypeUnspecific);
|
||||
|
||||
//! \brief representing icon
|
||||
//! Representing icon
|
||||
static const QPixmap &convertToIcon(const CStatusMessage &statusMessage);
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user