aboutsummaryrefslogtreecommitdiff
path: root/jobs/generated/list_public_rooms.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'jobs/generated/list_public_rooms.cpp')
-rw-r--r--jobs/generated/list_public_rooms.cpp43
1 files changed, 19 insertions, 24 deletions
diff --git a/jobs/generated/list_public_rooms.cpp b/jobs/generated/list_public_rooms.cpp
index 8a96966f..a2c0e406 100644
--- a/jobs/generated/list_public_rooms.cpp
+++ b/jobs/generated/list_public_rooms.cpp
@@ -2,11 +2,8 @@
* THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
*/
-
#include "list_public_rooms.h"
-#include "converters.h"
-
#include <QtCore/QStringBuilder>
using namespace QMatrixClient;
@@ -71,20 +68,20 @@ class GetPublicRoomsJob::Private
GetPublicRoomsJob::GetPublicRoomsJob(double limit, const QString& since, const QString& server)
: BaseJob(HttpVerb::Get, "GetPublicRoomsJob",
- basePath % "/publicRooms",
- Query {
- { "limit", toJson(limit).toString() },
- { "since", toJson(since).toString() },
- { "server", toJson(server).toString() }
- }, Data { }, false
- ), d(new Private)
-{ }
-
-GetPublicRoomsJob::~GetPublicRoomsJob()
-{
- delete d;
+ basePath % "/publicRooms", false)
+ , d(new Private)
+{
+ QUrlQuery _q;
+ _q.addQueryItem("limit", QString("%1").arg(limit));
+ if (!since.isEmpty())
+ _q.addQueryItem("since", since);
+ if (!server.isEmpty())
+ _q.addQueryItem("server", server);
+ setRequestQuery(_q);
}
+GetPublicRoomsJob::~GetPublicRoomsJob() = default;
+
const QVector<GetPublicRoomsJob::PublicRoomsChunk>& GetPublicRoomsJob::chunk() const
{
return d->chunk;
@@ -199,12 +196,13 @@ class QueryPublicRoomsJob::Private
QueryPublicRoomsJob::QueryPublicRoomsJob(const QString& server, double limit, const QString& since, const Filter& filter)
: BaseJob(HttpVerb::Post, "QueryPublicRoomsJob",
- basePath % "/publicRooms",
- Query {
- { "server", toJson(server).toString() }
- }
- ), d(new Private)
+ basePath % "/publicRooms")
+ , d(new Private)
{
+ QUrlQuery _q;
+ if (!server.isEmpty())
+ _q.addQueryItem("server", server);
+ setRequestQuery(_q);
QJsonObject _data;
_data.insert("limit", toJson(limit));
if (!since.isEmpty())
@@ -213,10 +211,7 @@ QueryPublicRoomsJob::QueryPublicRoomsJob(const QString& server, double limit, co
setRequestData(_data);
}
-QueryPublicRoomsJob::~QueryPublicRoomsJob()
-{
- delete d;
-}
+QueryPublicRoomsJob::~QueryPublicRoomsJob() = default;
const QVector<QueryPublicRoomsJob::PublicRoomsChunk>& QueryPublicRoomsJob::chunk() const
{