diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-05-03 20:10:14 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-05-03 22:47:47 +0900 |
commit | f3927ca0c16a61fcb0933333ecff8095917a5b47 (patch) | |
tree | e68d2fc1c19b2e3790086d3d6e43348a486fda69 /lib/jobs/generated/list_public_rooms.cpp | |
parent | 564d518c086f2aeab0f0466b7cd1915e20edc7da (diff) | |
download | libquotient-f3927ca0c16a61fcb0933333ecff8095917a5b47.tar.gz libquotient-f3927ca0c16a61fcb0933333ecff8095917a5b47.zip |
jobs/generated: Drop unused code
Diffstat (limited to 'lib/jobs/generated/list_public_rooms.cpp')
-rw-r--r-- | lib/jobs/generated/list_public_rooms.cpp | 54 |
1 files changed, 5 insertions, 49 deletions
diff --git a/lib/jobs/generated/list_public_rooms.cpp b/lib/jobs/generated/list_public_rooms.cpp index 9b4174cb..03664def 100644 --- a/lib/jobs/generated/list_public_rooms.cpp +++ b/lib/jobs/generated/list_public_rooms.cpp @@ -55,21 +55,7 @@ SetRoomVisibilityOnDirectoryJob::SetRoomVisibilityOnDirectoryJob(const QString& namespace QMatrixClient { - QJsonObject toJson(const GetPublicRoomsJob::PublicRoomsChunk& pod) - { - QJsonObject o; - o.insert("aliases", toJson(pod.aliases)); - o.insert("canonical_alias", toJson(pod.canonicalAlias)); - o.insert("name", toJson(pod.name)); - o.insert("num_joined_members", toJson(pod.numJoinedMembers)); - o.insert("room_id", toJson(pod.roomId)); - o.insert("topic", toJson(pod.topic)); - o.insert("world_readable", toJson(pod.worldReadable)); - o.insert("guest_can_join", toJson(pod.guestCanJoin)); - o.insert("avatar_url", toJson(pod.avatarUrl)); - - return o; - } + // Converters template <> struct FromJson<GetPublicRoomsJob::PublicRoomsChunk> { @@ -95,7 +81,7 @@ namespace QMatrixClient fromJson<bool>(o.value("guest_can_join")); result.avatarUrl = fromJson<QString>(o.value("avatar_url")); - + return result; } }; @@ -174,43 +160,13 @@ BaseJob::Status GetPublicRoomsJob::parseJson(const QJsonDocument& data) namespace QMatrixClient { + // Converters + QJsonObject toJson(const QueryPublicRoomsJob::Filter& pod) { QJsonObject o; o.insert("generic_search_term", toJson(pod.genericSearchTerm)); - - return o; - } - template <> struct FromJson<QueryPublicRoomsJob::Filter> - { - QueryPublicRoomsJob::Filter operator()(const QJsonValue& jv) - { - const auto& o = jv.toObject(); - QueryPublicRoomsJob::Filter result; - result.genericSearchTerm = - fromJson<QString>(o.value("generic_search_term")); - - return result; - } - }; -} // namespace QMatrixClient - -namespace QMatrixClient -{ - QJsonObject toJson(const QueryPublicRoomsJob::PublicRoomsChunk& pod) - { - QJsonObject o; - o.insert("aliases", toJson(pod.aliases)); - o.insert("canonical_alias", toJson(pod.canonicalAlias)); - o.insert("name", toJson(pod.name)); - o.insert("num_joined_members", toJson(pod.numJoinedMembers)); - o.insert("room_id", toJson(pod.roomId)); - o.insert("topic", toJson(pod.topic)); - o.insert("world_readable", toJson(pod.worldReadable)); - o.insert("guest_can_join", toJson(pod.guestCanJoin)); - o.insert("avatar_url", toJson(pod.avatarUrl)); - return o; } @@ -238,7 +194,7 @@ namespace QMatrixClient fromJson<bool>(o.value("guest_can_join")); result.avatarUrl = fromJson<QString>(o.value("avatar_url")); - + return result; } }; |