Logo Search packages:      
Sourcecode: kdbus version File versions  Download package

bool QDBusConnection::registerObject ( const QString &  path,
QDBusObjectBase object 
)

Registers a service object for a given path.

In order to receive method calls over the DBus connection the service objects path within its host application has to be registered with the connection. See section Object paths for details.

Only one objects can be registered for a single object path, i.e. the path -> object mapping is unambiguous, similar to mapping of filesystem paths to files.

If a service object offers more than one interface it is up to the service implementation if all are implemented in the object path to this method or if the passed object is just another demultiplexer which relays the message to the interface implementor.

Parameters:
path the object path to register the object for
object the service implementation object for that path
Returns:
true if the given object is now registered for the given path or false if path is empty, object is null or another object is already registered for this path
See also:
unregisterObject()

Definition at line 322 of file qdbusconnection.cpp.

{
    if (!d || !d->connection || !object || path.isEmpty())
        return false;

    QDBusConnectionPrivate::ObjectMap::const_iterator it = d->registeredObjects.find(path);
    if (it != d->registeredObjects.end())
        return false;

    d->registeredObjects.insert(path, object);

    return true;
}


Generated by  Doxygen 1.6.0   Back to index