aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-04-30 22:17:04 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-04-30 22:27:10 +0900
commitae5835b959455d3f4eb86b3a1f3d98f3713bdfbe (patch)
tree22a4d9c436c468ced7455071947609785fa0ef63 /lib
parentecf7b64d3ca30ff607ca399f24800a50594b7ebf (diff)
downloadlibquotient-ae5835b959455d3f4eb86b3a1f3d98f3713bdfbe.tar.gz
libquotient-ae5835b959455d3f4eb86b3a1f3d98f3713bdfbe.zip
jobs/generated: cleanup C++
Diffstat (limited to 'lib')
-rw-r--r--lib/jobs/generated/administrative_contact.cpp18
-rw-r--r--lib/jobs/generated/create_room.cpp20
-rw-r--r--lib/jobs/generated/list_public_rooms.cpp50
3 files changed, 44 insertions, 44 deletions
diff --git a/lib/jobs/generated/administrative_contact.cpp b/lib/jobs/generated/administrative_contact.cpp
index 1af57941..ede15344 100644
--- a/lib/jobs/generated/administrative_contact.cpp
+++ b/lib/jobs/generated/administrative_contact.cpp
@@ -22,14 +22,14 @@ namespace QMatrixClient
{
template <> struct FromJson<GetAccount3PIDsJob::ThirdPartyIdentifier>
{
- GetAccount3PIDsJob::ThirdPartyIdentifier operator()(QJsonValue jv)
+ GetAccount3PIDsJob::ThirdPartyIdentifier operator()(const QJsonValue& jv)
{
- QJsonObject o = jv.toObject();
+ const auto& o = jv.toObject();
GetAccount3PIDsJob::ThirdPartyIdentifier result;
result.medium =
- fromJson<QString>(o.value("medium"));
+ fromJson<QString>(o.value("medium"));
result.address =
- fromJson<QString>(o.value("address"));
+ fromJson<QString>(o.value("address"));
return result;
}
@@ -82,16 +82,16 @@ namespace QMatrixClient
{
template <> struct FromJson<Post3PIDsJob::ThreePidCredentials>
{
- Post3PIDsJob::ThreePidCredentials operator()(QJsonValue jv)
+ Post3PIDsJob::ThreePidCredentials operator()(const QJsonValue& jv)
{
- QJsonObject o = jv.toObject();
+ const auto& o = jv.toObject();
Post3PIDsJob::ThreePidCredentials result;
result.clientSecret =
- fromJson<QString>(o.value("client_secret"));
+ fromJson<QString>(o.value("client_secret"));
result.idServer =
- fromJson<QString>(o.value("id_server"));
+ fromJson<QString>(o.value("id_server"));
result.sid =
- fromJson<QString>(o.value("sid"));
+ fromJson<QString>(o.value("sid"));
return result;
}
diff --git a/lib/jobs/generated/create_room.cpp b/lib/jobs/generated/create_room.cpp
index de7807b5..6e582791 100644
--- a/lib/jobs/generated/create_room.cpp
+++ b/lib/jobs/generated/create_room.cpp
@@ -23,16 +23,16 @@ namespace QMatrixClient
{
template <> struct FromJson<CreateRoomJob::Invite3pid>
{
- CreateRoomJob::Invite3pid operator()(QJsonValue jv)
+ CreateRoomJob::Invite3pid operator()(const QJsonValue& jv)
{
- QJsonObject o = jv.toObject();
+ const auto& o = jv.toObject();
CreateRoomJob::Invite3pid result;
result.idServer =
- fromJson<QString>(o.value("id_server"));
+ fromJson<QString>(o.value("id_server"));
result.medium =
- fromJson<QString>(o.value("medium"));
+ fromJson<QString>(o.value("medium"));
result.address =
- fromJson<QString>(o.value("address"));
+ fromJson<QString>(o.value("address"));
return result;
}
@@ -52,16 +52,16 @@ namespace QMatrixClient
{
template <> struct FromJson<CreateRoomJob::StateEvent>
{
- CreateRoomJob::StateEvent operator()(QJsonValue jv)
+ CreateRoomJob::StateEvent operator()(const QJsonValue& jv)
{
- QJsonObject o = jv.toObject();
+ const auto& o = jv.toObject();
CreateRoomJob::StateEvent result;
result.type =
- fromJson<QString>(o.value("type"));
+ fromJson<QString>(o.value("type"));
result.stateKey =
- fromJson<QString>(o.value("state_key"));
+ fromJson<QString>(o.value("state_key"));
result.content =
- fromJson<QJsonObject>(o.value("content"));
+ fromJson<QJsonObject>(o.value("content"));
return result;
}
diff --git a/lib/jobs/generated/list_public_rooms.cpp b/lib/jobs/generated/list_public_rooms.cpp
index 39653300..1e3c4ed8 100644
--- a/lib/jobs/generated/list_public_rooms.cpp
+++ b/lib/jobs/generated/list_public_rooms.cpp
@@ -29,28 +29,28 @@ namespace QMatrixClient
{
template <> struct FromJson<GetPublicRoomsJob::PublicRoomsChunk>
{
- GetPublicRoomsJob::PublicRoomsChunk operator()(QJsonValue jv)
+ GetPublicRoomsJob::PublicRoomsChunk operator()(const QJsonValue& jv)
{
- QJsonObject o = jv.toObject();
+ const auto& o = jv.toObject();
GetPublicRoomsJob::PublicRoomsChunk result;
result.aliases =
- fromJson<QVector<QString>>(o.value("aliases"));
+ fromJson<QVector<QString>>(o.value("aliases"));
result.canonicalAlias =
- fromJson<QString>(o.value("canonical_alias"));
+ fromJson<QString>(o.value("canonical_alias"));
result.name =
- fromJson<QString>(o.value("name"));
+ fromJson<QString>(o.value("name"));
result.numJoinedMembers =
- fromJson<double>(o.value("num_joined_members"));
+ fromJson<double>(o.value("num_joined_members"));
result.roomId =
- fromJson<QString>(o.value("room_id"));
+ fromJson<QString>(o.value("room_id"));
result.topic =
- fromJson<QString>(o.value("topic"));
+ fromJson<QString>(o.value("topic"));
result.worldReadable =
- fromJson<bool>(o.value("world_readable"));
+ fromJson<bool>(o.value("world_readable"));
result.guestCanJoin =
- fromJson<bool>(o.value("guest_can_join"));
+ fromJson<bool>(o.value("guest_can_join"));
result.avatarUrl =
- fromJson<QString>(o.value("avatar_url"));
+ fromJson<QString>(o.value("avatar_url"));
return result;
}
@@ -139,12 +139,12 @@ namespace QMatrixClient
{
template <> struct FromJson<QueryPublicRoomsJob::Filter>
{
- QueryPublicRoomsJob::Filter operator()(QJsonValue jv)
+ QueryPublicRoomsJob::Filter operator()(const QJsonValue& jv)
{
- QJsonObject o = jv.toObject();
+ const auto& o = jv.toObject();
QueryPublicRoomsJob::Filter result;
result.genericSearchTerm =
- fromJson<QString>(o.value("generic_search_term"));
+ fromJson<QString>(o.value("generic_search_term"));
return result;
}
@@ -170,28 +170,28 @@ namespace QMatrixClient
{
template <> struct FromJson<QueryPublicRoomsJob::PublicRoomsChunk>
{
- QueryPublicRoomsJob::PublicRoomsChunk operator()(QJsonValue jv)
+ QueryPublicRoomsJob::PublicRoomsChunk operator()(const QJsonValue& jv)
{
- QJsonObject o = jv.toObject();
+ const auto& o = jv.toObject();
QueryPublicRoomsJob::PublicRoomsChunk result;
result.aliases =
- fromJson<QVector<QString>>(o.value("aliases"));
+ fromJson<QVector<QString>>(o.value("aliases"));
result.canonicalAlias =
- fromJson<QString>(o.value("canonical_alias"));
+ fromJson<QString>(o.value("canonical_alias"));
result.name =
- fromJson<QString>(o.value("name"));
+ fromJson<QString>(o.value("name"));
result.numJoinedMembers =
- fromJson<double>(o.value("num_joined_members"));
+ fromJson<double>(o.value("num_joined_members"));
result.roomId =
- fromJson<QString>(o.value("room_id"));
+ fromJson<QString>(o.value("room_id"));
result.topic =
- fromJson<QString>(o.value("topic"));
+ fromJson<QString>(o.value("topic"));
result.worldReadable =
- fromJson<bool>(o.value("world_readable"));
+ fromJson<bool>(o.value("world_readable"));
result.guestCanJoin =
- fromJson<bool>(o.value("guest_can_join"));
+ fromJson<bool>(o.value("guest_can_join"));
result.avatarUrl =
- fromJson<QString>(o.value("avatar_url"));
+ fromJson<QString>(o.value("avatar_url"));
return result;
}