From c87b4d9dcaacd932cbb7e4a9dca00c55b6338eef Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 8 Sep 2017 18:36:44 +0900 Subject: Better toJson for container objects The previous version couldn't deal with containers of objects that have no implicit conversion to QJsonValue. The current one can. --- jobs/converters.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jobs/converters.h b/jobs/converters.h index b52cfaa2..376dfeab 100644 --- a/jobs/converters.h +++ b/jobs/converters.h @@ -34,7 +34,8 @@ namespace QMatrixClient inline QJsonValue toJson(const QVector& vals) { QJsonArray ar; - std::copy(vals.begin(), vals.end(), std::back_inserter(ar)); + for (const auto& v: vals) + ar.push_back(toJson(v)); return ar; } -- cgit v1.2.3