PIM Manager: claim the org._01.pim.contacts.manager bus name

The same process now owns two different names on the same connection.
This is transparent for clients; it would be possible to implement
the second service in a different process.
This commit is contained in:
Patrick Ohly 2012-09-11 15:39:28 +02:00
parent f8f5ff3eeb
commit a18097e23c

View file

@ -105,8 +105,6 @@ Manager::Manager(const boost::shared_ptr<Server> &server) :
MANAGER_IFACE),
m_server(server)
{
// TODO: claim MANAGER_SERVICE name on connection
// Prevent automatic shut down during idle times, because we need
// to keep our unified address book available.
m_server->autoTermRef();
@ -140,6 +138,11 @@ void Manager::init()
// Ready, make it visible via D-Bus.
activate();
// Claim MANAGER_SERVICE name on connection.
// We don't care about the result.
GDBusCXX::DBusConnectionPtr(getConnection()).ownNameAsync(MANAGER_SERVICE,
boost::function<void (bool)>());
}
void Manager::initFolks()