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
This commit is contained in:
Martin Delille
2019-11-10 17:05:22 +01:00
committed by sunn
parent 139894ffbe
commit 7e6e87a857
2 changed files with 3 additions and 3 deletions

View File

@@ -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){
@@ -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);
@@ -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);

View File

@@ -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){