refs #199 , method to unregister DBus objects for a graceful shutdown of our DBusServer

This commit is contained in:
Klaus Basan
2014-04-08 14:39:03 +02:00
parent 62109ac7f3
commit e7c9d7d294
2 changed files with 38 additions and 3 deletions

View File

@@ -80,9 +80,14 @@ namespace BlackCore
//! \brief Connection by name
const QDBusConnection getDbusConnection(const QString &connectionName) const
/*!
* \brief Connection by name
* \param connectionName empty string makes sense with session / system DBus, otherwise provide name for P2P
* \return
*/
const QDBusConnection getDBusConnection(const QString &connectionName = "")
{
if (connectionName.isEmpty()) return this->m_DBusConnections.first();
return this->m_DBusConnections.value(connectionName, CDBusServer::defaultConnection());
}
@@ -93,7 +98,9 @@ namespace BlackCore
return this->m_DBusConnections.values();
}
//! \brief Default connection
//! Unregister all objects
void unregisterAllObjects();
//! Default connection
static const QDBusConnection &defaultConnection()
{