From b1b23e3500ff80d62b54153341e66fdfef4534db Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Wed, 31 Aug 2016 18:30:42 +0900 Subject: QList -> using Events=QVector --- jobs/roommessagesjob.cpp | 7 +++---- jobs/roommessagesjob.h | 5 +++-- jobs/syncjob.cpp | 3 +-- jobs/syncjob.h | 5 ++--- 4 files changed, 9 insertions(+), 11 deletions(-) (limited to 'jobs') diff --git a/jobs/roommessagesjob.cpp b/jobs/roommessagesjob.cpp index ba075007..f880713d 100644 --- a/jobs/roommessagesjob.cpp +++ b/jobs/roommessagesjob.cpp @@ -18,7 +18,6 @@ #include "roommessagesjob.h" #include "../room.h" -#include "../events/event.h" #include #include @@ -35,7 +34,7 @@ class RoomMessagesJob::Private FetchDirectory dir; int limit; - QList events; + Events events; QString end; }; @@ -54,7 +53,7 @@ RoomMessagesJob::~RoomMessagesJob() delete d; } -QList RoomMessagesJob::events() +Events RoomMessagesJob::events() { return d->events; } @@ -84,7 +83,7 @@ QUrlQuery RoomMessagesJob::query() const BaseJob::Status RoomMessagesJob::parseJson(const QJsonDocument& data) { QJsonObject obj = data.object(); - d->events = eventListFromJson(obj.value("chunk").toArray()); + d->events = eventsFromJson(obj.value("chunk").toArray()); d->end = obj.value("end").toString(); return Success; } diff --git a/jobs/roommessagesjob.h b/jobs/roommessagesjob.h index 52a72f70..9bedcad9 100644 --- a/jobs/roommessagesjob.h +++ b/jobs/roommessagesjob.h @@ -21,10 +21,11 @@ #include "basejob.h" +#include "../events/event.h" + namespace QMatrixClient { class Room; - class Event; enum class FetchDirectory { Backwards, Forward }; @@ -34,7 +35,7 @@ namespace QMatrixClient RoomMessagesJob(ConnectionData* data, Room* room, QString from, FetchDirectory dir = FetchDirectory::Backwards, int limit=10); virtual ~RoomMessagesJob(); - QList events(); + Events events(); QString end(); protected: diff --git a/jobs/syncjob.cpp b/jobs/syncjob.cpp index a9865b55..2b2705b1 100644 --- a/jobs/syncjob.cpp +++ b/jobs/syncjob.cpp @@ -26,7 +26,6 @@ #include "../room.h" #include "../connectiondata.h" -#include "../events/event.h" using namespace QMatrixClient; @@ -139,7 +138,7 @@ BaseJob::Status SyncJob::parseJson(const QJsonDocument& data) void SyncRoomData::EventList::fromJson(const QJsonObject& roomContents) { - auto l = eventListFromJson(roomContents[jsonKey].toObject()["events"].toArray()); + auto l = eventsFromJson(roomContents[jsonKey].toObject()["events"].toArray()); swap(l); } diff --git a/jobs/syncjob.h b/jobs/syncjob.h index f08a6b56..ed99b38b 100644 --- a/jobs/syncjob.h +++ b/jobs/syncjob.h @@ -22,15 +22,14 @@ #include "basejob.h" #include "../joinstate.h" +#include "../events/event.h" namespace QMatrixClient { - class Event; - class SyncRoomData { public: - class EventList : public QList + class EventList : public Events { private: QString jsonKey; -- cgit v1.2.3