mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05: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");
|
||||
|
||||
Reference in New Issue
Block a user