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>
bb10
Marc Mutz 2015-12-23 15:33:52 +01:00
parent 04e76ec857
commit 5f542f3cca
1 changed files with 0 additions and 31 deletions

View File

@ -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)
{