Logo Search packages:      
Sourcecode: kdbus version File versions  Download package

QDBusMessage QDBusMessage::fromDBusMessage ( DBusMessage *  dmsg  )  [static]

Creates a Qt3-bindings message from the given raw DBus message.

De-marshalls data contained in the message to a list of QVariant.

Note:
ownership of the given message is shared between the caller and the returned message, i.e. the message as increased the reference counter and will still have access to the raw message even if the caller "deleted" it using dbus_message_unref()
Parameters:
dmsg a C API DBus message
Returns:
a Qt3 bindings message. Can be an InvalidMessage if the given message was 0 or if de-marshalling failed

Definition at line 156 of file qdbusmessage.cpp.

References d.

Referenced by QDBusConnection::sendWithReply().

{
    QDBusMessage message;
    if (!dmsg)
        return message;

    message.d->type = dbus_message_get_type(dmsg);
    message.d->path = QString::fromUtf8(dbus_message_get_path(dmsg));
    message.d->interface = QString::fromUtf8(dbus_message_get_interface(dmsg));
    message.d->member = QString::fromUtf8(dbus_message_get_member(dmsg));
    message.d->sender = QString::fromUtf8(dbus_message_get_sender(dmsg));
    message.d->msg = dbus_message_ref(dmsg);

    DBusError dbusError;
    dbus_error_init(&dbusError);
    if (dbus_set_error_from_message(&dbusError, dmsg))
    {
        message.d->error = QDBusError(&dbusError);
    }

    QDBusMarshall::messageToList(message, dmsg);

    return message;
}


Generated by  Doxygen 1.6.0   Back to index