Ref T195, DBus server utility function

This commit is contained in:
Klaus Basan
2017-11-16 01:58:41 +01:00
parent 31237b758e
commit 424d748f25
2 changed files with 11 additions and 0 deletions

View File

@@ -130,6 +130,14 @@ namespace BlackMisc
}
}
bool CDBusServer::dBusAddressToHostAndPort(QString dbusAddress, QString &o_host, QString &o_port)
{
int port;
const bool s = dBusAddressToHostAndPort(dbusAddress, o_host, port);
o_port = QString::number(port);
return s;
}
bool CDBusServer::isQtDefaultConnection(const QDBusConnection &connection)
{
return connection.name() == QDBusConnection::sessionBus().name() ||

View File

@@ -119,6 +119,9 @@ namespace BlackMisc
//! Extract host and port from a DBus address
static bool dBusAddressToHostAndPort(QString dbusAddress, QString &o_host, int &o_port);
//! Extract host and port from a DBus address
static bool dBusAddressToHostAndPort(QString dbusAddress, QString &o_host, QString &o_port);
//! Is the given connection one of the default connections?
static bool isQtDefaultConnection(const QDBusConnection &connection);