aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2016-05-25 20:37:36 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2016-05-27 20:03:43 +0900
commit46050cd59a7af8cc7d616fab1a80db95dc8b5b35 (patch)
treed717d85e8b5d340050c317418e26addf1766a826
parent40195a814673fb8557a8b9c67a0f4d61191eb34e (diff)
downloadlibquotient-46050cd59a7af8cc7d616fab1a80db95dc8b5b35.tar.gz
libquotient-46050cd59a7af8cc7d616fab1a80db95dc8b5b35.zip
Use 'override' keyword throughout job classes; constify apiPath(), query(), data()
Thanks to CLang model.
-rw-r--r--jobs/basejob.cpp4
-rw-r--r--jobs/basejob.h6
-rw-r--r--jobs/checkauthmethods.cpp2
-rw-r--r--jobs/checkauthmethods.h6
-rw-r--r--jobs/joinroomjob.cpp2
-rw-r--r--jobs/joinroomjob.h6
-rw-r--r--jobs/leaveroomjob.cpp2
-rw-r--r--jobs/leaveroomjob.h4
-rw-r--r--jobs/mediathumbnailjob.cpp4
-rw-r--r--jobs/mediathumbnailjob.h6
-rw-r--r--jobs/passwordlogin.cpp4
-rw-r--r--jobs/passwordlogin.h8
-rw-r--r--jobs/postmessagejob.cpp4
-rw-r--r--jobs/postmessagejob.h8
-rw-r--r--jobs/postreceiptjob.cpp2
-rw-r--r--jobs/postreceiptjob.h2
-rw-r--r--jobs/roommembersjob.cpp2
-rw-r--r--jobs/roommembersjob.h6
-rw-r--r--jobs/roommessagesjob.cpp4
-rw-r--r--jobs/roommessagesjob.h8
-rw-r--r--jobs/syncjob.cpp4
-rw-r--r--jobs/syncjob.h6
22 files changed, 50 insertions, 50 deletions
diff --git a/jobs/basejob.cpp b/jobs/basejob.cpp
index e4350306..50c85048 100644
--- a/jobs/basejob.cpp
+++ b/jobs/basejob.cpp
@@ -68,12 +68,12 @@ ConnectionData* BaseJob::connection() const
return d->connection;
}
-QJsonObject BaseJob::data()
+QJsonObject BaseJob::data() const
{
return QJsonObject();
}
-QUrlQuery BaseJob::query()
+QUrlQuery BaseJob::query() const
{
return QUrlQuery();
}
diff --git a/jobs/basejob.h b/jobs/basejob.h
index bb3f42d4..98b7358b 100644
--- a/jobs/basejob.h
+++ b/jobs/basejob.h
@@ -64,9 +64,9 @@ namespace QMatrixClient
ConnectionData* connection() const;
// to implement
- virtual QString apiPath()=0;
- virtual QUrlQuery query();
- virtual QJsonObject data();
+ virtual QString apiPath() const = 0;
+ virtual QUrlQuery query() const;
+ virtual QJsonObject data() const;
virtual void parseJson(const QJsonDocument& data);
void fail( int errorCode, QString errorString );
diff --git a/jobs/checkauthmethods.cpp b/jobs/checkauthmethods.cpp
index 0554f749..55d8632a 100644
--- a/jobs/checkauthmethods.cpp
+++ b/jobs/checkauthmethods.cpp
@@ -52,7 +52,7 @@ QString CheckAuthMethods::session()
return d->session;
}
-QString CheckAuthMethods::apiPath()
+QString CheckAuthMethods::apiPath() const
{
return "_matrix/client/r0/login";
}
diff --git a/jobs/checkauthmethods.h b/jobs/checkauthmethods.h
index 2c9ab61a..197f7aa7 100644
--- a/jobs/checkauthmethods.h
+++ b/jobs/checkauthmethods.h
@@ -35,8 +35,8 @@ namespace QMatrixClient
QString session();
protected:
- QString apiPath();
- void parseJson(const QJsonDocument& data);
+ QString apiPath() const override;
+ void parseJson(const QJsonDocument& data) override;
private:
class Private;
@@ -44,4 +44,4 @@ namespace QMatrixClient
};
}
-#endif // QMATRIXCLIENT_CHECKAUTHMETHODS_H \ No newline at end of file
+#endif // QMATRIXCLIENT_CHECKAUTHMETHODS_H
diff --git a/jobs/joinroomjob.cpp b/jobs/joinroomjob.cpp
index 1001cd10..799d4926 100644
--- a/jobs/joinroomjob.cpp
+++ b/jobs/joinroomjob.cpp
@@ -49,7 +49,7 @@ QString JoinRoomJob::roomId()
return d->roomId;
}
-QString JoinRoomJob::apiPath()
+QString JoinRoomJob::apiPath() const
{
return QString("_matrix/client/r0/join/%1").arg(d->roomAlias);
}
diff --git a/jobs/joinroomjob.h b/jobs/joinroomjob.h
index 8f4059f2..1329ca56 100644
--- a/jobs/joinroomjob.h
+++ b/jobs/joinroomjob.h
@@ -34,8 +34,8 @@ namespace QMatrixClient
QString roomId();
protected:
- QString apiPath();
- void parseJson(const QJsonDocument& data);
+ QString apiPath() const override;
+ void parseJson(const QJsonDocument& data) override;
private:
class Private;
@@ -43,4 +43,4 @@ namespace QMatrixClient
};
}
-#endif // QMATRIXCLIENT_JOINROOMJOB_H \ No newline at end of file
+#endif // QMATRIXCLIENT_JOINROOMJOB_H
diff --git a/jobs/leaveroomjob.cpp b/jobs/leaveroomjob.cpp
index 4960a9df..b29c80ed 100644
--- a/jobs/leaveroomjob.cpp
+++ b/jobs/leaveroomjob.cpp
@@ -44,7 +44,7 @@ LeaveRoomJob::~LeaveRoomJob()
delete d;
}
-QString LeaveRoomJob::apiPath()
+QString LeaveRoomJob::apiPath() const
{
return QString("_matrix/client/r0/rooms/%1/leave").arg(d->room->id());
}
diff --git a/jobs/leaveroomjob.h b/jobs/leaveroomjob.h
index 535c44b8..9ce9bf4a 100644
--- a/jobs/leaveroomjob.h
+++ b/jobs/leaveroomjob.h
@@ -33,7 +33,7 @@ namespace QMatrixClient
virtual ~LeaveRoomJob();
protected:
- QString apiPath();
+ QString apiPath() const override;
private:
class Private;
@@ -41,4 +41,4 @@ namespace QMatrixClient
};
}
-#endif // QMATRIXCLIENT_LEAVEROOMJOB_H \ No newline at end of file
+#endif // QMATRIXCLIENT_LEAVEROOMJOB_H
diff --git a/jobs/mediathumbnailjob.cpp b/jobs/mediathumbnailjob.cpp
index b7d34bf2..48ed0ffb 100644
--- a/jobs/mediathumbnailjob.cpp
+++ b/jobs/mediathumbnailjob.cpp
@@ -53,12 +53,12 @@ QPixmap MediaThumbnailJob::thumbnail()
return d->thumbnail;
}
-QString MediaThumbnailJob::apiPath()
+QString MediaThumbnailJob::apiPath() const
{
return QString("/_matrix/media/v1/thumbnail/%1/%2").arg(d->url.host()).arg(d->url.path());
}
-QUrlQuery MediaThumbnailJob::query()
+QUrlQuery MediaThumbnailJob::query() const
{
QUrlQuery query;
query.addQueryItem("width", QString::number(d->requestedWidth));
diff --git a/jobs/mediathumbnailjob.h b/jobs/mediathumbnailjob.h
index 85dc8251..df7c1832 100644
--- a/jobs/mediathumbnailjob.h
+++ b/jobs/mediathumbnailjob.h
@@ -38,8 +38,8 @@ namespace QMatrixClient
QPixmap thumbnail();
protected:
- QString apiPath() override;
- QUrlQuery query() override;
+ QString apiPath() const override;
+ QUrlQuery query() const override;
protected slots:
void gotReply() override;
@@ -50,4 +50,4 @@ namespace QMatrixClient
};
}
-#endif // QMATRIXCLIENT_MEDIATHUMBNAILJOB_H \ No newline at end of file
+#endif // QMATRIXCLIENT_MEDIATHUMBNAILJOB_H
diff --git a/jobs/passwordlogin.cpp b/jobs/passwordlogin.cpp
index e8a6e5b4..9f0cb2e1 100644
--- a/jobs/passwordlogin.cpp
+++ b/jobs/passwordlogin.cpp
@@ -66,12 +66,12 @@ QString PasswordLogin::server()
return d->returned_server;
}
-QString PasswordLogin::apiPath()
+QString PasswordLogin::apiPath() const
{
return "_matrix/client/r0/login";
}
-QJsonObject PasswordLogin::data()
+QJsonObject PasswordLogin::data() const
{
QJsonObject json;
json.insert("type", "m.login.password");
diff --git a/jobs/passwordlogin.h b/jobs/passwordlogin.h
index 19df118e..5e93e74e 100644
--- a/jobs/passwordlogin.h
+++ b/jobs/passwordlogin.h
@@ -37,9 +37,9 @@ namespace QMatrixClient
QString server();
protected:
- QString apiPath();
- QJsonObject data();
- void parseJson(const QJsonDocument& data);
+ QString apiPath() const override;
+ QJsonObject data() const override;
+ void parseJson(const QJsonDocument& data) override;
private:
class Private;
@@ -47,4 +47,4 @@ namespace QMatrixClient
};
}
-#endif // QMATRIXCLIENT_PASSWORDLOGIN_H \ No newline at end of file
+#endif // QMATRIXCLIENT_PASSWORDLOGIN_H
diff --git a/jobs/postmessagejob.cpp b/jobs/postmessagejob.cpp
index 65042ed0..cf9b94fd 100644
--- a/jobs/postmessagejob.cpp
+++ b/jobs/postmessagejob.cpp
@@ -48,12 +48,12 @@ PostMessageJob::~PostMessageJob()
delete d;
}
-QString PostMessageJob::apiPath()
+QString PostMessageJob::apiPath() const
{
return QString("_matrix/client/r0/rooms/%1/send/m.room.message").arg(d->room->id());
}
-QJsonObject PostMessageJob::data()
+QJsonObject PostMessageJob::data() const
{
QJsonObject json;
json.insert("msgtype", d->type);
diff --git a/jobs/postmessagejob.h b/jobs/postmessagejob.h
index 7f40534e..1917ef25 100644
--- a/jobs/postmessagejob.h
+++ b/jobs/postmessagejob.h
@@ -34,9 +34,9 @@ namespace QMatrixClient
//bool success();
protected:
- QString apiPath();
- QJsonObject data();
- void parseJson(const QJsonDocument& data);
+ QString apiPath() const override;
+ QJsonObject data() const override;
+ void parseJson(const QJsonDocument& data) override;
private:
class Private;
@@ -44,4 +44,4 @@ namespace QMatrixClient
};
}
-#endif // QMATRIXCLIENT_POSTMESSAGEJOB_H \ No newline at end of file
+#endif // QMATRIXCLIENT_POSTMESSAGEJOB_H
diff --git a/jobs/postreceiptjob.cpp b/jobs/postreceiptjob.cpp
index 54220626..f99b6869 100644
--- a/jobs/postreceiptjob.cpp
+++ b/jobs/postreceiptjob.cpp
@@ -46,7 +46,7 @@ PostReceiptJob::~PostReceiptJob()
delete d;
}
-QString PostReceiptJob::apiPath()
+QString PostReceiptJob::apiPath() const
{
return QString("/_matrix/client/r0/rooms/%1/receipt/m.read/%2").arg(d->roomId).arg(d->eventId);
}
diff --git a/jobs/postreceiptjob.h b/jobs/postreceiptjob.h
index 2767fa9a..c5224af5 100644
--- a/jobs/postreceiptjob.h
+++ b/jobs/postreceiptjob.h
@@ -32,7 +32,7 @@ namespace QMatrixClient
virtual ~PostReceiptJob();
protected:
- QString apiPath();
+ QString apiPath() const override;
private:
class Private;
diff --git a/jobs/roommembersjob.cpp b/jobs/roommembersjob.cpp
index 6f1dabb7..c16ba481 100644
--- a/jobs/roommembersjob.cpp
+++ b/jobs/roommembersjob.cpp
@@ -50,7 +50,7 @@ QList< State* > RoomMembersJob::states()
return d->states;
}
-QString RoomMembersJob::apiPath()
+QString RoomMembersJob::apiPath() const
{
return QString("_matrix/client/r0/rooms/%1/members").arg(d->room->id());
}
diff --git a/jobs/roommembersjob.h b/jobs/roommembersjob.h
index 0349aa02..ffae4309 100644
--- a/jobs/roommembersjob.h
+++ b/jobs/roommembersjob.h
@@ -35,8 +35,8 @@ namespace QMatrixClient
QList<State*> states();
protected:
- virtual QString apiPath();
- virtual void parseJson(const QJsonDocument& data);
+ virtual QString apiPath() const override;
+ virtual void parseJson(const QJsonDocument& data) override;
private:
class Private;
@@ -44,4 +44,4 @@ namespace QMatrixClient
};
}
-#endif // QMATRIXCLIENT_ROOMMEMBERSJOB_H \ No newline at end of file
+#endif // QMATRIXCLIENT_ROOMMEMBERSJOB_H
diff --git a/jobs/roommessagesjob.cpp b/jobs/roommessagesjob.cpp
index 7db98a87..f1943d2c 100644
--- a/jobs/roommessagesjob.cpp
+++ b/jobs/roommessagesjob.cpp
@@ -64,12 +64,12 @@ QString RoomMessagesJob::end()
return d->end;
}
-QString RoomMessagesJob::apiPath()
+QString RoomMessagesJob::apiPath() const
{
return QString("/_matrix/client/r0/rooms/%1/messages").arg(d->room->id());
}
-QUrlQuery RoomMessagesJob::query()
+QUrlQuery RoomMessagesJob::query() const
{
QUrlQuery query;
query.addQueryItem("from", d->from);
diff --git a/jobs/roommessagesjob.h b/jobs/roommessagesjob.h
index 2a12ac08..6160dc57 100644
--- a/jobs/roommessagesjob.h
+++ b/jobs/roommessagesjob.h
@@ -39,9 +39,9 @@ namespace QMatrixClient
QString end();
protected:
- QString apiPath();
- QUrlQuery query();
- void parseJson(const QJsonDocument& data);
+ QString apiPath() const override;
+ QUrlQuery query() const override;
+ void parseJson(const QJsonDocument& data) override;
private:
class Private;
@@ -49,4 +49,4 @@ namespace QMatrixClient
};
}
-#endif // QMATRIXCLIENT_ROOMMESSAGESJOB_H \ No newline at end of file
+#endif // QMATRIXCLIENT_ROOMMESSAGESJOB_H
diff --git a/jobs/syncjob.cpp b/jobs/syncjob.cpp
index 04299b2c..37f79298 100644
--- a/jobs/syncjob.cpp
+++ b/jobs/syncjob.cpp
@@ -87,12 +87,12 @@ QList<SyncRoomData> SyncJob::roomData() const
return d->roomData;
}
-QString SyncJob::apiPath()
+QString SyncJob::apiPath() const
{
return "_matrix/client/r0/sync";
}
-QUrlQuery SyncJob::query()
+QUrlQuery SyncJob::query() const
{
QUrlQuery query;
if( !d->filter.isEmpty() )
diff --git a/jobs/syncjob.h b/jobs/syncjob.h
index abbef23a..19dd4646 100644
--- a/jobs/syncjob.h
+++ b/jobs/syncjob.h
@@ -72,9 +72,9 @@ namespace QMatrixClient
QString nextBatch() const;
protected:
- QString apiPath();
- QUrlQuery query();
- void parseJson(const QJsonDocument& data);
+ QString apiPath() const override;
+ QUrlQuery query() const override;
+ void parseJson(const QJsonDocument& data) override;
private:
class Private;