diff options
author | Daniele E. Domenichelli <daniele.domenichelli@gmail.com> | 2011-04-18 16:21:14 (GMT) |
---|---|---|
committer | Marius Storm-Olsen <marius.storm-olsen@nokia.com> | 2011-04-18 16:26:14 (GMT) |
commit | b9eb6a61392dd025745708e6a5d60a4f019ef32e (patch) | |
tree | 060f77f93fecdafac2d3c20e7bb55832e3f4ff61 /src/dbus | |
parent | a25ec261a52685792527c77e4de0dee28e300bbb (diff) | |
download | Qt-b9eb6a61392dd025745708e6a5d60a4f019ef32e.zip Qt-b9eb6a61392dd025745708e6a5d60a4f019ef32e.tar.gz Qt-b9eb6a61392dd025745708e6a5d60a4f019ef32e.tar.bz2 |
QtDBus: Skip bus name check for peer-to-peer connection
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')
-rw-r--r-- | src/dbus/qdbusabstractinterface.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/dbus/qdbusabstractinterface.cpp b/src/dbus/qdbusabstractinterface.cpp index d15eb7d..9e82c09 100644 --- a/src/dbus/qdbusabstractinterface.cpp +++ b/src/dbus/qdbusabstractinterface.cpp @@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE static QDBusError checkIfValid(const QString &service, const QString &path, - const QString &interface, bool isDynamic) + const QString &interface, bool isDynamic, bool isPeer) { // We should be throwing exceptions here... oh well QDBusError error; @@ -69,7 +69,7 @@ static QDBusError checkIfValid(const QString &service, const QString &path, // use assertion here because this should never happen, at all Q_ASSERT_X(!interface.isEmpty(), "QDBusAbstractInterface", "Interface name cannot be empty"); } - if (!QDBusUtil::checkBusName(service, isDynamic ? QDBusUtil::EmptyNotAllowed : QDBusUtil::EmptyAllowed, &error)) + if (!QDBusUtil::checkBusName(service, (isDynamic && !isPeer) ? QDBusUtil::EmptyNotAllowed : QDBusUtil::EmptyAllowed, &error)) return error; if (!QDBusUtil::checkObjectPath(path, isDynamic ? QDBusUtil::EmptyNotAllowed : QDBusUtil::EmptyAllowed, &error)) return error; @@ -86,7 +86,8 @@ QDBusAbstractInterfacePrivate::QDBusAbstractInterfacePrivate(const QString &serv const QDBusConnection& con, bool isDynamic) : connection(con), service(serv), path(p), interface(iface), - lastError(checkIfValid(serv, p, iface, isDynamic)), + lastError(checkIfValid(serv, p, iface, isDynamic, (connectionPrivate() && + connectionPrivate()->mode == QDBusConnectionPrivate::PeerMode))), isValid(!lastError.isValid()) { if (!isValid) |