diff options
author | Daniele E. Domenichelli <daniele.domenichelli@gmail.com> | 2011-04-18 16:21:10 (GMT) |
---|---|---|
committer | Marius Storm-Olsen <marius.storm-olsen@nokia.com> | 2011-04-18 16:25:44 (GMT) |
commit | e6c46787ff5b8ac2bd700c35b6e04d7c835b1c23 (patch) | |
tree | b703395ad8992240d6ee40295360b0f8a1ad4260 /src/dbus/qdbusconnection.cpp | |
parent | 0792182c396c531d8b9d660df97849ef094c1023 (diff) | |
download | Qt-e6c46787ff5b8ac2bd700c35b6e04d7c835b1c23.zip Qt-e6c46787ff5b8ac2bd700c35b6e04d7c835b1c23.tar.gz Qt-e6c46787ff5b8ac2bd700c35b6e04d7c835b1c23.tar.bz2 |
QtDBus: Add method QDBusConnection::disconnectFromPeer()
Merge-request: 2343
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@nokia.com>
Diffstat (limited to 'src/dbus/qdbusconnection.cpp')
-rw-r--r-- | src/dbus/qdbusconnection.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp index 6df95ec..dea7cf9 100644 --- a/src/dbus/qdbusconnection.cpp +++ b/src/dbus/qdbusconnection.cpp @@ -466,6 +466,27 @@ void QDBusConnection::disconnectFromBus(const QString &name) } /*! + \since 4.8 + + Closes the peer connection of name \a name. + + Note that if there are still QDBusConnection objects associated + with the same connection, the connection will not be closed until + all references are dropped. However, no further references can be + created using the QDBusConnection constructor. +*/ +void QDBusConnection::disconnectFromPeer(const QString &name) +{ + if (_q_manager()) { + QMutexLocker locker(&_q_manager()->mutex); + QDBusConnectionPrivate *d = _q_manager()->connection(name); + if(d && d->mode != QDBusConnectionPrivate::PeerMode) + return; + _q_manager()->removeConnection(name); + } +} + +/*! Sends the \a message over this connection, without waiting for a reply. This is suitable for errors, signals, and return values as well as calls whose return values are not necessary. |