mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 23:45:35 +08:00
Ref T192, DBus utility functions, Service name empty for P2P
This commit is contained in:
@@ -93,11 +93,23 @@ namespace BlackMisc
|
||||
return sn;
|
||||
}
|
||||
|
||||
const QString &CDBusServer::coreServiceName(const QDBusConnection &connection)
|
||||
{
|
||||
static const QString empty;
|
||||
return CDBusServer::isP2PConnection(connection) ? empty : CDBusServer::coreServiceName();
|
||||
}
|
||||
|
||||
bool CDBusServer::isP2PAddress(const QString &address)
|
||||
{
|
||||
return modeOfAddress(address) == SERVERMODE_P2P;
|
||||
}
|
||||
|
||||
bool CDBusServer::isP2PConnection(const QDBusConnection &connection)
|
||||
{
|
||||
if (CDBusServer::isQtDefaultConnection(connection)) { return false; }
|
||||
return connection.name().contains(p2pConnectionName());
|
||||
}
|
||||
|
||||
bool CDBusServer::dBusAddressToHostAndPort(QString address, QString &host, int &port)
|
||||
{
|
||||
address = address.trimmed().toLower().replace(' ', "");
|
||||
@@ -170,6 +182,12 @@ namespace BlackMisc
|
||||
return "";
|
||||
}
|
||||
|
||||
QDBusConnection::RegisterOptions CDBusServer::registerOptions()
|
||||
{
|
||||
return QDBusConnection::ExportAdaptors | QDBusConnection::ExportAllSignals | QDBusConnection::ExportAllSlots;
|
||||
// return QDBusConnection::ExportAllContents;
|
||||
}
|
||||
|
||||
bool CDBusServer::registerObjectsWithP2PConnection(QDBusConnection connection)
|
||||
{
|
||||
Q_ASSERT(! m_objects.isEmpty());
|
||||
|
||||
Reference in New Issue
Block a user