Skip to content

Commit

Permalink
fixup! Simpler timeout with QTimer::singleShot (#4430) (#4435)
Browse files Browse the repository at this point in the history
* fixup! Simpler timeout with QTimer::singleShot (#4430)

* Move disconnect again

* Fix self assignement in HttpRequest.cpp.mustache
  • Loading branch information
MartinDelille authored and etherealjoy committed Nov 10, 2019
1 parent 139894f commit 7e6e87a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ QByteArray *{{prefix}}HttpRequestWorker::getMultiPartField(const QString &fieldn
}

void {{prefix}}HttpRequestWorker::setTimeOut(int timeOut){
_timeOut = _timeOut;
_timeOut = timeOut;
}

void {{prefix}}HttpRequestWorker::setWorkingDirectory(const QString &path){
Expand Down Expand Up @@ -365,7 +365,6 @@ void {{prefix}}HttpRequestWorker::on_manager_finished(QNetworkReply *reply) {
headers.insert(item.first, item.second);
}
}
disconnect(this, nullptr, nullptr, nullptr);
reply->deleteLater();
process_form_response();
emit on_execution_finished(this);
Expand All @@ -375,6 +374,7 @@ void {{prefix}}HttpRequestWorker::on_manager_timeout(QNetworkReply *reply) {
error_type = QNetworkReply::TimeoutError;
response = "";
error_str = "Timed out waiting for response";
disconnect(manager, nullptr, nullptr, nullptr);
reply->abort();
reply->deleteLater();
emit on_execution_finished(this);
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpp-qt5/client/PFXHttpRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ QByteArray *PFXHttpRequestWorker::getMultiPartField(const QString &fieldname){
}

void PFXHttpRequestWorker::setTimeOut(int timeOut){
_timeOut = _timeOut;
_timeOut = timeOut;
}

void PFXHttpRequestWorker::setWorkingDirectory(const QString &path){
Expand Down

0 comments on commit 7e6e87a

Please sign in to comment.