mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 02:45:33 +08:00
refs #485, remove all objects when closing DBusServer
This commit is contained in:
committed by
Mathew Sutcliffe
parent
4a0bc5dda3
commit
79cbcbc88f
@@ -82,6 +82,11 @@ namespace BlackMisc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CDBusServer::~CDBusServer()
|
||||||
|
{
|
||||||
|
this->removeAllObjects();
|
||||||
|
}
|
||||||
|
|
||||||
const QString &CDBusServer::coreServiceName()
|
const QString &CDBusServer::coreServiceName()
|
||||||
{
|
{
|
||||||
static const QString sn = SWIFT_SERVICENAME;
|
static const QString sn = SWIFT_SERVICENAME;
|
||||||
@@ -93,7 +98,7 @@ namespace BlackMisc
|
|||||||
const QString program = QStringLiteral("dbus-daemon");
|
const QString program = QStringLiteral("dbus-daemon");
|
||||||
const QStringList arguments = { QStringLiteral("--config-file=../share/dbus-1/session.conf") };
|
const QStringList arguments = { QStringLiteral("--config-file=../share/dbus-1/session.conf") };
|
||||||
bool success = QProcess::startDetached(program, arguments);
|
bool success = QProcess::startDetached(program, arguments);
|
||||||
if (!success) { CLogMessage(this).warning("Failed to launch dbus-daemon!"); }
|
if (!success) { CLogMessage(this).error("Failed to launch dbus-daemon!"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CDBusServer::isP2PAddress(const QString &address)
|
bool CDBusServer::isP2PAddress(const QString &address)
|
||||||
|
|||||||
@@ -56,6 +56,9 @@ namespace BlackMisc
|
|||||||
//! Construct a server for some arbitrary service
|
//! Construct a server for some arbitrary service
|
||||||
CDBusServer(const QString &service, const QString &address, QObject *parent = nullptr);
|
CDBusServer(const QString &service, const QString &address, QObject *parent = nullptr);
|
||||||
|
|
||||||
|
//! Destructor
|
||||||
|
virtual ~CDBusServer();
|
||||||
|
|
||||||
//! Add a QObject to be exposed via DBus
|
//! Add a QObject to be exposed via DBus
|
||||||
void addObject(const QString &name, QObject *object);
|
void addObject(const QString &name, QObject *object);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user