QDBusConnectionPrivate: Use enum for mode argument of sendWithReply

Change type of mode argument to QDBus::CallMode instead of int.

Also change the argument name in the implementation to much the
declaration.

Change-Id: Ice19bfff72f3bf1f4a5748f2caa16999e87a131f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Ievgenii Meshcheriakov 2023-07-07 13:06:44 +02:00
parent babdeb7a10
commit 3fa3e56e64
2 changed files with 3 additions and 4 deletions

View File

@ -177,7 +177,7 @@ public:
QObject *obj, const char *member);
bool send(const QDBusMessage &message);
QDBusMessage sendWithReply(const QDBusMessage &message, int mode, int timeout = -1);
QDBusMessage sendWithReply(const QDBusMessage &message, QDBus::CallMode mode, int timeout = -1);
QDBusMessage sendWithReplyLocal(const QDBusMessage &message);
QDBusPendingCallPrivate *sendWithReplyAsync(const QDBusMessage &message, QObject *receiver,
const char *returnMethod, const char *errorMethod,int timeout = -1);

View File

@ -2027,9 +2027,8 @@ private:
QElapsedTimer m_callTimer;
};
QDBusMessage QDBusConnectionPrivate::sendWithReply(const QDBusMessage &message,
int sendMode, int timeout)
QDBus::CallMode mode, int timeout)
{
QDBusBlockingCallWatcher watcher(message);
@ -2038,7 +2037,7 @@ QDBusMessage QDBusConnectionPrivate::sendWithReply(const QDBusMessage &message,
if (pcall->replyMessage.type() == QDBusMessage::InvalidMessage) {
// need to wait for the reply
if (sendMode == QDBus::BlockWithGui) {
if (mode == QDBus::BlockWithGui) {
pcall->watcherHelper = new QDBusPendingCallWatcherHelper;
QEventLoop loop;
loop.connect(pcall->watcherHelper, &QDBusPendingCallWatcherHelper::reply, &loop, &QEventLoop::quit);