From 4ced9792f27ed3d891c1f7772ae30d9fe452dd79 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sat, 14 Apr 2018 14:12:03 +0900 Subject: jobs/generated: Overload toJson() instead of operator QJsonObject()/QJsonValue() It slightly reduces the header interface and shortcuts the actual call chain (not that it had any performance implications, just easier reasoning). --- lib/jobs/generated/create_room.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'lib/jobs/generated/create_room.h') diff --git a/lib/jobs/generated/create_room.h b/lib/jobs/generated/create_room.h index b479615a..fdb11ada 100644 --- a/lib/jobs/generated/create_room.h +++ b/lib/jobs/generated/create_room.h @@ -26,7 +26,6 @@ namespace QMatrixClient QString medium; QString address; - operator QJsonObject() const; }; struct StateEvent @@ -35,7 +34,6 @@ namespace QMatrixClient QString stateKey; QJsonObject content; - operator QJsonObject() const; }; // End of inner data structures -- cgit v1.2.3 From f3927ca0c16a61fcb0933333ecff8095917a5b47 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Thu, 3 May 2018 20:10:14 +0900 Subject: jobs/generated: Drop unused code --- lib/jobs/generated/create_room.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'lib/jobs/generated/create_room.h') diff --git a/lib/jobs/generated/create_room.h b/lib/jobs/generated/create_room.h index fdb11ada..526463b0 100644 --- a/lib/jobs/generated/create_room.h +++ b/lib/jobs/generated/create_room.h @@ -25,7 +25,6 @@ namespace QMatrixClient QString idServer; QString medium; QString address; - }; struct StateEvent @@ -33,7 +32,6 @@ namespace QMatrixClient QString type; QString stateKey; QJsonObject content; - }; // End of inner data structures -- cgit v1.2.3 From c71c4eb027cc7bb3b6b1a9bd41c048fcdfe4aa90 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 4 May 2018 19:02:39 +0900 Subject: jobs/generated: code ordering, more comments --- lib/jobs/generated/create_room.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/jobs/generated/create_room.h') diff --git a/lib/jobs/generated/create_room.h b/lib/jobs/generated/create_room.h index 526463b0..8e38774f 100644 --- a/lib/jobs/generated/create_room.h +++ b/lib/jobs/generated/create_room.h @@ -34,11 +34,13 @@ namespace QMatrixClient QJsonObject content; }; - // End of inner data structures + // Construction/destruction explicit CreateRoomJob(const QString& visibility = {}, const QString& roomAliasName = {}, const QString& name = {}, const QString& topic = {}, const QVector& invite = {}, const QVector& invite3pid = {}, const QJsonObject& creationContent = {}, const QVector& initialState = {}, const QString& preset = {}, bool isDirect = {}, bool guestCanJoin = {}); ~CreateRoomJob() override; + // Result properties + const QString& roomId() const; protected: -- cgit v1.2.3 From e49a842e877d17a1c6cbbb2349c2816639447721 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 4 May 2018 19:09:57 +0900 Subject: Connection, jobs/generated: Use QStringList instead of QVector QStringList's API is richer, after all. --- lib/jobs/generated/create_room.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/jobs/generated/create_room.h') diff --git a/lib/jobs/generated/create_room.h b/lib/jobs/generated/create_room.h index 8e38774f..88ad7895 100644 --- a/lib/jobs/generated/create_room.h +++ b/lib/jobs/generated/create_room.h @@ -6,8 +6,9 @@ #include "../basejob.h" -#include #include +#include +#include #include "converters.h" @@ -36,7 +37,7 @@ namespace QMatrixClient // Construction/destruction - explicit CreateRoomJob(const QString& visibility = {}, const QString& roomAliasName = {}, const QString& name = {}, const QString& topic = {}, const QVector& invite = {}, const QVector& invite3pid = {}, const QJsonObject& creationContent = {}, const QVector& initialState = {}, const QString& preset = {}, bool isDirect = {}, bool guestCanJoin = {}); + explicit CreateRoomJob(const QString& visibility = {}, const QString& roomAliasName = {}, const QString& name = {}, const QString& topic = {}, const QStringList& invite = {}, const QVector& invite3pid = {}, const QJsonObject& creationContent = {}, const QVector& initialState = {}, const QString& preset = {}, bool isDirect = {}, bool guestCanJoin = {}); ~CreateRoomJob() override; // Result properties -- cgit v1.2.3 From 49022915fde72b83d9f18944c268110b01fa3469 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 4 May 2018 23:04:04 +0900 Subject: New home for the generated code - lib/csapi --- lib/jobs/generated/create_room.h | 54 ---------------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 lib/jobs/generated/create_room.h (limited to 'lib/jobs/generated/create_room.h') diff --git a/lib/jobs/generated/create_room.h b/lib/jobs/generated/create_room.h deleted file mode 100644 index 88ad7895..00000000 --- a/lib/jobs/generated/create_room.h +++ /dev/null @@ -1,54 +0,0 @@ -/****************************************************************************** - * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN - */ - -#pragma once - -#include "../basejob.h" - -#include -#include -#include - -#include "converters.h" - -namespace QMatrixClient -{ - // Operations - - class CreateRoomJob : public BaseJob - { - public: - // Inner data structures - - struct Invite3pid - { - QString idServer; - QString medium; - QString address; - }; - - struct StateEvent - { - QString type; - QString stateKey; - QJsonObject content; - }; - - // Construction/destruction - - explicit CreateRoomJob(const QString& visibility = {}, const QString& roomAliasName = {}, const QString& name = {}, const QString& topic = {}, const QStringList& invite = {}, const QVector& invite3pid = {}, const QJsonObject& creationContent = {}, const QVector& initialState = {}, const QString& preset = {}, bool isDirect = {}, bool guestCanJoin = {}); - ~CreateRoomJob() override; - - // Result properties - - const QString& roomId() const; - - protected: - Status parseJson(const QJsonDocument& data) override; - - private: - class Private; - QScopedPointer d; - }; -} // namespace QMatrixClient -- cgit v1.2.3