aboutsummaryrefslogtreecommitdiff
path: root/jobs/syncjob.h
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-05-17 11:13:56 +0900
committerGitHub <noreply@github.com>2017-05-17 11:13:56 +0900
commiteabb31a04889a8c8e9825f3d0024c1e8aa2cea54 (patch)
treeb9b46139d636d3599662842ee613476543953e81 /jobs/syncjob.h
parentb459f1b3e5355b30a51e9d12a35d8aee6a842886 (diff)
parentc25de4e19801c7931ce857c29a7a48be7f5c4dbe (diff)
downloadlibquotient-eabb31a04889a8c8e9825f3d0024c1e8aa2cea54.tar.gz
libquotient-eabb31a04889a8c8e9825f3d0024c1e8aa2cea54.zip
Merge pull request #62 from Fxrh/kitsune-refactoring
Code tweaks and cleanup
Diffstat (limited to 'jobs/syncjob.h')
-rw-r--r--jobs/syncjob.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/jobs/syncjob.h b/jobs/syncjob.h
index b41c09d4..48be9423 100644
--- a/jobs/syncjob.h
+++ b/jobs/syncjob.h
@@ -34,7 +34,7 @@ namespace QMatrixClient
private:
QString jsonKey;
public:
- explicit EventList(QString k) : jsonKey(k) { }
+ explicit EventList(QString k) : jsonKey(std::move(k)) { }
void fromJson(const QJsonObject& roomContents);
};
@@ -51,11 +51,10 @@ namespace QMatrixClient
int highlightCount;
int notificationCount;
- SyncRoomData(QString roomId_ = QString(),
- JoinState joinState_ = JoinState::Join,
- const QJsonObject& room_ = QJsonObject());
+ SyncRoomData(const QString& roomId, JoinState joinState_,
+ const QJsonObject& room_);
};
-}
+} // namespace QMatrixClient
Q_DECLARE_TYPEINFO(QMatrixClient::SyncRoomData, Q_MOVABLE_TYPE);
namespace QMatrixClient
@@ -63,15 +62,15 @@ namespace QMatrixClient
// QVector cannot work with non-copiable objects, std::vector can.
using SyncData = std::vector<SyncRoomData>;
- class ConnectionData;
class SyncJob: public BaseJob
{
public:
- SyncJob(ConnectionData* connection, QString since = {}, QString filter = {},
- int timeout = -1, QString presence = {});
+ explicit SyncJob(const ConnectionData* connection, const QString& since = {},
+ const QString& filter = {},
+ int timeout = -1, const QString& presence = {});
virtual ~SyncJob();
- SyncData& roomData();
+ SyncData&& takeRoomData();
QString nextBatch() const;
protected:
@@ -81,4 +80,4 @@ namespace QMatrixClient
class Private;
Private* d;
};
-}
+} // namespace QMatrixClient