From eea82ab75d3a10fd3389b39ef226ffae52ae45ae Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 24 Jan 2020 09:08:35 +0100 Subject: [PATCH] Cleanup QDBusArgument marshalling for containers There's no need to specialize the marshalling for QList, QHash and QMap when we can simply have generic code here that works for all containers Change-Id: I442ac6009953d2bd8e5a7012262cffeb8e912034 Reviewed-by: Simon Hausmann --- src/dbus/qdbusargument.cpp | 7 +-- src/dbus/qdbusargument.h | 106 +++++++++++-------------------------- 2 files changed, 36 insertions(+), 77 deletions(-) diff --git a/src/dbus/qdbusargument.cpp b/src/dbus/qdbusargument.cpp index 5a0f0f013b8..7e1d8479827 100644 --- a/src/dbus/qdbusargument.cpp +++ b/src/dbus/qdbusargument.cpp @@ -908,9 +908,10 @@ void QDBusArgument::endArray() \snippet code/src_qdbus_qdbusargument.cpp 7 - If the type you want to marshall is a QMap or QHash, you need not - declare an \c{operator<<} function for it, since Qt D-Bus provides - generic templates to do the job of marshalling the data. + You usually don't need to provide an \c{operator<<} or \c{operator>>} + function for associative containers such as QHash or std::map, + since Qt D-Bus provides generic templates to do the job of marshalling + the data. \sa endMap(), beginStructure(), beginArray(), beginMapEntry() */ diff --git a/src/dbus/qdbusargument.h b/src/dbus/qdbusargument.h index 339f8c5dc8e..f388a65bedd 100644 --- a/src/dbus/qdbusargument.h +++ b/src/dbus/qdbusargument.h @@ -224,7 +224,8 @@ Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QLineF &li Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QLineF &line); #endif -template