Skip to content

Commit

Permalink
Enable DBus IPC master mode if DBus session bus is unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
Radoslaw Buczkowski authored and jacky309 committed Apr 30, 2020
1 parent 20b6966 commit 0cc5f04
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ipc/dbus/DBusObjectRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void DBusObjectRegistry::init()
{
if (!m_initialized) {
m_initialized = true;
if (m_dbusManager.registerServiceName(m_serviceName)) {
if (!m_dbusManager.isDBusConnected() || m_dbusManager.registerServiceName(m_serviceName)) {
m_master = std::make_unique<MasterImpl>();
m_master->init();
QObject::connect(m_master.get(), &MasterImpl::objectAdded, this, &DBusObjectRegistry::onObjectAdded);
Expand Down Expand Up @@ -123,6 +123,7 @@ void DBusObjectRegistry::syncObjects()
ObjectRegistryIPCDBusProxy objectRegistryProxy;
objectRegistryProxy.ipc()->setServiceName(m_serviceName);
objectRegistryProxy.connectToServer();
Q_ASSERT(objectRegistryProxy.ready());
updateObjects(objectRegistryProxy.getObjects());
}

Expand Down

0 comments on commit 0cc5f04

Please sign in to comment.