diff options
Diffstat (limited to 'src/dbus/qdbusmessage.cpp')
-rw-r--r-- | src/dbus/qdbusmessage.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/dbus/qdbusmessage.cpp b/src/dbus/qdbusmessage.cpp index c13d483..bd77c77 100644 --- a/src/dbus/qdbusmessage.cpp +++ b/src/dbus/qdbusmessage.cpp @@ -95,14 +95,15 @@ QString QDBusMessage::errorMessage() const /*! \internal - Constructs a DBusMessage object from this object. The returned value must be de-referenced - with q_dbus_message_unref. + Constructs a DBusMessage object from \a message. The returned value must be de-referenced + with q_dbus_message_unref. The \a capabilities flags indicates which capabilities to use. The \a error object is set to indicate the error if anything went wrong with the marshalling. Usually, this error message will be placed in the reply, as if the call failed. The \a error pointer must not be null. */ -DBusMessage *QDBusMessagePrivate::toDBusMessage(const QDBusMessage &message, QDBusError *error) +DBusMessage *QDBusMessagePrivate::toDBusMessage(const QDBusMessage &message, QDBusConnection::ConnectionCapabilities capabilities, + QDBusError *error) { if (!qdbus_loadLibDBus()) { *error = QDBusError(QDBusError::Failed, QLatin1String("Could not open lidbus-1 library")); @@ -177,7 +178,7 @@ DBusMessage *QDBusMessagePrivate::toDBusMessage(const QDBusMessage &message, QDB // we can record this fact d_ptr->parametersValidated = true; - QDBusMarshaller marshaller; + QDBusMarshaller marshaller(capabilities); QVariantList::ConstIterator it = d_ptr->arguments.constBegin(); QVariantList::ConstIterator cend = d_ptr->arguments.constEnd(); q_dbus_message_iter_init_append(msg, &marshaller.iterator); @@ -222,7 +223,7 @@ DBUS_DISABLE_CHECKS \internal Constructs a QDBusMessage by parsing the given DBusMessage object. */ -QDBusMessage QDBusMessagePrivate::fromDBusMessage(DBusMessage *dmsg) +QDBusMessage QDBusMessagePrivate::fromDBusMessage(DBusMessage *dmsg, QDBusConnection::ConnectionCapabilities capabilities) { QDBusMessage message; if (!dmsg) @@ -238,7 +239,7 @@ QDBusMessage QDBusMessagePrivate::fromDBusMessage(DBusMessage *dmsg) message.d_ptr->signature = QString::fromUtf8(q_dbus_message_get_signature(dmsg)); message.d_ptr->msg = q_dbus_message_ref(dmsg); - QDBusDemarshaller demarshaller; + QDBusDemarshaller demarshaller(capabilities); demarshaller.message = q_dbus_message_ref(dmsg); if (q_dbus_message_iter_init(demarshaller.message, &demarshaller.iterator)) while (!demarshaller.atEnd()) @@ -272,7 +273,7 @@ QDBusMessage QDBusMessagePrivate::makeLocal(const QDBusConnectionPrivate &conn, // we must marshall and demarshall again so as to create QDBusArgument // entries for the complex types QDBusError error; - DBusMessage *message = toDBusMessage(asSent, &error); + DBusMessage *message = toDBusMessage(asSent, conn.capabilities, &error); if (!message) { // failed to marshall, so it's a call error return QDBusMessage::createError(error); @@ -280,7 +281,7 @@ QDBusMessage QDBusMessagePrivate::makeLocal(const QDBusConnectionPrivate &conn, q_dbus_message_set_sender(message, conn.baseService.toUtf8()); - QDBusMessage retval = fromDBusMessage(message); + QDBusMessage retval = fromDBusMessage(message, conn.capabilities); retval.d_ptr->localMessage = true; q_dbus_message_unref(message); if (retval.d_ptr->service.isEmpty()) |