From 491e392af73be3ebfd928e80efc0514fd43b8e87 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Thu, 16 Nov 2017 14:10:08 +0900 Subject: Simplify code that loads events from JSON arrays --- jobs/syncjob.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'jobs/syncjob.h') diff --git a/jobs/syncjob.h b/jobs/syncjob.h index b1db914d..08bd773e 100644 --- a/jobs/syncjob.h +++ b/jobs/syncjob.h @@ -36,11 +36,10 @@ namespace QMatrixClient explicit Batch(QString k) : jsonKey(std::move(k)) { } void fromJson(const QJsonObject& roomContents) { - this->assign(makeEvents( - roomContents[jsonKey].toObject()["events"].toArray())); + EventsBatch::fromJson( + roomContents[jsonKey].toObject(), "events"); } - private: QString jsonKey; }; -- cgit v1.2.3