summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dbus/qdbusextratypes.cpp8
-rw-r--r--src/dbus/qdbusextratypes.h3
-rw-r--r--src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuregistrarproxy_p.h16
-rw-r--r--src/platformsupport/themes/genericunix/dbustray/qxdgnotificationproxy_p.h20
-rw-r--r--src/plugins/bearer/connman/qconnmanservice_linux.cpp9
-rw-r--r--src/plugins/bearer/linux_common/qofonoservice_linux.cpp15
6 files changed, 27 insertions, 44 deletions
diff --git a/src/dbus/qdbusextratypes.cpp b/src/dbus/qdbusextratypes.cpp
index a0b121a1a3..06fbd6062e 100644
--- a/src/dbus/qdbusextratypes.cpp
+++ b/src/dbus/qdbusextratypes.cpp
@@ -167,6 +167,14 @@ void QDBusSignature::doCheck()
*/
/*!
+ \since 5.14
+
+ Implicit cast to QVariant. Equivalent to calling
+ QVariant::fromValue() with this object as argument.
+*/
+QDBusObjectPath::operator QVariant() const { return QVariant::fromValue(*this); }
+
+/*!
\class QDBusSignature
\inmodule QtDBus
\since 4.2
diff --git a/src/dbus/qdbusextratypes.h b/src/dbus/qdbusextratypes.h
index fdac917947..6bb12ffe49 100644
--- a/src/dbus/qdbusextratypes.h
+++ b/src/dbus/qdbusextratypes.h
@@ -54,7 +54,6 @@
QT_BEGIN_NAMESPACE
-
class Q_DBUS_EXPORT QDBusObjectPath
{
QString m_path;
@@ -75,6 +74,8 @@ public:
inline QString path() const
{ return m_path; }
+ operator QVariant() const;
+
private:
void doCheck();
};
diff --git a/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuregistrarproxy_p.h b/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuregistrarproxy_p.h
index c92de0a140..cffc080f87 100644
--- a/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuregistrarproxy_p.h
+++ b/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuregistrarproxy_p.h
@@ -92,15 +92,11 @@ public:
public Q_SLOTS: // METHODS
QDBusPendingReply<QString, QDBusObjectPath> GetMenuForWindow(uint windowId)
{
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(windowId);
- return asyncCallWithArgumentList(QStringLiteral("GetMenuForWindow"), argumentList);
+ return asyncCall(QStringLiteral("GetMenuForWindow"), windowId);
}
QDBusReply<QString> GetMenuForWindow(uint windowId, QDBusObjectPath &menuObjectPath)
{
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(windowId);
- QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("GetMenuForWindow"), argumentList);
+ QDBusMessage reply = call(QDBus::Block, QStringLiteral("GetMenuForWindow"), windowId);
QList<QVariant> arguments = reply.arguments();
if (reply.type() == QDBusMessage::ReplyMessage && arguments.count() == 2)
menuObjectPath = qdbus_cast<QDBusObjectPath>(arguments.at(1));
@@ -109,16 +105,12 @@ public Q_SLOTS: // METHODS
QDBusPendingReply<> RegisterWindow(uint windowId, const QDBusObjectPath &menuObjectPath)
{
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(windowId) << QVariant::fromValue(menuObjectPath);
- return asyncCallWithArgumentList(QStringLiteral("RegisterWindow"), argumentList);
+ return asyncCall(QStringLiteral("RegisterWindow"), windowId, menuObjectPath);
}
QDBusPendingReply<> UnregisterWindow(uint windowId)
{
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(windowId);
- return asyncCallWithArgumentList(QStringLiteral("UnregisterWindow"), argumentList);
+ return asyncCall(QStringLiteral("UnregisterWindow"), windowId);
}
};
diff --git a/src/platformsupport/themes/genericunix/dbustray/qxdgnotificationproxy_p.h b/src/platformsupport/themes/genericunix/dbustray/qxdgnotificationproxy_p.h
index ab99ea65dd..2194a787eb 100644
--- a/src/platformsupport/themes/genericunix/dbustray/qxdgnotificationproxy_p.h
+++ b/src/platformsupport/themes/genericunix/dbustray/qxdgnotificationproxy_p.h
@@ -95,26 +95,21 @@ public:
public Q_SLOTS: // METHODS
inline QDBusPendingReply<> closeNotification(uint id)
{
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(id);
- return asyncCallWithArgumentList(QStringLiteral("CloseNotification"), argumentList);
+ return asyncCall(QStringLiteral("CloseNotification"), id);
}
inline QDBusPendingReply<QStringList> getCapabilities()
{
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QStringLiteral("GetCapabilities"), argumentList);
+ return asyncCall(QStringLiteral("GetCapabilities"));
}
inline QDBusPendingReply<QString, QString, QString, QString> getServerInformation()
{
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QStringLiteral("GetServerInformation"), argumentList);
+ return asyncCall(QStringLiteral("GetServerInformation"));
}
inline QDBusReply<QString> getServerInformation(QString &vendor, QString &version, QString &specVersion)
{
- QList<QVariant> argumentList;
- QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("GetServerInformation"), argumentList);
+ QDBusMessage reply = call(QDBus::Block, QStringLiteral("GetServerInformation"));
if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 4) {
vendor = qdbus_cast<QString>(reply.arguments().at(1));
version = qdbus_cast<QString>(reply.arguments().at(2));
@@ -129,12 +124,7 @@ public Q_SLOTS: // METHODS
const QVariantMap &hints, int timeout)
{
qCDebug(qLcTray) << appName << replacesId << appIcon << summary << body << actions << hints << timeout;
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(appName) << QVariant::fromValue(replacesId) <<
- QVariant::fromValue(appIcon) << QVariant::fromValue(summary) <<
- QVariant::fromValue(body) << QVariant::fromValue(actions) <<
- QVariant::fromValue(hints) << QVariant::fromValue(timeout);
- return asyncCallWithArgumentList(QStringLiteral("Notify"), argumentList);
+ return asyncCall(QStringLiteral("Notify"), appName, replacesId, appIcon, summary, body, actions, hints, timeout);
}
Q_SIGNALS:
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<ConnmanMap>();
qDBusRegisterMetaType<ConnmanMapList>();
- QList<QVariant> argumentList;
- QDBusPendingReply<QVariantMap> props_reply = asyncCallWithArgumentList(QLatin1String("GetProperties"), argumentList);
+ QDBusPendingReply<QVariantMap> 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<QVariant> argumentList2;
- QDBusPendingReply<ConnmanMapList> serv_reply = asyncCallWithArgumentList(QLatin1String("GetServices"), argumentList2);
+ QDBusPendingReply<ConnmanMapList> 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<QVariant> argumentList;
- QDBusPendingReply<QVariantMap> props_reply = asyncCallWithArgumentList(QLatin1String("GetProperties"), argumentList);
+ QDBusPendingReply<QVariantMap> 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<QVariant> argumentList;
- QDBusPendingReply<PathPropertiesList> reply = callWithArgumentList(QDBus::Block, QLatin1String("GetModems"), argumentList);
+ QDBusPendingReply<PathPropertiesList> 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<QVariant> argumentList;
- QDBusPendingReply<QVariantMap> reply = callWithArgumentList(QDBus::Block, QLatin1String("GetProperties"), argumentList);
+ QDBusPendingReply<QVariantMap> 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<QVariant> argumentList;
- QDBusPendingReply<QVariantMap> reply = callWithArgumentList(QDBus::Block, QLatin1String("GetProperties"), argumentList);
+ QDBusPendingReply<QVariantMap> 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<QVariant> argumentList;
- QDBusPendingReply<QVariantMap> reply = callWithArgumentList(QDBus::Block, QLatin1String("GetProperties"), argumentList);
+ QDBusPendingReply<QVariantMap> 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<QVariant> argumentList;
- QDBusPendingReply<QVariantMap> reply = callWithArgumentList(QDBus::Block, QLatin1String("GetProperties"), argumentList);
+ QDBusPendingReply<QVariantMap> reply = call(QDBus::Block, QLatin1String("GetProperties"));
if (!reply.isError()) {
propertiesMap = reply.value();
}