diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-10-23 17:28:35 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-10-28 09:16:19 (GMT) |
commit | 26c5680cf5adbf0c87357d84f2e2a6256724d4b7 (patch) | |
tree | 17a2e89561a590b76db368161034409abd167f3b /src/dbus | |
parent | 95d68417bfced3458e72ab3fdbc8f97ab15dd1db (diff) | |
download | Qt-26c5680cf5adbf0c87357d84f2e2a6256724d4b7.zip Qt-26c5680cf5adbf0c87357d84f2e2a6256724d4b7.tar.gz Qt-26c5680cf5adbf0c87357d84f2e2a6256724d4b7.tar.bz2 |
Fix the use of the owner when connecting the service "watcher".
Use null services to indicate we're not interested in the owner, but
empty-but-not-null to indicate we don't know what the owner is. Since
empty service names are not valid, this will mean that this rule won't
match.
Diffstat (limited to 'src/dbus')
-rw-r--r-- | src/dbus/qdbusabstractinterface.cpp | 11 | ||||
-rw-r--r-- | src/dbus/qdbusintegrator.cpp | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/dbus/qdbusabstractinterface.cpp b/src/dbus/qdbusabstractinterface.cpp index bea365a..994da10 100644 --- a/src/dbus/qdbusabstractinterface.cpp +++ b/src/dbus/qdbusabstractinterface.cpp @@ -560,9 +560,16 @@ void QDBusAbstractInterface::connectNotify(const char *signal) return; QDBusConnectionPrivate *conn = d->connectionPrivate(); - if (conn) - conn->connectRelay(d->service, d->currentOwner, d->path, d->interface, + if (conn) { + // do we know what our owner is? + QString owner; + if (!d->service.isEmpty() && d->currentOwner.isNull()) + owner = QLatin1String(""); + else + owner = d->currentOwner; + conn->connectRelay(d->service, owner, d->path, d->interface, this, signal); + } } /*! diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index 9e41708..8fff8b3 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -1487,7 +1487,7 @@ void QDBusConnectionPrivate::handleSignal(const QString &key, const QDBusMessage //qDBusDebug() << signalHooks.keys(); for ( ; it != end && it.key() == key; ++it) { const SignalHook &hook = it.value(); - if (!hook.owner.isEmpty() && hook.owner != msg.service()) + if (!hook.owner.isNull() && hook.owner != msg.service()) continue; if (!hook.path.isEmpty() && hook.path != msg.path()) continue; |