aboutsummaryrefslogtreecommitdiff
path: root/jobs/syncjob.h
diff options
context:
space:
mode:
Diffstat (limited to 'jobs/syncjob.h')
-rw-r--r--jobs/syncjob.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/jobs/syncjob.h b/jobs/syncjob.h
index 57a87c9f..6697a265 100644
--- a/jobs/syncjob.h
+++ b/jobs/syncjob.h
@@ -66,7 +66,18 @@ Q_DECLARE_TYPEINFO(QMatrixClient::SyncRoomData, Q_MOVABLE_TYPE);
namespace QMatrixClient
{
// QVector cannot work with non-copiable objects, std::vector can.
- using SyncData = std::vector<SyncRoomData>;
+ using SyncDataList = std::vector<SyncRoomData>;
+
+ class SyncData {
+ public:
+ BaseJob::Status parseJson(const QJsonDocument &data);
+ SyncDataList&& takeRoomData();
+ QString nextBatch() const;
+
+ private:
+ QString nextBatch_;
+ SyncDataList roomData;
+ };
class SyncJob: public BaseJob
{
@@ -74,16 +85,13 @@ namespace QMatrixClient
explicit SyncJob(const ConnectionData* connection, const QString& since = {},
const QString& filter = {},
int timeout = -1, const QString& presence = {});
- virtual ~SyncJob();
- SyncData&& takeRoomData();
- QString nextBatch() const;
+ SyncData &&takeData() { return std::move(d); }
protected:
Status parseJson(const QJsonDocument& data) override;
private:
- class Private;
- Private* d;
+ SyncData d;
};
} // namespace QMatrixClient