Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update HttpRequest.cpp.mustache - use stable 4-parameter connect #18893

Merged
merged 33 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1afbc5e
Update HttpRequest.cpp.mustache
Jazzco Jun 10, 2024
1d4e78a
add generated files
Jazzco Jun 11, 2024
edcf3d5
Revert "add generated files"
Jazzco Jun 13, 2024
ca9abb8
changed from 3- to 4-parameter connect for api-body for stable connec…
Jazzco Jun 18, 2024
d647327
Merge branch 'OpenAPITools:master' into patch-1
Jazzco Jun 18, 2024
6f0b374
ran step 3 from Linux
Jazzco Jun 18, 2024
f863876
fixed missing braces and additional 3par issues
Jazzco Jun 18, 2024
f1a5215
Merge branch 'patch-1' of github.com:Jazzco/openapi-generator into pa…
Jazzco Jun 18, 2024
e0659d4
add step 3 generated file
Jazzco Jun 18, 2024
112a0cf
activate trace for more info about link issue
Jazzco Jun 20, 2024
b7e3d20
Update .github/workflows/samples-cpp-qt-client.yaml
Jazzco Jun 24, 2024
5e148f4
Update .github/workflows/samples-cpp-qt-client.yaml
Jazzco Jun 26, 2024
abfce2f
Update samples/client/petstore/cpp-qt/client/PFXPetApi.cpp
Jazzco Jun 27, 2024
30ffe54
Update modules/openapi-generator/src/main/resources/cpp-qt-client/Htt…
Jazzco Jun 27, 2024
8ee4526
Update modules/openapi-generator/src/main/resources/cpp-qt-client/Htt…
Jazzco Jun 27, 2024
5dacbd5
Update modules/openapi-generator/src/main/resources/cpp-qt-client/api…
Jazzco Jun 27, 2024
3fbc375
Update modules/openapi-generator/src/main/resources/cpp-qt-client/api…
Jazzco Jun 27, 2024
b1298f0
Update modules/openapi-generator/src/main/resources/cpp-qt-client/api…
Jazzco Jun 27, 2024
bc64138
Update samples/client/petstore/cpp-qt/client/PFXPetApi.cpp
Jazzco Jun 27, 2024
9361be6
Update samples/client/petstore/cpp-qt/client/PFXPetApi.cpp
Jazzco Jun 27, 2024
43fa200
Update samples/client/petstore/cpp-qt/client/PFXPetApi.cpp
Jazzco Jun 27, 2024
904732c
Update samples/client/petstore/cpp-qt/client/PFXPetApi.cpp
Jazzco Jun 27, 2024
898b52a
Merge branch 'OpenAPITools:master' into patch-1
Jazzco Jul 16, 2024
b1f3b18
Merge branch 'OpenAPITools:master' into patch-1
Jazzco Jul 19, 2024
209600d
Merge branch 'OpenAPITools:master' into patch-1
Jazzco Jul 25, 2024
6a2f2ee
rebuild examples
Jazzco Jul 26, 2024
2c39e6f
Merge branch 'master' into patch-1
Jazzco Aug 5, 2024
c7e3b77
Update modules/openapi-generator/src/main/resources/cpp-qt-client/api…
Jazzco Aug 5, 2024
24d6c67
removed braces and updated examples
Jazzco Aug 5, 2024
86d5104
Merge branch 'OpenAPITools:master' into patch-1
Jazzco Aug 7, 2024
d954acb
rebuild samples
Jazzco Aug 7, 2024
fe5315a
remove false generated changes
Jazzco Sep 4, 2024
c8985f8
Merge branch 'OpenAPITools:master' into patch-1
Jazzco Sep 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -376,12 +376,12 @@ void {{prefix}}HttpRequestWorker::execute({{prefix}}HttpRequestInput *input) {
}
if (reply != nullptr) {
reply->setParent(this);
connect(reply, &QNetworkReply::finished, [this, reply] {
connect(reply, &QNetworkReply::finished, this, [this, reply] () {
Jazzco marked this conversation as resolved.
Show resolved Hide resolved
on_reply_finished(reply);
});
}
if (timeOutTimer.interval() > 0) {
QObject::connect(&timeOutTimer, &QTimer::timeout, [this, reply] {
QObject::connect(&timeOutTimer, &QTimer::timeout, this, [this, reply] () {
Jazzco marked this conversation as resolved.
Show resolved Hide resolved
on_reply_timeout(reply);
});
timeOutTimer.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}}

connect(_latestWorker, &{{prefix}}HttpRequestWorker::on_execution_finished, this, &{{classname}}::{{nickname}}Callback);
connect(this, &{{classname}}::abortRequestsSignal, _latestWorker, &QObject::deleteLater);
connect(_latestWorker, &QObject::destroyed, [this](){
connect(_latestWorker, &QObject::destroyed, this, [this](){
Jazzco marked this conversation as resolved.
Show resolved Hide resolved
if(findChildren<{{prefix}}HttpRequestWorker*>().count() == 0){
Q_EMIT allPendingRequestsCompleted();
}
Expand Down Expand Up @@ -730,7 +730,7 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}}

connect(_latestWorker, &{{prefix}}HttpRequestWorker::on_execution_finished, this, &{{classname}}::{{nickname}}Callback);
connect(this, &{{classname}}::abortRequestsSignal, _latestWorker, &QObject::deleteLater);
connect(_latestWorker, &QObject::destroyed, [this](){
connect(_latestWorker, &QObject::destroyed, this, [this](){
Jazzco marked this conversation as resolved.
Show resolved Hide resolved
if(findChildren<{{prefix}}HttpRequestWorker*>().count() == 0){
Q_EMIT allPendingRequestsCompleted();
}
Expand Down Expand Up @@ -760,7 +760,7 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}}

connect(_latestWorker, &{{prefix}}HttpRequestWorker::on_execution_finished, this, &{{classname}}::{{nickname}}Callback);
connect(this, &{{classname}}::abortRequestsSignal, _latestWorker, &QObject::deleteLater);
connect(_latestWorker, &QObject::destroyed, [this](){
connect(_latestWorker, &QObject::destroyed, this, [this](){
Jazzco marked this conversation as resolved.
Show resolved Hide resolved
if(findChildren<{{prefix}}HttpRequestWorker*>().count() == 0){
Q_EMIT allPendingRequestsCompleted();
}
Expand Down Expand Up @@ -790,7 +790,7 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}}

connect(_latestWorker, &{{prefix}}HttpRequestWorker::on_execution_finished, this, &{{classname}}::{{nickname}}Callback);
connect(this, &{{classname}}::abortRequestsSignal, _latestWorker, &QObject::deleteLater);
connect(_latestWorker, &QObject::destroyed, [this](){
connect(_latestWorker, &QObject::destroyed, this, [this](){
Jazzco marked this conversation as resolved.
Show resolved Hide resolved
if(findChildren<{{prefix}}HttpRequestWorker*>().count() == 0){
Q_EMIT allPendingRequestsCompleted();
}
Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/cpp-qt/client/PFXHttpRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,12 +383,12 @@ void PFXHttpRequestWorker::execute(PFXHttpRequestInput *input) {
}
if (reply != nullptr) {
reply->setParent(this);
connect(reply, &QNetworkReply::finished, [this, reply] {
connect(reply, &QNetworkReply::finished, this, [this, reply] () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
connect(reply, &QNetworkReply::finished, this, [this, reply] () {
connect(reply, &QNetworkReply::finished, this, [this, reply] {

on_reply_finished(reply);
});
}
if (timeOutTimer.interval() > 0) {
QObject::connect(&timeOutTimer, &QTimer::timeout, [this, reply] {
QObject::connect(&timeOutTimer, &QTimer::timeout, this, [this, reply] () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
QObject::connect(&timeOutTimer, &QTimer::timeout, this, [this, reply] () {
QObject::connect(&timeOutTimer, &QTimer::timeout, this, [this, reply] {

on_reply_timeout(reply);
});
timeOutTimer.start();
Expand Down
14 changes: 7 additions & 7 deletions samples/client/petstore/cpp-qt/client/PFXPetApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ void PFXPetApi::addPet(const PFXPet &pfx_pet) {

connect(_latestWorker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::addPetCallback);
connect(this, &PFXPetApi::abortRequestsSignal, _latestWorker, &QObject::deleteLater);
connect(_latestWorker, &QObject::destroyed, [this](){
connect(_latestWorker, &QObject::destroyed, this, [this](){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
connect(_latestWorker, &QObject::destroyed, this, [this](){
connect(_latestWorker, &QObject::destroyed, this, [this] {

if(findChildren<PFXHttpRequestWorker*>().count() == 0){
Q_EMIT allPendingRequestsCompleted();
}
Expand Down Expand Up @@ -495,7 +495,7 @@ void PFXPetApi::deletePet(const qint64 &pet_id, const ::test_namespace::Optional

connect(_latestWorker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::deletePetCallback);
connect(this, &PFXPetApi::abortRequestsSignal, _latestWorker, &QObject::deleteLater);
connect(_latestWorker, &QObject::destroyed, [this](){
connect(_latestWorker, &QObject::destroyed, this, [this](){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
connect(_latestWorker, &QObject::destroyed, this, [this](){
connect(_latestWorker, &QObject::destroyed, this, [this] {

if(findChildren<PFXHttpRequestWorker*>().count() == 0){
Q_EMIT allPendingRequestsCompleted();
}
Expand Down Expand Up @@ -695,7 +695,7 @@ void PFXPetApi::findPetsByStatus(const QList<QString> &status) {

connect(_latestWorker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::findPetsByStatusCallback);
connect(this, &PFXPetApi::abortRequestsSignal, _latestWorker, &QObject::deleteLater);
connect(_latestWorker, &QObject::destroyed, [this](){
connect(_latestWorker, &QObject::destroyed, this, [this](){
Jazzco marked this conversation as resolved.
Show resolved Hide resolved
if(findChildren<PFXHttpRequestWorker*>().count() == 0){
Q_EMIT allPendingRequestsCompleted();
}
Expand Down Expand Up @@ -905,7 +905,7 @@ void PFXPetApi::findPetsByTags(const QList<QString> &tags) {

connect(_latestWorker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::findPetsByTagsCallback);
connect(this, &PFXPetApi::abortRequestsSignal, _latestWorker, &QObject::deleteLater);
connect(_latestWorker, &QObject::destroyed, [this](){
connect(_latestWorker, &QObject::destroyed, this, [this](){
Jazzco marked this conversation as resolved.
Show resolved Hide resolved
if(findChildren<PFXHttpRequestWorker*>().count() == 0){
Q_EMIT allPendingRequestsCompleted();
}
Expand Down Expand Up @@ -1127,7 +1127,7 @@ void PFXPetApi::updatePet(const PFXPet &pfx_pet) {

connect(_latestWorker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::updatePetCallback);
connect(this, &PFXPetApi::abortRequestsSignal, _latestWorker, &QObject::deleteLater);
connect(_latestWorker, &QObject::destroyed, [this](){
connect(_latestWorker, &QObject::destroyed, this, [this](){
Jazzco marked this conversation as resolved.
Show resolved Hide resolved
if(findChildren<PFXHttpRequestWorker*>().count() == 0){
Q_EMIT allPendingRequestsCompleted();
}
Expand Down Expand Up @@ -1263,7 +1263,7 @@ void PFXPetApi::updatePetWithForm(const qint64 &pet_id, const ::test_namespace::

connect(_latestWorker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::updatePetWithFormCallback);
connect(this, &PFXPetApi::abortRequestsSignal, _latestWorker, &QObject::deleteLater);
connect(_latestWorker, &QObject::destroyed, [this](){
connect(_latestWorker, &QObject::destroyed, this, [this](){
Jazzco marked this conversation as resolved.
Show resolved Hide resolved
if(findChildren<PFXHttpRequestWorker*>().count() == 0){
Q_EMIT allPendingRequestsCompleted();
}
Expand Down Expand Up @@ -1399,7 +1399,7 @@ void PFXPetApi::uploadFile(const qint64 &pet_id, const ::test_namespace::Optiona

connect(_latestWorker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::uploadFileCallback);
connect(this, &PFXPetApi::abortRequestsSignal, _latestWorker, &QObject::deleteLater);
connect(_latestWorker, &QObject::destroyed, [this](){
connect(_latestWorker, &QObject::destroyed, this, [this](){
Jazzco marked this conversation as resolved.
Show resolved Hide resolved
if(findChildren<PFXHttpRequestWorker*>().count() == 0){
Q_EMIT allPendingRequestsCompleted();
}
Expand Down
Loading