Skip to content

Commit 7e6e87a

Browse files
MartinDelilleetherealjoy
authored andcommitted
fixup! Simpler timeout with QTimer::singleShot (#4430) (#4435)
* fixup! Simpler timeout with QTimer::singleShot (#4430) * Move disconnect again * Fix self assignement in HttpRequest.cpp.mustache
1 parent 139894f commit 7e6e87a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.cpp.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ QByteArray *{{prefix}}HttpRequestWorker::getMultiPartField(const QString &fieldn
9191
}
9292

9393
void {{prefix}}HttpRequestWorker::setTimeOut(int timeOut){
94-
_timeOut = _timeOut;
94+
_timeOut = timeOut;
9595
}
9696

9797
void {{prefix}}HttpRequestWorker::setWorkingDirectory(const QString &path){
@@ -365,7 +365,6 @@ void {{prefix}}HttpRequestWorker::on_manager_finished(QNetworkReply *reply) {
365365
headers.insert(item.first, item.second);
366366
}
367367
}
368-
disconnect(this, nullptr, nullptr, nullptr);
369368
reply->deleteLater();
370369
process_form_response();
371370
emit on_execution_finished(this);
@@ -375,6 +374,7 @@ void {{prefix}}HttpRequestWorker::on_manager_timeout(QNetworkReply *reply) {
375374
error_type = QNetworkReply::TimeoutError;
376375
response = "";
377376
error_str = "Timed out waiting for response";
377+
disconnect(manager, nullptr, nullptr, nullptr);
378378
reply->abort();
379379
reply->deleteLater();
380380
emit on_execution_finished(this);

samples/client/petstore/cpp-qt5/client/PFXHttpRequest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ QByteArray *PFXHttpRequestWorker::getMultiPartField(const QString &fieldname){
100100
}
101101

102102
void PFXHttpRequestWorker::setTimeOut(int timeOut){
103-
_timeOut = _timeOut;
103+
_timeOut = timeOut;
104104
}
105105

106106
void PFXHttpRequestWorker::setWorkingDirectory(const QString &path){

0 commit comments

Comments
 (0)