From b9eb6a61392dd025745708e6a5d60a4f019ef32e Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 18 Apr 2011 11:21:14 -0500 Subject: QtDBus: Skip bus name check for peer-to-peer connection Merge-request: 2343 Reviewed-by: Marius Storm-Olsen Reviewed-by: Thiago Macieira --- src/dbus/qdbusabstractinterface.cpp | 7 ++++--- 1 file 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) -- cgit v0.12