Commit 5f542f3c authored by Marc Mutz's avatar Marc Mutz
Browse files

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: default avatarThiago Macieira <thiago.macieira@intel.com>
Showing with 0 additions and 31 deletions
...@@ -255,35 +255,6 @@ inline const QDBusArgument &operator>>(const QDBusArgument &arg, Container<T> &l ...@@ -255,35 +255,6 @@ inline const QDBusArgument &operator>>(const QDBusArgument &arg, Container<T> &l
return arg; 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) inline QDBusArgument &operator<<(QDBusArgument &arg, const QVariantList &list)
{ {
int id = qMetaTypeId<QDBusVariant>(); int id = qMetaTypeId<QDBusVariant>();
...@@ -296,7 +267,6 @@ inline QDBusArgument &operator<<(QDBusArgument &arg, const QVariantList &list) ...@@ -296,7 +267,6 @@ inline QDBusArgument &operator<<(QDBusArgument &arg, const QVariantList &list)
return arg; return arg;
} }
// QMap specializations
template<typename Key, typename T> template<typename Key, typename T>
inline QDBusArgument &operator<<(QDBusArgument &arg, const QMap<Key, T> &map) inline QDBusArgument &operator<<(QDBusArgument &arg, const QMap<Key, T> &map)
{ {
...@@ -345,7 +315,6 @@ inline QDBusArgument &operator<<(QDBusArgument &arg, const QVariantMap &map) ...@@ -345,7 +315,6 @@ inline QDBusArgument &operator<<(QDBusArgument &arg, const QVariantMap &map)
return arg; return arg;
} }
// QHash specializations
template<typename Key, typename T> template<typename Key, typename T>
inline QDBusArgument &operator<<(QDBusArgument &arg, const QHash<Key, T> &map) inline QDBusArgument &operator<<(QDBusArgument &arg, const QHash<Key, T> &map)
{ {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment