From edaf7c30d43e82e662129f55343930f54199ec60 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 29 Dec 2014 19:25:28 -0200 Subject: Make QDBusConnectionPrivate::send return bool It used to return the sent message's serial ID, but we never used that. So simply use boolean instead. Change-Id: Ic5d393bfd36e48a193fcffff13b73753ccf47759 Reviewed-by: Alex Blasche Reviewed-by: Albert Astals Cid --- src/dbus/qdbusconnection_p.h | 2 +- src/dbus/qdbusintegrator.cpp | 19 ++++++------------- 2 files changed, 7 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/dbus/qdbusconnection_p.h b/src/dbus/qdbusconnection_p.h index fde7edaa64..048e255e88 100644 --- a/src/dbus/qdbusconnection_p.h +++ b/src/dbus/qdbusconnection_p.h @@ -198,7 +198,7 @@ public: QString getNameOwner(const QString &service); - int send(const QDBusMessage &message); + bool send(const QDBusMessage &message); QDBusMessage sendWithReply(const QDBusMessage &message, int mode, int timeout = -1); QDBusMessage sendWithReplyLocal(const QDBusMessage &message); QDBusPendingCallPrivate *sendWithReplyAsync(const QDBusMessage &message, QObject *receiver, diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index 84d433f2e7..08a8877ad5 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -1873,10 +1873,10 @@ void QDBusConnectionPrivate::processFinishedCall(QDBusPendingCallPrivate *call) delete call; } -int QDBusConnectionPrivate::send(const QDBusMessage& message) +bool QDBusConnectionPrivate::send(const QDBusMessage& message) { if (QDBusMessagePrivate::isLocal(message)) - return -1; // don't send; the reply will be retrieved by the caller + return true; // don't send; the reply will be retrieved by the caller // through the d_ptr->localReply link QDBusError error; @@ -1900,24 +1900,17 @@ int QDBusConnectionPrivate::send(const QDBusMessage& message) "invalid", qPrintable(message.service()), qPrintable(error.message())); lastError = error; - return 0; + return false; } q_dbus_message_set_no_reply(msg, true); // the reply would not be delivered to anything qDBusDebug() << this << "sending message (no reply):" << message; checkThread(); - bool isOk; - { - QDBusDispatchLocker locker(SendMessageAction, this); - isOk = q_dbus_connection_send(connection, msg, 0); - } - int serial = 0; - if (isOk) - serial = q_dbus_message_get_serial(msg); - + QDBusDispatchLocker locker(SendMessageAction, this); + bool isOk = q_dbus_connection_send(connection, msg, 0); q_dbus_message_unref(msg); - return serial; + return isOk; } // small helper to note long running blocking dbus calls. -- cgit v1.2.3