mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
refs #198 , made DBus address static, so it can be used elsewhere in the settings
This commit is contained in:
@@ -21,7 +21,7 @@ namespace BlackCore
|
|||||||
CDBusServer::CDBusServer(const QString &address, QObject *parent) :
|
CDBusServer::CDBusServer(const QString &address, QObject *parent) :
|
||||||
QObject(parent), m_busServer(CDBusServer::isP2P(address) ? address : "unix:tmpdir=/tmp" , parent), m_serverMode(CDBusServer::SERVERMODE_P2P)
|
QObject(parent), m_busServer(CDBusServer::isP2P(address) ? address : "unix:tmpdir=/tmp" , parent), m_serverMode(CDBusServer::SERVERMODE_P2P)
|
||||||
{
|
{
|
||||||
if (address.isEmpty() || address.toLower() == "session")
|
if (address.isEmpty() || address.toLower() == CDBusServer::sessionDBusServer())
|
||||||
{
|
{
|
||||||
// we use a session bus connection instead of a real P2P connection
|
// we use a session bus connection instead of a real P2P connection
|
||||||
this->m_serverMode = CDBusServer::SERVERMODE_SESSIONBUS;
|
this->m_serverMode = CDBusServer::SERVERMODE_SESSIONBUS;
|
||||||
@@ -33,7 +33,7 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
this->newConnection(con);
|
this->newConnection(con);
|
||||||
}
|
}
|
||||||
else if (address.toLower() == "system")
|
else if (address.toLower() == CDBusServer::systemDBusServer())
|
||||||
{
|
{
|
||||||
// we use a system bus connection instead of a real P2P connection
|
// we use a system bus connection instead of a real P2P connection
|
||||||
this->m_serverMode = CDBusServer::SERVERMODE_SYSTEMBUS;
|
this->m_serverMode = CDBusServer::SERVERMODE_SYSTEMBUS;
|
||||||
|
|||||||
@@ -102,6 +102,20 @@ namespace BlackCore
|
|||||||
return defaultConnection;
|
return defaultConnection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! \brief Denotes a session DBus server
|
||||||
|
static const QString &sessionDBusServer()
|
||||||
|
{
|
||||||
|
static QString session("session");
|
||||||
|
return session;
|
||||||
|
}
|
||||||
|
|
||||||
|
//! \brief Denotes a session DBus server
|
||||||
|
static const QString &systemDBusServer()
|
||||||
|
{
|
||||||
|
static QString system("system");
|
||||||
|
return system;
|
||||||
|
}
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
//! \brief Called when a new DBus client has connected
|
//! \brief Called when a new DBus client has connected
|
||||||
|
|||||||
Reference in New Issue
Block a user