aboutsummaryrefslogtreecommitdiff
path: root/jobs
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2016-08-31 18:30:42 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2016-08-31 18:30:42 +0900
commitb1b23e3500ff80d62b54153341e66fdfef4534db (patch)
treee512ce11ba2c5bad32e42a74a105fb4758fc0f73 /jobs
parent0fe83d59d76cd8f9c8f92d40cc58d9f5b082a84a (diff)
downloadlibquotient-b1b23e3500ff80d62b54153341e66fdfef4534db.tar.gz
libquotient-b1b23e3500ff80d62b54153341e66fdfef4534db.zip
QList<Event*> -> using Events=QVector<Event*>
Diffstat (limited to 'jobs')
-rw-r--r--jobs/roommessagesjob.cpp7
-rw-r--r--jobs/roommessagesjob.h5
-rw-r--r--jobs/syncjob.cpp3
-rw-r--r--jobs/syncjob.h5
4 files changed, 9 insertions, 11 deletions
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 <QtCore/QJsonObject>
#include <QtCore/QJsonArray>
@@ -35,7 +34,7 @@ class RoomMessagesJob::Private
FetchDirectory dir;
int limit;
- QList<Event*> events;
+ Events events;
QString end;
};
@@ -54,7 +53,7 @@ RoomMessagesJob::~RoomMessagesJob()
delete d;
}
-QList<Event*> 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<Event*> 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<Event*>
+ class EventList : public Events
{
private:
QString jsonKey;