From 80179e3b7e91bbe4d129b95eab8c6350e26f5569 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 19 Jun 2019 23:01:15 +0200 Subject: Port users of QDBusAbstractInterface::(async)callWithArgumentList() to new variadic (async)Call() Except in the auto-generated files. Required to add a cast operator from QDBusObjectPath to QVariant, as the variadic call() uses QVariant(arg) instead of QVariant::fromValue(arg). [ChangeLog][QtDBus][QDBusObjectPath] Added explicit cast operator to QVariant. Change-Id: I3f3004f7b9300a6340d27488f5b97981cbab3c24 Reviewed-by: Thiago Macieira --- src/plugins/bearer/connman/qconnmanservice_linux.cpp | 9 +++------ src/plugins/bearer/linux_common/qofonoservice_linux.cpp | 15 +++++---------- 2 files changed, 8 insertions(+), 16 deletions(-) (limited to 'src/plugins/bearer') diff --git a/src/plugins/bearer/connman/qconnmanservice_linux.cpp b/src/plugins/bearer/connman/qconnmanservice_linux.cpp index 3659eb7740..35d9c40680 100644 --- a/src/plugins/bearer/connman/qconnmanservice_linux.cpp +++ b/src/plugins/bearer/connman/qconnmanservice_linux.cpp @@ -80,8 +80,7 @@ QConnmanManagerInterface::QConnmanManagerInterface( QObject *parent) qDBusRegisterMetaType(); qDBusRegisterMetaType(); - QList argumentList; - QDBusPendingReply props_reply = asyncCallWithArgumentList(QLatin1String("GetProperties"), argumentList); + QDBusPendingReply props_reply = asyncCall(QLatin1String("GetProperties")); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(props_reply, this); QObject::connect(watcher,SIGNAL(finished(QDBusPendingCallWatcher*)), @@ -106,8 +105,7 @@ QConnmanManagerInterface::QConnmanManagerInterface( QObject *parent) QLatin1String("TechnologyRemoved"), this,SLOT(technologyRemoved(QDBusObjectPath))); - QList argumentList2; - QDBusPendingReply serv_reply = asyncCallWithArgumentList(QLatin1String("GetServices"), argumentList2); + QDBusPendingReply serv_reply = asyncCall(QLatin1String("GetServices")); QDBusPendingCallWatcher *watcher2 = new QDBusPendingCallWatcher(serv_reply, this); QObject::connect(watcher2,SIGNAL(finished(QDBusPendingCallWatcher*)), @@ -289,8 +287,7 @@ QConnmanServiceInterface::QConnmanServiceInterface(const QString &dbusPathName,Q CONNMAN_SERVICE_INTERFACE, QDBusConnection::systemBus(), parent) { - QList argumentList; - QDBusPendingReply props_reply = asyncCallWithArgumentList(QLatin1String("GetProperties"), argumentList); + QDBusPendingReply props_reply = asyncCall(QLatin1String("GetProperties")); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(props_reply, this); diff --git a/src/plugins/bearer/linux_common/qofonoservice_linux.cpp b/src/plugins/bearer/linux_common/qofonoservice_linux.cpp index 5d72731bc4..05f9b3ca17 100644 --- a/src/plugins/bearer/linux_common/qofonoservice_linux.cpp +++ b/src/plugins/bearer/linux_common/qofonoservice_linux.cpp @@ -99,8 +99,7 @@ QOfonoManagerInterface::~QOfonoManagerInterface() QStringList QOfonoManagerInterface::getModems() { if (modemList.isEmpty()) { - QList argumentList; - QDBusPendingReply reply = callWithArgumentList(QDBus::Block, QLatin1String("GetModems"), argumentList); + QDBusPendingReply reply = call(QDBus::Block, QLatin1String("GetModems")); reply.waitForFinished(); if (!reply.isError()) { const auto modems = reply.value(); @@ -184,8 +183,7 @@ QStringList QOfonoModemInterface::interfaces() QVariantMap QOfonoModemInterface::getProperties() { if (propertiesMap.isEmpty()) { - QList argumentList; - QDBusPendingReply reply = callWithArgumentList(QDBus::Block, QLatin1String("GetProperties"), argumentList); + QDBusPendingReply reply = call(QDBus::Block, QLatin1String("GetProperties")); if (!reply.isError()) { propertiesMap = reply.value(); } @@ -233,8 +231,7 @@ QVariant QOfonoNetworkRegistrationInterface::getProperty(const QString &property QVariantMap QOfonoNetworkRegistrationInterface::getProperties() { if (propertiesMap.isEmpty()) { - QList argumentList; - QDBusPendingReply reply = callWithArgumentList(QDBus::Block, QLatin1String("GetProperties"), argumentList); + QDBusPendingReply reply = call(QDBus::Block, QLatin1String("GetProperties")); reply.waitForFinished(); if (!reply.isError()) { propertiesMap = reply.value(); @@ -306,8 +303,7 @@ QVariant QOfonoDataConnectionManagerInterface::getProperty(const QString &proper QVariantMap &QOfonoDataConnectionManagerInterface::getProperties() { if (propertiesMap.isEmpty()) { - QList argumentList; - QDBusPendingReply reply = callWithArgumentList(QDBus::Block, QLatin1String("GetProperties"), argumentList); + QDBusPendingReply reply = call(QDBus::Block, QLatin1String("GetProperties")); if (!reply.isError()) { propertiesMap = reply.value(); } @@ -343,8 +339,7 @@ QOfonoConnectionContextInterface::~QOfonoConnectionContextInterface() QVariantMap QOfonoConnectionContextInterface::getProperties() { if (propertiesMap.isEmpty()) { - QList argumentList; - QDBusPendingReply reply = callWithArgumentList(QDBus::Block, QLatin1String("GetProperties"), argumentList); + QDBusPendingReply reply = call(QDBus::Block, QLatin1String("GetProperties")); if (!reply.isError()) { propertiesMap = reply.value(); } -- cgit v1.2.3