From 0eec8c86b604374c3210133822d41df229698b34 Mon Sep 17 00:00:00 2001 From: Kevron Rees Date: Thu, 22 Jan 2015 15:00:36 -0800 Subject: QDBusConnection::registorObject with interface Currently QDBus relies on a key in QMetaClassInfo to understand the DBus interface name. This patch allows QDBus to also use a specified interface name in the registerObject call instead of relying on QMetaClassInfo that might not be there (if the QObject was created in QML or Javascript for example). Change-Id: Ie02b2c67e7deb07f43e35eb166c11833fcbf38f3 Task-number: QTBUG-44074 Reviewed-by: Kevron Rees Reviewed-by: Thiago Macieira --- src/dbus/qdbusintegrator.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/dbus/qdbusintegrator.cpp') diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index d819009d9b..a95d96e526 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -1481,8 +1481,12 @@ void QDBusConnectionPrivate::activateObject(ObjectTreeNode &node, const QDBusMes if (node.flags & (QDBusConnection::ExportScriptableSlots|QDBusConnection::ExportNonScriptableSlots) || node.flags & (QDBusConnection::ExportScriptableInvokables|QDBusConnection::ExportNonScriptableInvokables)) { bool interfaceFound = true; - if (!msg.interface().isEmpty()) - interfaceFound = qDBusInterfaceInObject(node.obj, msg.interface()); + if (!msg.interface().isEmpty()) { + if (!node.interfaceName.isEmpty()) + interfaceFound = msg.interface() == node.interfaceName; + else + interfaceFound = qDBusInterfaceInObject(node.obj, msg.interface()); + } if (interfaceFound) { if (!activateCall(node.obj, node.flags, msg)) -- cgit v1.2.3