aboutsummaryrefslogtreecommitdiff
path: root/gtad/operation.cpp.mustache
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2022-10-06 19:27:24 +0200
committern-peugnet <n.peugnet@free.fr>2022-10-06 19:27:24 +0200
commit08632625e1a04257b5c7d4a9db2246ac07436748 (patch)
tree9ddadf219a7e352ddd3549ad1683282c944adfb6 /gtad/operation.cpp.mustache
parente9c2e2a26d3711e755aa5eb8a8478917c71d612b (diff)
parentd911b207f49e936b3e992200796110f0749ed150 (diff)
downloadlibquotient-08632625e1a04257b5c7d4a9db2246ac07436748.tar.gz
libquotient-08632625e1a04257b5c7d4a9db2246ac07436748.zip
Update upstream source from tag 'upstream/0.7.0'
Update to upstream version '0.7.0' with Debian dir 30dcb77a77433e4a54eab77c0b82ae925dead2d8
Diffstat (limited to 'gtad/operation.cpp.mustache')
-rw-r--r--gtad/operation.cpp.mustache23
1 files changed, 12 insertions, 11 deletions
diff --git a/gtad/operation.cpp.mustache b/gtad/operation.cpp.mustache
index 3c3396e9..4b75434c 100644
--- a/gtad/operation.cpp.mustache
+++ b/gtad/operation.cpp.mustache
@@ -1,8 +1,9 @@
-{{>preamble}}
+{{!
+SPDX-FileCopyrightText: 2020 Kitsune Ral <Kitsune-Ral@users.sf.net>
+SPDX-License-Identifier: LGPL-2.1-or-later
+}}{{>preamble}}
#include "{{filenameBase}}.h"
-#include <QtCore/QStringBuilder>
-
using namespace Quotient;
{{#operations}}{{#operation}}
{{#queryParams?}}
@@ -10,7 +11,7 @@ using namespace Quotient;
auto queryTo{{camelCaseOperationId}}(
{{#queryParams}}{{>joinedParamDef}}{{/queryParams}})
{
- BaseJob::Query _q;{{#queryParams}}
+ QUrlQuery _q;{{#queryParams}}
addParam<{{^required?}}IfNotEmpty{{/required?}}>(_q,
QStringLiteral("{{baseName}}"), {{paramName}});{{/queryParams}}
return _q;
@@ -33,20 +34,20 @@ QUrl {{camelCaseOperationId}}Job::makeRequestUrl(QUrl baseUrl{{#allParams?}},
{ {{#headerParams}}
setRequestHeader("{{baseName}}", {{paramName}}.toLatin1());
{{/headerParams}}{{#inlineBody}}{{^propertyMap}}{{^bodyParams?}}
- setRequestData(Data({{#consumesNonJson?}}{{nameCamelCase}}{{/consumesNonJson?
- }}{{^consumesNonJson?}}toJson({{nameCamelCase}}){{/consumesNonJson?}}));
+ setRequestData({ {{#consumesNonJson?}}{{nameCamelCase}}{{/consumesNonJson?
+ }}{{^consumesNonJson?}}toJson({{nameCamelCase}}){{/consumesNonJson?}} });
{{/bodyParams?}}{{/propertyMap}}{{/inlineBody
}}{{^consumesNonJson?}}{{#bodyParams?}}
- QJsonObject _data;
+ QJsonObject _dataJson;
{{#propertyMap}}
- fillJson(_data, {{nameCamelCase}});
+ fillJson(_dataJson, {{nameCamelCase}});
{{/propertyMap}}{{#inlineBody}}
- fillJson<{{>maybeOmittableType}}>(_data, {{paramName}});
+ fillJson<{{>maybeOmittableType}}>(_dataJson, {{paramName}});
{{/inlineBody}}{{#bodyParams}}
- addParam<{{^required?}}IfNotEmpty{{/required?}}>(_data,
+ addParam<{{^required?}}IfNotEmpty{{/required?}}>(_dataJson,
QStringLiteral("{{baseName}}"), {{paramName}});
{{/bodyParams}}
- setRequestData(std::move(_data));
+ setRequestData({ _dataJson });
{{/bodyParams?}}{{/consumesNonJson?}}{{#producesNonJson?}}
setExpectedContentTypes({ {{#produces}}"{{_}}"{{>cjoin}}{{/produces}} });
{{/producesNonJson?}}{{^producesNonJson?