From 10867950474a360426685ad888237a5542b0cfac Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Thu, 16 Jun 2022 13:28:35 +0200 Subject: operation.cpp.mustache: streamline RequestData construction That `std::move(_data)` never worked because the passed object is a precursor to RequestData, and RequestData always takes things by const-ref or by value, never by rvalue. Also, explicit mention of RequestData is unnecessary, as its constructors are implicit by design. --- gtad/operation.cpp.mustache | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gtad/operation.cpp.mustache b/gtad/operation.cpp.mustache index 3d26ec73..4b75434c 100644 --- a/gtad/operation.cpp.mustache +++ b/gtad/operation.cpp.mustache @@ -34,20 +34,20 @@ QUrl {{camelCaseOperationId}}Job::makeRequestUrl(QUrl baseUrl{{#allParams?}}, { {{#headerParams}} setRequestHeader("{{baseName}}", {{paramName}}.toLatin1()); {{/headerParams}}{{#inlineBody}}{{^propertyMap}}{{^bodyParams?}} - setRequestData(RequestData({{#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? -- cgit v1.2.3