From 1cf08cbc5b9b6beb49c26efb0a452b5bc7b7cd40 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 3 Sep 2020 09:56:49 +0200 Subject: [PATCH] Cleanup a ### Qt 6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: If9dd04e25ddc5164cc23ac7d5684254e38b7eda6 Reviewed-by: Volker Hilsheimer Reviewed-by: MÃ¥rten Nordheim --- src/dbus/qdbusargument.h | 9 ++++----- src/dbus/qdbuspendingreply.h | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/dbus/qdbusargument.h b/src/dbus/qdbusargument.h index cfa66d348ec..721ac41b3c0 100644 --- a/src/dbus/qdbusargument.h +++ b/src/dbus/qdbusargument.h @@ -156,15 +156,14 @@ QT_END_NAMESPACE Q_DECLARE_METATYPE(QDBusArgument) QT_BEGIN_NAMESPACE -// ### Qt6: remove the defaulted T * = nullptr from these two (MSVC6 work-around): -template inline T qdbus_cast(const QDBusArgument &arg, T * = nullptr) +template inline T qdbus_cast(const QDBusArgument &arg) { T item; arg >> item; return item; } -template inline T qdbus_cast(const QVariant &v, T * = nullptr) +template inline T qdbus_cast(const QVariant &v) { int id = v.userType(); if (id == qMetaTypeId()) @@ -174,13 +173,13 @@ template inline T qdbus_cast(const QVariant &v, T * = nullptr) } // specialize for QVariant, allowing it to be used in place of QDBusVariant -template<> inline QVariant qdbus_cast(const QDBusArgument &arg, QVariant *) +template<> inline QVariant qdbus_cast(const QDBusArgument &arg) { QDBusVariant item; arg >> item; return item.variant(); } -template<> inline QVariant qdbus_cast(const QVariant &v, QVariant *) +template<> inline QVariant qdbus_cast(const QVariant &v) { return qdbus_cast(v).variant(); } diff --git a/src/dbus/qdbuspendingreply.h b/src/dbus/qdbuspendingreply.h index 9d25115a678..62e955a82be 100644 --- a/src/dbus/qdbuspendingreply.h +++ b/src/dbus/qdbuspendingreply.h @@ -156,7 +156,7 @@ public: { static_assert(Index >= 0 && Index < Count, "Index out of bounds"); typedef typename Select::Type ResultType; - return qdbus_cast(argumentAt(Index), nullptr); + return qdbus_cast(argumentAt(Index)); } #endif