I create a DBus service and add objects to it.
QDBusConnection connection = QDBusConnection::sessionBus();
connection.registerService(serviceName); // name, e.g. "foo"
QDBusConnection::sessionBus().registerObject(path, object, myoptions);
Fine, I can see my objects under "service" in the DBus monitor. Now I want to add more objects, but from another program (which is related, but independent).
There connection.registerService(serviceName);
fails, as the service already exists. How would I be able to register more objects under the same service name?
Background: I have clients consuming the services. They do not know who provides the services, but just the service name. So they always refer to the same service name. But several providers shall provide the service.
I have tried to use no service name (empty string, just relying on the object path). But the proxies based on
QDBusAbstractInterface(serviceName, path, interfaceName.toUtf8().constData(), connection, parent)
do not seem to work with an empty ("") serviceName
(correct?).