diff options
author | Thiago Macieira <thiago@kde.org> | 2006-02-20 13:23:11 +0000 |
---|---|---|
committer | Thiago Macieira <thiago@kde.org> | 2006-02-20 13:23:11 +0000 |
commit | 602809693a5b9a20c83a5726cee0a6426bc2a6f3 (patch) | |
tree | c5f49c66ac5984c4d26190741134dd1ceb833079 /qt/qdbusmessage.cpp | |
parent | 4dedbb498484d8f3614d84cb2cfe09d8001a1c65 (diff) |
2006-02-20 Thiago Macieira <thiago.macieira@trolltech.com>
* qt/qdbusinterface_p.h:
* qt/qdbusinterface.cpp: Use the standard
org.freedesktop.DBus.Method.NoReply annotation for the "async"
calls instead of creating one for us.
* qt/qdbusconnection_p.h:
* qt/qdbusintegrator.cpp: Remove debugging code.
* qt/qdbusintegrator.cpp:
* qt/qdbusmessage.cpp:
* qt/qdbusmessage_p.h:
* qt/qdbusmessage.h: Change the behaviour of automatic
reply-sending: now a reply is always sent, unless the caller
didn't request one or if the user slot has already sent one.
Diffstat (limited to 'qt/qdbusmessage.cpp')
-rw-r--r-- | qt/qdbusmessage.cpp | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/qt/qdbusmessage.cpp b/qt/qdbusmessage.cpp index 5c604c13..b88d7e39 100644 --- a/qt/qdbusmessage.cpp +++ b/qt/qdbusmessage.cpp @@ -34,7 +34,8 @@ #include "qdbusmessage_p.h" QDBusMessagePrivate::QDBusMessagePrivate(QDBusMessage *qq) - : msg(0), reply(0), q(qq), type(DBUS_MESSAGE_TYPE_INVALID), timeout(-1), ref(1) + : msg(0), reply(0), q(qq), type(DBUS_MESSAGE_TYPE_INVALID), timeout(-1), ref(1), + repliedTo(false) { } @@ -143,6 +144,7 @@ QDBusMessage QDBusMessage::methodReply(const QDBusMessage &other) QDBusMessage message; message.d->type = DBUS_MESSAGE_TYPE_METHOD_RETURN; message.d->reply = dbus_message_ref(other.d->msg); + other.d->repliedTo = true; return message; } @@ -166,6 +168,7 @@ QDBusMessage QDBusMessage::error(const QDBusMessage &other, const QString &name, message.d->name = name; message.d->message = msg; message.d->reply = dbus_message_ref(other.d->msg); + other.d->repliedTo = true; return message; } @@ -187,6 +190,7 @@ QDBusMessage QDBusMessage::error(const QDBusMessage &other, const QDBusError &er message.d->name = error.name(); message.d->message = error.message(); message.d->reply = dbus_message_ref(other.d->msg); + other.d->repliedTo = true; return message; } @@ -371,6 +375,30 @@ void QDBusMessage::setTimeout(int ms) } /*! + Returns the flag that indicates if this message should see a reply or not. This is only + meaningful for MethodCall messages: any other kind of message cannot have replies and this + function will always return false for them. +*/ +bool QDBusMessage::noReply() const +{ + if (!d->msg) + return false; + return dbus_message_get_no_reply(d->msg); +} + +/*! + Sets the flag that indicates whether we're expecting a reply from the callee. This flag only + makes sense for MethodCall messages. + + \param enable whether to enable the flag (i.e., we are not expecting a reply) +*/ +void QDBusMessage::setNoReply(bool enable) +{ + if (d->msg) + dbus_message_set_no_reply(d->msg, enable); +} + +/*! Returns the unique serial number assigned to this message or 0 if the message was not sent yet. */ @@ -397,6 +425,15 @@ int QDBusMessage::replySerialNumber() const } /*! + Returns true if this is a MethodCall message and a reply for it has been generated using + QDBusMessage::methodReply or QDBusMessage::error. +*/ +bool QDBusMessage::wasRepliedTo() const +{ + return d->repliedTo; +} + +/*! Returns the signature of the signal that was received or for the output arguments of a method call. */ |