From 5f542f3cca13f2da58b82aee2efbaffefeee00a7 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 23 Dec 2015 15:33:52 +0100 Subject: QDBusArgument: remove useless op<< overloads ... and remove misleading comments (these are overloads, not specializations). The QList overloads do nothing different from the generic container overloads. Remove them. Only leave the QVariantList overload, because that converts to QDBusVariant before serializing. Which means that this should probably be templated on the container type, otherwise you get different behavior for QList and, say, QVector, which is surely wrong. Change-Id: I215ba9891235b51304c2ed4041d3dbd003d69581 Reviewed-by: Thiago Macieira --- src/dbus/qdbusargument.h | 31 ------------------------------- 1 file changed, 31 deletions(-) (limited to 'src/dbus') diff --git a/src/dbus/qdbusargument.h b/src/dbus/qdbusargument.h index a6bc396861..6305239bdf 100644 --- a/src/dbus/qdbusargument.h +++ b/src/dbus/qdbusargument.h @@ -255,35 +255,6 @@ inline const QDBusArgument &operator>>(const QDBusArgument &arg, Container &l return arg; } -// QList specializations -template -inline QDBusArgument &operator<<(QDBusArgument &arg, const QList &list) -{ - int id = qMetaTypeId(); - arg.beginArray(id); - typename QList::ConstIterator it = list.constBegin(); - typename QList::ConstIterator end = list.constEnd(); - for ( ; it != end; ++it) - arg << *it; - arg.endArray(); - return arg; -} - -template -inline const QDBusArgument &operator>>(const QDBusArgument &arg, QList &list) -{ - arg.beginArray(); - list.clear(); - while (!arg.atEnd()) { - T item; - arg >> item; - list.push_back(item); - } - arg.endArray(); - - return arg; -} - inline QDBusArgument &operator<<(QDBusArgument &arg, const QVariantList &list) { int id = qMetaTypeId(); @@ -296,7 +267,6 @@ inline QDBusArgument &operator<<(QDBusArgument &arg, const QVariantList &list) return arg; } -// QMap specializations template inline QDBusArgument &operator<<(QDBusArgument &arg, const QMap &map) { @@ -345,7 +315,6 @@ inline QDBusArgument &operator<<(QDBusArgument &arg, const QVariantMap &map) return arg; } -// QHash specializations template inline QDBusArgument &operator<<(QDBusArgument &arg, const QHash &map) { -- cgit v1.2.3