diff options
Diffstat (limited to 'jobs/syncjob.cpp')
-rw-r--r-- | jobs/syncjob.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/jobs/syncjob.cpp b/jobs/syncjob.cpp index 3a7573bc..c04a74d7 100644 --- a/jobs/syncjob.cpp +++ b/jobs/syncjob.cpp @@ -40,7 +40,7 @@ class SyncJob::Private int timeout; QString nextBatch; - QList<SyncRoomData> roomData; + SyncData roomData; }; static size_t jobId = 0; @@ -84,7 +84,7 @@ QString SyncJob::nextBatch() const return d->nextBatch; } -QList<SyncRoomData> SyncJob::roomData() const +const SyncData& SyncJob::roomData() const { return d->roomData; } @@ -128,9 +128,9 @@ void SyncJob::parseJson(const QJsonDocument& data) { const QJsonObject rs = rooms.value(roomState.jsonKey).toObject(); d->roomData.reserve(rs.size()); - for( auto r = rs.begin(); r != rs.end(); ++r ) + for( auto rkey: rs.keys() ) { - d->roomData.push_back({r.key(), r.value().toObject(), roomState.enumVal}); + d->roomData.push_back({rkey, roomState.enumVal, rs[rkey].toObject()}); } } @@ -144,7 +144,7 @@ void SyncRoomData::EventList::fromJson(const QJsonObject& roomContents) swap(l); } -SyncRoomData::SyncRoomData(QString roomId_, const QJsonObject& room_, JoinState joinState_) +SyncRoomData::SyncRoomData(QString roomId_, JoinState joinState_, const QJsonObject& room_) : roomId(roomId_) , joinState(joinState_) , state("state") |