From 5f542f3cca13f2da58b82aee2efbaffefeee00a7 Mon Sep 17 00:00:00 2001
From: Marc Mutz <marc.mutz@kdab.com>
Date: Wed, 23 Dec 2015 15:33:52 +0100
Subject: [PATCH] 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<QVariant> and, say, QVector<QVariant>,
which is surely wrong.

Change-Id: I215ba9891235b51304c2ed4041d3dbd003d69581
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
---
 src/dbus/qdbusargument.h | 31 -------------------------------
 1 file changed, 31 deletions(-)

diff --git a/src/dbus/qdbusargument.h b/src/dbus/qdbusargument.h
index a6bc3968619..6305239bdf4 100644
--- a/src/dbus/qdbusargument.h
+++ b/src/dbus/qdbusargument.h
@@ -255,35 +255,6 @@ inline const QDBusArgument &operator>>(const QDBusArgument &arg, Container<T> &l
     return arg;
 }
 
-// QList specializations
-template<typename T>
-inline QDBusArgument &operator<<(QDBusArgument &arg, const QList<T> &list)
-{
-    int id = qMetaTypeId<T>();
-    arg.beginArray(id);
-    typename QList<T>::ConstIterator it = list.constBegin();
-    typename QList<T>::ConstIterator end = list.constEnd();
-    for ( ; it != end; ++it)
-        arg << *it;
-    arg.endArray();
-    return arg;
-}
-
-template<typename T>
-inline const QDBusArgument &operator>>(const QDBusArgument &arg, QList<T> &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<QDBusVariant>();
@@ -296,7 +267,6 @@ inline QDBusArgument &operator<<(QDBusArgument &arg, const QVariantList &list)
     return arg;
 }
 
-// QMap specializations
 template<typename Key, typename T>
 inline QDBusArgument &operator<<(QDBusArgument &arg, const QMap<Key, T> &map)
 {
@@ -345,7 +315,6 @@ inline QDBusArgument &operator<<(QDBusArgument &arg, const QVariantMap &map)
     return arg;
 }
 
-// QHash specializations
 template<typename Key, typename T>
 inline QDBusArgument &operator<<(QDBusArgument &arg, const QHash<Key, T> &map)
 {
-- 
GitLab